Skip to content

Commit

Permalink
Improve performance of azure storage key regex (#218)
Browse files Browse the repository at this point in the history
  • Loading branch information
arielkru authored Jul 1, 2024
1 parent 53ae3a1 commit b824dd9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions detect_secrets/plugins/azure_storage_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ class AzureStorageKeyDetector(RegexBasedDetector):
r'{account_key}=\s*{secret}',

# maximum 2 lines secret distance under azure mention (case-insensitive)
r'(?i){azure}.*\n?.*\n?.*{secret}',
r'(?i)\b{azure}(.*\n){{0,2}}.*{secret}',

# maximum 2 lines secret distance above azure mention (case-insensitive)
r'(?i){secret}.*\n?.*\n?.*{azure}',
r'(?i)\b{secret}(.*\n){{0,2}}.*{azure}',
]

def analyze_line(
Expand Down

0 comments on commit b824dd9

Please sign in to comment.