Detect Azure SAS tokens, SharedAccessKey connection strings, and Databricks PATs in CredentialLeakScorer
I maintainer di solito rispondono entro 2 giorni
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 68/100
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:
- 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.
- Lingua principale
- Python
- Stelle
- 4.6k
- Fork
- 962
- Merge medio
- 2g 13h
- PR unite (30g)
- 423
Preparare l'ambiente
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
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microsoft/PyRIT
-
BUG: AzureBlobStorageTarget returns a URL with // when the container URL ends with a slashForse già presa @ShivamSharma43 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 2 giorni
-
BUG: OpenAIImageTarget uploads edited images under a generated local path instead of their file nameForse già presa @ShivamSharma43 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
I maintainer di solito rispondono entro 2 giorni
-
BUG: PathTraversalOutputScorer misses canonical Windows target windows/win.ini and IIS web.configForse già presa @Kaap10 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 2 giorni
-
BUG: XXEOutputScorer misses direct external DTD references and Java netdoc: / gopher: URI schemesForse già presa @Kaap10 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 2 giorni
-
BUG: StaticPromptInjectionScorer misses modern LLM chat template tokens (Meta Llama 3+, Google Gemma, Microsoft Phi-3/4)Forse già presa @Kaap10 l’ha presa oggi. Aperta
Difficoltà 1/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di microsoft/PyRIT
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
AstrBotDevs/AstrBot#10720 ·
I maintainer di solito rispondono entro 1 giorno
-
fix(xiaomi): curated picker list still offers six ids that return 400 (plan-limited vs retired)Apertacause/upstream comp/cli P2 provider/other tool/file type/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
NousResearch/hermes-agent#143900 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 85/100
WLAN-Pi/wlanpi-profiler#341 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
I maintainer di solito rispondono entro 1 giorno