Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Detect Azure SAS tokens, SharedAccessKey connection strings, and Databricks PATs in CredentialLeakScorer

未关闭
#3,468 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

@nithin42 已经在做这个了。

开始于 2026年10月22日。

  • #3469 来自 @nithin42 —— 未关闭

评估

难度
3/5
预计耗时
1-2 天
新手友好度
68/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
python
领域
security

调研方向

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:

  1. Azure Shared Access Signature (SAS) tokens (sv=2022-11-02&...&sig=...), which are frequently leaked inside blob/container URLs or config snippets.
  2. Azure Service Bus / Event Hubs / IoT Hub connection string keys (SharedAccessKey=...), which use semicolon-delimited key-value pairs rather than amqp:// URIs and use SharedAccessKey instead of AccountKey.
  3. 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 with sv=20XX-XX-XX&... that include a base64/URL-encoded sig= parameter.
  • Azure Service Bus / Event Hub Key: matches SharedAccessKey=<base64-key> without flagging SharedAccessKeyName=....
  • Databricks API Token: matches dapi[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

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/PyRIT 的其他 Issue

查看 microsoft/PyRIT 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。