microsoft / security-utilities

Security utilities for key generation, string redaction, etc.
MIT License
24 stars 9 forks source link

SEC101/109.AzureContainerRegistryLegacyKey masking bugs #49

Closed suvamM closed 2 months ago

suvamM commented 3 months ago

Stack trace:

  Message: 
Expected redacted to be 
"SEC101/109:X37eVgcWEaOy5h7/7+vD" because generate correlating ids == True, but 
"SEC101/101:X37eVgcWEaOy5h7/7+vD" differs near "1:X" (index 9).
Expected redacted to be 
"SEC101/109:80JzL+vxbAOH8za9yK3K" because generate correlating ids == True, but 
"SEC101/101:80JzL+vxbAOH8za9yK3K" differs near "1:8" (index 9).

  Stack Trace: 
LateBoundTestFramework.Throw(String message)
CollectingAssertionStrategy.ThrowIfAny(IDictionary`2 context)
SecretMaskerTests.ValidateSecurityModelsMasking(IEnumerable`1 patterns, IRegexEngine engine, Boolean lowEntropyModels) line 143
SecretMaskerTests.SecretMasker_HighConfidenceSecurityModels_Masking() line 115

Repro steps: Remove SEC101/109.AzureContainerRegistryLegacyKey from the WellKnownRegexPatternsExclusionList in WellKnownRegexPatternTests. Then re-run all tests to find the failing tests.