Harden Azure Key Vault trusted endpoint matching
维护者通常 2 天内回复
@apoorvdeshmukh 已经在做这个了。
开始于 2026年10月13日。
评估
调研方向
Start by locating SqlColumnEncryptionAzureKeyVaultProvider and reading its trusted-endpoint validation and constructor behavior, then inspect the related tests. Add coverage for the listed DNS, scheme, port, normalization, and input-mutation cases; done means endpoint validation follows the requested structured rules while preserving the described compatibility path.
由索引模型根据 Issue 内容生成。
描述
Is your feature request related to a problem? Please describe.
SqlColumnEncryptionAzureKeyVaultProvider validates an Azure Key Vault key URI by checking whether Uri.Host ends with one of its trusted endpoint strings. Raw suffix matching does not require a DNS-label boundary, so a hostname can match a trusted suffix without being that domain or one of its subdomains.
The trusted-endpoint representation also does not express whether an entry is an exact host, a DNS suffix, or a complete origin. This makes it difficult to apply clear scheme and port rules to application-supplied endpoints while preserving compatibility with custom Azure environments and development endpoints.
Describe the solution you'd like
Harden and clarify trusted endpoint validation:
- Match built-in domain suffixes only when the host is exactly the suffix or ends with
"." + suffix, using ordinal case-insensitive comparison. - Normalize DNS hosts consistently, including IDN and terminal-dot handling.
- Require HTTPS for built-in Azure Key Vault and Managed HSM endpoints.
- Validate and normalize application-supplied trusted endpoints when the provider is constructed.
- Provide structured semantics for custom endpoints, distinguishing exact origins from entries that intentionally include DNS subdomains.
- Defensively copy trusted endpoint collections so validation policy cannot be changed by mutating the constructor input.
- Preserve reasonable compatibility for existing custom endpoints, with diagnostics and an explicit migration path for ambiguous legacy entries.
Add tests covering:
- Valid exact hosts and subdomains.
- Lookalike suffixes that do not share a DNS-label boundary.
- Hosts that append another DNS suffix after a trusted name.
- Mixed-case, IDN, and terminal-dot hostnames.
- HTTP, HTTPS, default ports, and explicit custom ports.
- Mutation of the input trusted-endpoint array after construction.
Describe alternatives you've considered
- Keep raw
EndsWithmatching. This retains ambiguous behavior and does not accurately model DNS domain membership. - Require exact host matching for every entry. This would not work for the built-in Azure Key Vault domains, where each vault has its own subdomain.
- Immediately reject every legacy custom endpoint format. This would provide simpler rules but could unnecessarily disrupt applications using private clouds, proxies, or development services. A compatibility-conscious migration to structured endpoint rules is preferable.
Additional context
The current built-in list covers Azure Key Vault and Managed HSM domains in public and sovereign clouds. DNS-label-boundary matching should preserve valid hostnames beneath those domains while making the allowlist behavior precise.
- 主要语言
- C#
- 星标
- 996
- 派生
- 348
- 平均合并
- 5 天 15 小时
- 30 天内合并 PR
- 54
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
dotnet/SqlClient 的其他 Issue
-
SqlBatch.ValidateExecuteCommandBehavior XML comment says NotSupportedException but code throws ArgumentOutOfRangeException可能已有人在做 @apoorvdeshmukh 于 4 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 90/100
dotnet/SqlClient#4823 · 1 条评论 · 已指派 1 人 ·
维护者通常 2 天内回复
-
Sync ExecuteReader on an STA thread deadlocks against a StateChange handler that marshals to the UI thread (OpenAsyncRetry path)可能重新可做 @mdaigle 于 28 天前认领,目前没有进行中的 PR。 未关闭External :link:
难度 2/5 1-3 小时 新手友好度 64/100
dotnet/SqlClient#4534 · 2 条评论 · 已指派 1 人 ·
维护者通常 2 天内回复
-
Area\Tests
难度 2/5 1-3 小时 新手友好度 68/100
dotnet/SqlClient#4377 · 2 条评论 ·
维护者通常 2 天内回复
-
Auto-Triage: Waiting for Author
难度 3/5 1-2 天 新手友好度 55/100
dotnet/SqlClient#4854 · 6 条评论 ·
维护者通常 2 天内回复
-
:new: Triage Needed
难度 3/5 半天 新手友好度 15/100
维护者通常 2 天内回复
相似的 Issue
-
area: design documentation
难度 2/5 1-3 小时 新手友好度 76/100
eyalgolan/statecraft-israel#883 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 3 天内回复
-
area/indexing bug package/core triage
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
enhancement needs triage
难度 2/5 1-3 小时 新手友好度 70/100
elastic/docs-builder#4495 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复