Skip to content

feat: add optional S3 access logging for Control Tower compliance - #419

Merged
weklund merged 8 commits into
mainfrom
feat/logging-config
Feb 18, 2026
Merged

feat: add optional S3 access logging for Control Tower compliance#419
weklund merged 8 commits into
mainfrom
feat/logging-config

Conversation

@weklund

@weklund weklund commented Feb 17, 2026

Copy link
Copy Markdown
Contributor

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

Describe your changes

Issue ticket number and link

Checklist before requesting a review

  • I updated CHANGELOG.MD with a description of my changes
  • If the change was to a module, I ran the code validation script (scripts/validate.sh)
  • If the change was to a module, I have added thorough tests
  • If the change was to a module, I have added/updated the module's README.md
  • If a module was added, I added a reference to the module to the repository's README.md
  • I verified that my code deploys successfully using seedfarmer apply

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

weklund and others added 5 commits February 16, 2026 21:20
….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
},
]);
if (!accessLogsBucket) {
NagSuppressions.addResourceSuppressions(pipelineArtifactsBucket, [

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why is the nag suppression in the "real code" ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

{
"id": "AwsSolutions-S1",
"reason": (
"S3 access logs are not required for CI/CD pipeline artifact buckets "

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this doesn't seem like the right reason, the right reason seems more like "logging access is optional everywhere"

is it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Is true. I did not change the existing reason. This I can change.

newman911
newman911 previously approved these changes Feb 18, 2026
newman911
newman911 previously approved these changes Feb 18, 2026
@weklund
weklund merged commit 9095894 into main Feb 18, 2026
9 checks passed
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.

2 participants