From c0c4a952b7ac909303f3b006ebb49fa8d8d04417 Mon Sep 17 00:00:00 2001 From: hector-baez Date: Thu, 7 Dec 2023 11:55:34 -0600 Subject: [PATCH] redact value only --- scheduler/supabase/supabase_ben.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scheduler/supabase/supabase_ben.py b/scheduler/supabase/supabase_ben.py index 141496d..fc57c22 100644 --- a/scheduler/supabase/supabase_ben.py +++ b/scheduler/supabase/supabase_ben.py @@ -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'):