You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CredentialLeakScorer's "Connection String" pattern matches only the schemes mongodb, postgres, mysql, redis and amqp. A URI that embeds a password under the scheme variants these services document is not reported. With the default patterns:
With patterns=CredentialLeakScorer.GARAK_PATTERNS, the separate "MongoDB Cloud Connection String" pattern already catches mongodb+srv://, but postgresql://, rediss:// and amqps:// are missed there too.
postgresql:// is the canonical libpq URI scheme (postgres:// is the alias), mongodb+srv:// is the format MongoDB Atlas hands out, and rediss:// / amqps:// are the TLS variants of the Redis and AMQP URIs that are already covered. A response that leaks one of these is scored as no leak.
These URIs are matched like their postgres://, mongodb://, redis:// and amqp:// counterparts.
Proposed fix
Widen the scheme group to mongodb(?:\+srv)?|postgres(?:ql)?|mysql|rediss?|amqps? in _DEFAULT_PATTERNS, and to mongodb|postgres(?:ql)?|mysql|rediss?|amqps? in GARAK_PATTERNS, where mongodb+srv:// already has its own pattern and adding it again would report one leak under two names. The rest of each pattern (and the credential capture group in GARAK_PATTERNS) stays the same. I'm happy to open the PR.
Activity