Detect Azure SAS tokens, SharedAccessKey connection strings, and Databricks PATs in CredentialLeakScorer
维护者通常 2 天内回复
评估
调研方向
Find CredentialLeakScorer and read its _DEFAULT_PATTERNS and GARAK_PATTERNS definitions, along with the existing tests for pattern matching and from_excluded_values. Add coverage for the three credential formats and confirm the tests cover the stated boundaries and exclusions; done means both pattern sets detect the requested formats without the specified false positives.
由索引模型根据 Issue 内容生成。
描述
Is your feature request related to a problem? Please describe.
CredentialLeakScorer currently checks for Azure Storage Key (AccountKey=...) and URI-based database connection strings (mongodb://, postgres://, etc.), and PR #3286 recently added OpenAI, Anthropic, and Hugging Face API keys.
However, when red-teaming agents or RAG pipelines deployed on Azure, several common Azure and AI platform credential formats are still missed by the default and Garak pattern sets:
- Azure Shared Access Signature (SAS) tokens (
sv=2022-11-02&...&sig=...), which are frequently leaked inside blob/container URLs or config snippets. - Azure Service Bus / Event Hubs / IoT Hub connection string keys (
SharedAccessKey=...), which use semicolon-delimited key-value pairs rather thanamqp://URIs and useSharedAccessKeyinstead ofAccountKey. - Databricks personal access tokens (
dapi+ 32 hex chars, with optional-<shard>suffix), commonly used in Azure Databricks and ML workflows.
Describe the solution you'd like
Add built-in regex patterns for these three formats to CredentialLeakScorer._DEFAULT_PATTERNS and CredentialLeakScorer.GARAK_PATTERNS (with (?P<credential>...) capture groups in GARAK_PATTERNS so from_excluded_values works as expected):
Azure SAS Token: matches query strings starting withsv=20XX-XX-XX&...that include a base64/URL-encodedsig=parameter.Azure Service Bus / Event Hub Key: matchesSharedAccessKey=<base64-key>without flaggingSharedAccessKeyName=....Databricks API Token: matchesdapi[0-9a-f]{32}(?:-[0-9])?with lookaround boundaries so partial or overlong hex strings are ignored.
Describe alternatives you've considered, if relevant
Users can pass custom regexes via CredentialLeakScorer(patterns=...), but having these in the default and Garak pattern sets makes out-of-the-box credential leak scoring much more useful for Azure and AI platform workloads.
- 主要语言
- Python
- 星标
- 4.6k
- 派生
- 962
- 平均合并
- 2 天 13 小时
- 30 天内合并 PR
- 423
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/PyRIT 的其他 Issue
-
BUG: AzureBlobStorageTarget returns a URL with // when the container URL ends with a slash可能已有人在做 @ShivamSharma43 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 2 天内回复
-
BUG: OpenAIImageTarget uploads edited images under a generated local path instead of their file name可能已有人在做 @ShivamSharma43 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 79/100
维护者通常 2 天内回复
-
BUG: PathTraversalOutputScorer misses canonical Windows target windows/win.ini and IIS web.config可能已有人在做 @Kaap10 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 2 天内回复
-
BUG: XXEOutputScorer misses direct external DTD references and Java netdoc: / gopher: URI schemes可能已有人在做 @Kaap10 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 2 天内回复
-
BUG: StaticPromptInjectionScorer misses modern LLM chat template tokens (Meta Llama 3+, Google Gemma, Microsoft Phi-3/4)可能已有人在做 @Kaap10 今天认领。 未关闭
难度 1/5 1-3 小时 新手友好度 84/100
维护者通常 2 天内回复
相似的 Issue
-
push_gh-pages fails on master branch on forks可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭good first issue infrastructure
难度 2/5 1-3 小时 新手友好度 76/100
kuznia-rdzeni/coreblocks#1135 ·
-
good first issue server
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
documentation priority: high
难度 2/5 1-3 小时 新手友好度 78/100
a-lex-s/mealie-telegram-bot#54 ·
维护者通常 1 天内回复
-
type/test
难度 2/5 1-3 小时 新手友好度 76/100
SaltedTan/virgil-language-server#218 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 83/100
btclib-org/btclib-wallet#541 ·
维护者通常 1 天内回复