feat: add optional S3 access logging for Control Tower compliance - #419
Merged
Conversation
….S3.PR.2) Add optional s3_access_logs_bucket_arn parameter to sagemaker-templates and sagemaker-model-cicd modules. When provided, all S3 buckets created by these modules will configure server access logging to the specified bucket, satisfying the CT.S3.PR.2 proactive control that blocks bucket creation without logging in Control Tower environments. Key changes: - sagemaker-templates: Wire parameter through settings/stack to xgboost_abalone (2 buckets) and batch_inference (1 bucket) - sagemaker-model-cicd: Wire parameter through Zod schema/props to all 3 pipeline artifact buckets and the LogsBucket - Log prefixes include project/pipeline/bucket names for disambiguation when multiple module instances share the same logging bucket - CDK Nag AwsSolutions-S1 suppressions are conditional: only applied when logging is not configured - Unit tests cover both logging-enabled and logging-disabled paths
newman911
reviewed
Feb 18, 2026
| }, | ||
| ]); | ||
| if (!accessLogsBucket) { | ||
| NagSuppressions.addResourceSuppressions(pipelineArtifactsBucket, [ |
Contributor
There was a problem hiding this comment.
why is the nag suppression in the "real code" ?
Contributor
Author
There was a problem hiding this comment.
If a user does not provide access logging, then they do not have a strict CT.S3.PR ruleset regime. In this scenario we revert to the existing behavior of suppressing. Why it's here, I'm not totally sure. Not ideal, but also do not see a priority to organize today.
newman911
reviewed
Feb 18, 2026
| { | ||
| "id": "AwsSolutions-S1", | ||
| "reason": ( | ||
| "S3 access logs are not required for CI/CD pipeline artifact buckets " |
Contributor
There was a problem hiding this comment.
this doesn't seem like the right reason, the right reason seems more like "logging access is optional everywhere"
is it?
Contributor
Author
There was a problem hiding this comment.
Is true. I did not change the existing reason. This I can change.
newman911
previously approved these changes
Feb 18, 2026
newman911
previously approved these changes
Feb 18, 2026
newman911
approved these changes
Feb 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add optional s3_access_logs_bucket_arn parameter to sagemaker-templates and sagemaker-model-cicd modules. When provided, all S3 buckets created by these modules will configure server access logging to the specified bucket, satisfying the CT.S3.PR.2 proactive control that blocks bucket creation without logging in Control Tower environments.
Key changes:
Describe your changes
Issue ticket number and link
Checklist before requesting a review
CHANGELOG.MDwith a description of my changesscripts/validate.sh)seedfarmer applyBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.