From ab48b935de519717eb5ec4ff28120d256be265d5 Mon Sep 17 00:00:00 2001 From: trend-yinghsiuliu <103998369+trend-yinghsiuliu@users.noreply.github.com> Date: Thu, 17 Oct 2024 11:17:35 +0800 Subject: [PATCH] fix: fix SyntaxWarning for invalid escape character (#186) --- post-scan-actions/aws-python-conformity-custom-check/handler.py | 2 +- post-scan-actions/aws-python-promote-or-quarantine/handler.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/post-scan-actions/aws-python-conformity-custom-check/handler.py b/post-scan-actions/aws-python-conformity-custom-check/handler.py index d277b206..f9ef8a9e 100644 --- a/post-scan-actions/aws-python-conformity-custom-check/handler.py +++ b/post-scan-actions/aws-python-conformity-custom-check/handler.py @@ -53,7 +53,7 @@ def lambda_handler(event, context): ccaccountid = get_cc_accountid(account_id) # Get the bucket & object details - s3_domain_pattern = "s3(\..+)?\.amazonaws.com" + s3_domain_pattern = r"s3(\..+)?\.amazonaws.com" url = urllib.parse.urlparse(message["file_url"]) # check pre-signed URL type, path or virtual if re.fullmatch(s3_domain_pattern, url.netloc): diff --git a/post-scan-actions/aws-python-promote-or-quarantine/handler.py b/post-scan-actions/aws-python-promote-or-quarantine/handler.py index 4d98a8c6..7592ddd6 100644 --- a/post-scan-actions/aws-python-promote-or-quarantine/handler.py +++ b/post-scan-actions/aws-python-promote-or-quarantine/handler.py @@ -36,7 +36,7 @@ } DEFAULT_MODE = 'move' -S3_DOMAIN_PATTERN = 's3(\..+)?\.amazonaws.com' +S3_DOMAIN_PATTERN = r's3(\..+)?\.amazonaws.com' FSS_TAG_PREFIX = 'fss-' CODE_EMPTY = 0