From b6ce923869583dcfa9a7d075a4b065d53ee8ef91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lex=20Ruiz?= Date: Tue, 28 May 2024 18:32:16 +0200 Subject: [PATCH] Rename environment variable --- integrations/amazon-security-lake/README.md | 2 +- integrations/amazon-security-lake/src/lambda_function.py | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/integrations/amazon-security-lake/README.md b/integrations/amazon-security-lake/README.md index 7af236b61b6bb..87c56b6cb7f6a 100644 --- a/integrations/amazon-security-lake/README.md +++ b/integrations/amazon-security-lake/README.md @@ -98,7 +98,7 @@ Follow the [official documentation](https://docs.aws.amazon.com/lambda/latest/dg | AWS_BUCKET | True | The name of the Amazon S3 bucket in which Security Lake stores your custom source data | | SOURCE_LOCATION | True | The _Data source name_ of the _Custom Source_ | | ACCOUNT_ID | True | Enter the ID that you specified when creating your Amazon Security Lake custom source | - | AWS_REGION | True | AWS Region to which the data is written | + | REGION | True | AWS Region to which the data is written | | S3_BUCKET_OCSF | False | S3 bucket to which the mapped events are written | | OCSF_CLASS | False | The OCSF class to map the events into. Can be "SECURITY_FINDING" (default) or "DETECTION_FINDING". | diff --git a/integrations/amazon-security-lake/src/lambda_function.py b/integrations/amazon-security-lake/src/lambda_function.py index f8e140f2c84f3..0ee413f7f7656 100644 --- a/integrations/amazon-security-lake/src/lambda_function.py +++ b/integrations/amazon-security-lake/src/lambda_function.py @@ -14,7 +14,7 @@ service_name='s3', aws_access_key_id=os.environ.get('AWS_ACCESS_KEY_ID'), aws_secret_access_key=os.environ.get('AWS_SECRET_ACCESS_KEY'), - region_name=os.environ.get('AWS_REGION'), + region_name=os.environ.get('REGION'), endpoint_url=os.environ.get('AWS_ENDPOINT'), ) else: @@ -124,8 +124,7 @@ def lambda_handler(event, context): encoding='utf-8', level=logging.DEBUG) # Define required environment variables - required_variables = ['AWS_BUCKET', - 'SOURCE_LOCATION', 'ACCOUNT_ID', 'AWS_REGION'] + required_variables = ['AWS_BUCKET', 'SOURCE_LOCATION', 'ACCOUNT_ID', 'REGION'] # Check if all required environment variables are set if not check_environment_variables(required_variables): @@ -135,7 +134,7 @@ def lambda_handler(event, context): dst_bucket = os.environ['AWS_BUCKET'] src_location = os.environ['SOURCE_LOCATION'] account_id = os.environ['ACCOUNT_ID'] - region = os.environ['AWS_REGION'] + region = os.environ['REGION'] ocsf_bucket = os.environ.get('S3_BUCKET_OCSF') ocsf_class = os.environ.get('OCSF_CLASS', 'SECURITY_FINDING')