Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#3,468 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@nithin42 ci sta già lavorando.

Dal 22/10/2026.

  • #3469 di @nithin42 — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
68/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
security

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Python
Stelle
4.6k
Fork
962
Merge medio
2g 13h
PR unite (30g)
423

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di microsoft/PyRIT

Tutte le issue di microsoft/PyRIT

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.