Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename environment variable #240

Merged
merged 1 commit into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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