Skip to content

feat: opt-in deletion protection for cluster control plane log group#53

Open
sm-utkarsh wants to merge 1 commit into
mainfrom
feat/log-group-deletion-protection
Open

feat: opt-in deletion protection for cluster control plane log group#53
sm-utkarsh wants to merge 1 commit into
mainfrom
feat/log-group-deletion-protection

Conversation

@sm-utkarsh

Copy link
Copy Markdown
Contributor

Summary

  • Adds opt-in clusterConfig.logGroupDeletionProtection and clusterConfig.logGroupRetentionDays to ClusterConfig.
  • When logGroupDeletionProtection is true, EKSCluster now creates/manages the control plane log group (/aws/eks/<clusterName>/cluster) with DeletionProtection set, guarding it against accidental deletion (e.g. via console or aws logs delete-log-group).
  • Retention defaults to infinite (matches current behavior) unless logGroupRetentionDays is set. Passing logs.RetentionDays.INFINITE explicitly is handled correctly (that enum sentinel isn't a valid literal for CloudFormation, so it's translated to "omit the property").
  • Fully backward compatible — both fields are optional and off by default, so existing consumers see no behavior change.

Motivated by a security finding on sib-infra-cdk-prod-eks: EKS cluster logs were forwarded to CloudWatch but the log group had no deletion protection, risking loss of audit/monitoring data.

Test plan

  • tsc --noEmit passes cleanly
  • Consume this branch from sib-infra-cdk-prod-eks, cdk synth, confirm the AWS::Logs::LogGroup resource has DeletionProtection: true and correct LogGroupName
  • cdk diff/deploy against SIB-PROD to confirm no disruption to existing control plane logging

Exposes clusterConfig.logGroupDeletionProtection and logGroupRetentionDays
so consumers can protect /aws/eks/<clusterName>/cluster from accidental
deletion. Defaults to off/infinite retention to preserve existing behavior.
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.

1 participant