Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#3,468 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

@nithin42 đang làm issue này rồi.

Từ ngày 22/10/2026.

  • #3469 của @nithin42 — đang mở

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
68/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
security

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Python
Star
4.6k
Fork
962
Merge trung bình
2 ngày 13 giờ
Pull request đã merge (30 ngày)
423

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của microsoft/PyRIT

Tất cả issue của microsoft/PyRIT

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.