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

Implement cross account support to Security Lake integration #657

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

QU3B1M
Copy link
Member

@QU3B1M QU3B1M commented Jan 28, 2025

Description

Update lambda_function script to assume the required role using an external account ID.

Add Unit Tests using the python library moto to mock AWS services and validate the lambda_function behaviour.

Test execution

% pytest -v
================================================================= test session starts ==================================================================
platform darwin -- Python 3.13.0, pytest-8.3.4, pluggy-1.5.0 -- /Users/quebim_wz/IdeaProjects/wazuh-indexer/integrations/amazon-security-lake/venv/bin/python3.13
cachedir: .pytest_cache
rootdir: /Users/quebim_wz/IdeaProjects/wazuh-indexer/integrations/amazon-security-lake/tests
configfile: pytest.ini
collected 7 items                                                                                                                                      

test_lambda_function.py::test_lambda_handler PASSED                                                                                              [ 14%]
test_lambda_function.py::test_assume_role PASSED                                                                                                 [ 28%]
test_lambda_function.py::test_get_s3_client PASSED                                                                                               [ 42%]
test_lambda_function.py::test_get_events PASSED                                                                                                  [ 57%]
test_lambda_function.py::test_write_parquet_file PASSED                                                                                          [ 71%]
test_lambda_function.py::test_upload_to_s3 PASSED                                                                                                [ 85%]
test_lambda_function.py::test_get_full_key PASSED                                                                                                [100%]

================================================================== 7 passed in 0.59s ===================================================================

Related Issues

Resolves #276

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@QU3B1M QU3B1M self-assigned this Jan 28, 2025
@QU3B1M QU3B1M marked this pull request as ready for review January 30, 2025 12:39
@QU3B1M QU3B1M requested a review from a team as a code owner January 30, 2025 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Security Lake Integration should support cross-account
1 participant