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

Add mechanism to check the regions parameter for AWS buckets #23431

Open
6 tasks
fdalmaup opened this issue May 15, 2024 · 0 comments
Open
6 tasks

Add mechanism to check the regions parameter for AWS buckets #23431

fdalmaup opened this issue May 15, 2024 · 0 comments
Labels
level/task type/enhancement New feature or request

Comments

@fdalmaup
Copy link
Member

Affected integration
AWS

Description

Since #22514, the AWS integration tests are generating their resources to test the module's behavior. Each launched test involving an S3 bucket creates the bucket, populates it with the corresponding logs, and at the end deletes the resources. For the --regions parameter, a test case involves requesting the logs for an unexistent region (us-fake-1) which in a normal module execution treats the parameter as a part of the log path and would return the following:

/var/ossec/wodles/aws/aws-s3 -b test-bucket -t config -s 2022-JAN-31 -p dev -d2 --regions us-fake-1
DEBUG: +++ Debug mode on - Level: 2
DEBUG: Generating default configuration for retries: mode standard - max_attempts 10
DEBUG: +++ Table does not exist; create
DEBUG: +++ Working on 123456789123 - us-fake-1
DEBUG: +++ Marker: AWSLogs/123456789123/Config/us-fake-1/2022/1/31
DEBUG: +++ No logs to process in bucket: 123456789123/us-fake-1
DEBUG: +++ DB Maintenance

Nevertheless, since the test builds up the bucket entirely and the region is not part of the available AWS regions, it fails and does not find the mentioned fake region.

The objective of the present issue is to modify the bucket's behavior to check the input --regions parameter and in case a nonexistent region is passed, to display a warning message that the region does not exist.

Tasks

  • Test in a manager.
  • Test in an agent.
  • Unit tests without failures. Updated if there are any relevant changes.
  • Integration tests without failures. Updated if there are any relevant changes.
  • Update the documentation if necessary.
  • Add entry to the changelog if necessary.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
level/task type/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants