Skip to content

Commit

Permalink
redact value only
Browse files Browse the repository at this point in the history
  • Loading branch information
hector-baez committed Dec 7, 2023
1 parent 934f47c commit c0c4a95
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions scheduler/supabase/supabase_ben.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
from configparser import ConfigParser

sensitive_patterns = [
r'AWS_ACCESS_KEY_ID=[\w-]+',
r'AWS_SECRET_ACCESS_KEY=[\w-]+',
r'AWS_DEFAULT_REGION=[\w-]+',
r'AWS_S3_ACCESS_KEY_ID=[\w-]+',
r'AWS_S3_SECRET_ACCESS_KEY=[\w-]+',
r'AWS_S3_DEFAULT_REGION=[\w-]+',
r'AWS_S3_BUCKET=[\w-]+'
r'(AWS_ACCESS_KEY_ID=)([^\s]+)',
r'(AWS_SECRET_ACCESS_KEY=)([^\s]+)',
r'(AWS_DEFAULT_REGION=)([^\s]+)',
r'(AWS_S3_ACCESS_KEY_ID=)([^\s]+)',
r'(AWS_S3_SECRET_ACCESS_KEY=)([^\s]+)',
r'(AWS_S3_DEFAULT_REGION=)([^\s]+)',
r'(AWS_S3_BUCKET=)([^\s]+)'
]

def scrub_command(command, sensitive_patterns):
for pattern in sensitive_patterns:
command = re.sub(pattern, "REDACTED", command)
command = re.sub(pattern, r'\1REDACTED', command)
return command

def config(filename='database.ini', section='postgresql'):
Expand Down

0 comments on commit c0c4a95

Please sign in to comment.