From eb081b36c970387c6a32745afe54781e5349fe07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lex=20Ruiz?= Date: Thu, 18 Apr 2024 17:14:29 +0200 Subject: [PATCH] Use default name for aws_region --- integrations/amazon-security-lake/Makefile | 5 +++-- integrations/amazon-security-lake/aws-lambda.dockerfile | 6 +++--- .../logstash/pipeline/indexer-to-s3.conf | 2 +- integrations/amazon-security-lake/src/lambda_function.py | 2 +- integrations/docker/amazon-security-lake.yml | 4 ++-- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/integrations/amazon-security-lake/Makefile b/integrations/amazon-security-lake/Makefile index 90cba5a684c64..94a12b6f8ac20 100644 --- a/integrations/amazon-security-lake/Makefile +++ b/integrations/amazon-security-lake/Makefile @@ -21,8 +21,9 @@ $(VIRTUAL_ENV): .ONESHELL: pack_src: @cd src - @zip ../$(ZIP_NAME).zip run.py wazuh_ocsf_converter.py + @zip ../$(ZIP_NAME).zip lambda_function.py wazuh_ocsf_converter.py @zip ../$(ZIP_NAME).zip models -r clean: - @rm -rf $(VIRTUAL_ENV) \ No newline at end of file + @rm -rf $(VIRTUAL_ENV) + @py3clean . \ No newline at end of file diff --git a/integrations/amazon-security-lake/aws-lambda.dockerfile b/integrations/amazon-security-lake/aws-lambda.dockerfile index ffd1e2138a124..7039c2b935de8 100644 --- a/integrations/amazon-security-lake/aws-lambda.dockerfile +++ b/integrations/amazon-security-lake/aws-lambda.dockerfile @@ -5,13 +5,13 @@ FROM amazon/aws-lambda-python:3.12 # Copy requirements.txt -COPY requirements.txt ${LAMBDA_TASK_ROOT} +COPY requirements.aws.txt ${LAMBDA_TASK_ROOT} # Install the specified packages -RUN pip install -r requirements.txt +RUN pip install -r requirements.aws.txt # Copy function code COPY src ${LAMBDA_TASK_ROOT} # Set the CMD to your handler (could also be done as a parameter override outside of the Dockerfile) -CMD [ "run.lambda_handler" ] \ No newline at end of file +CMD [ "lambda_function.lambda_handler" ] \ No newline at end of file diff --git a/integrations/amazon-security-lake/logstash/pipeline/indexer-to-s3.conf b/integrations/amazon-security-lake/logstash/pipeline/indexer-to-s3.conf index 7e7140318a1ce..f98281c6711df 100644 --- a/integrations/amazon-security-lake/logstash/pipeline/indexer-to-s3.conf +++ b/integrations/amazon-security-lake/logstash/pipeline/indexer-to-s3.conf @@ -28,7 +28,7 @@ output { id => "output.s3" access_key_id => "${AWS_ACCESS_KEY_ID}" secret_access_key => "${AWS_SECRET_ACCESS_KEY}" - region => "${AWS_REGION}" + region => "${AWS_DEFAULT_REGION}" endpoint => "http://s3.ninja:9000" bucket => "${AWS_BUCKET}" codec => "json_lines" diff --git a/integrations/amazon-security-lake/src/lambda_function.py b/integrations/amazon-security-lake/src/lambda_function.py index 5e97d5414c819..98af7640e2c89 100644 --- a/integrations/amazon-security-lake/src/lambda_function.py +++ b/integrations/amazon-security-lake/src/lambda_function.py @@ -13,7 +13,7 @@ service_name='s3', aws_access_key_id=os.environ['AWS_ACCESS_KEY_ID'], aws_secret_access_key=os.environ['AWS_SECRET_ACCESS_KEY'], - region_name=os.environ['AWS_REGION'], + region_name=os.environ['AWS_DEFAULT_REGION'], endpoint_url='http://s3.ninja:9000', ) diff --git a/integrations/docker/amazon-security-lake.yml b/integrations/docker/amazon-security-lake.yml index 34b36a148cce8..3a16e08889e50 100644 --- a/integrations/docker/amazon-security-lake.yml +++ b/integrations/docker/amazon-security-lake.yml @@ -82,7 +82,7 @@ services: MONITORING_ENABLED: false AWS_ACCESS_KEY_ID: "AKIAIOSFODNN7EXAMPLE" AWS_SECRET_ACCESS_KEY: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" - AWS_REGION: "us-east-1" + AWS_DEFAULT_REGION: "us-east-1" AWS_BUCKET: "wazuh-indexer-aux-bucket" ASL_BUCKET: "wazuh-indexer-amazon-security-lake-bucket" ports: @@ -116,7 +116,7 @@ services: environment: AWS_ACCESS_KEY_ID: "AKIAIOSFODNN7EXAMPLE" AWS_SECRET_ACCESS_KEY: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" - AWS_REGION: "us-east-1" + AWS_DEFAULT_REGION: "us-east-1" AWS_BUCKET: "wazuh-indexer-amazon-security-lake-bucket" volumes: - ../amazon-security-lake/src:/var/task