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 configuration options for AWS S3 server access logging #3006

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

Conversation

findmyname666
Copy link

@findmyname666 findmyname666 commented Mar 18, 2024

Description

Fixes #3003.

In our environment the S3 bucket where should be stored S3 access logs is pre-created by "central" team and we don't have permissions to do any changes. In such case we don't have to:

  • Create it - the current code creates the logging bucket only if it doesn't exist. No change is needed.
  • Configure logging bucket e.g. ACL, public access, encryption, tls enforcement - adding option to skip the configuration for access log bucket.
  • PartitionDateSource - Adding one more option to allow users to configure PartitionDateSource.

Additionally 1) adding error logging into the function configureAccessLogBucket. Without it I wasn't able to detect why the logging isn't configured on the source bucket. The error is returned but ignored. 2) Adding code to detect if the logging policy / configuration was change. The previous code just check if some policy is enabled.

TODOs

Read the Gruntwork contribution guidelines.

  • Update the docs.
  • Run the relevant tests successfully, including pre-commit checks.
  • Ensure any 3rd party code adheres with our license policy or delete this line if its not applicable.
  • Include release notes. If this PR is backward incompatible, include a migration guide.

Release Notes (draft)

Added / Removed / Updated [X].

Migration Guide

N/A.

@findmyname666 findmyname666 changed the title Expose additional configuration options for AWS S3 server access logging Add configuration options for AWS S3 server access logging Mar 18, 2024
SkipAccessLoggingBucketAcl bool `mapstructure:"skip_accesslogging_bucket_acl"`
SkipAccessLoggingBucketEnforcedTLS bool `mapstructure:"skip_accesslogging_bucket_enforced_tls"`
SkipAccessLoggingBucketPublicAccessBlocking bool `mapstructure:"skip_accesslogging_bucket_public_access_blocking"`
SkipAccessLoggingBucketSSEncryption bool `mapstructure:"skip_accesslogging_bucket_ssencryption"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please consider adding tests to ensure that the newly added fields are functioning as expected?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @denis256, Thx for your feedback. I tried to updated existing existing tests and added one new for method createS3LoggingInput. Please let me know if I missed anything else.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @denis256 , Can I politely ask you for re-review once you have some free time please? Thx.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @denis256, do you think you'll have time to take a look on this PR in the upcoming days?

@findmyname666 findmyname666 force-pushed the feature/s3-new-options-access-logging-3003 branch from 675daef to e4b533b Compare April 5, 2024 19:11
@findmyname666 findmyname666 changed the base branch from master to pull-request-2878 April 5, 2024 19:19
@findmyname666 findmyname666 changed the base branch from pull-request-2878 to master April 5, 2024 19:19
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.

Expose additional configuration options for AWS S3 server access logging
3 participants