Skip to content

Commit

Permalink
Rename environment variable (#240)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexRuiz7 committed Aug 20, 2024
1 parent ee99107 commit b17ecbf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion integrations/amazon-security-lake/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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". |

Expand Down
7 changes: 3 additions & 4 deletions integrations/amazon-security-lake/src/lambda_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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):
Expand All @@ -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')

Expand Down

0 comments on commit b17ecbf

Please sign in to comment.