An AWS CDK S3 bucket is defined without versioning, so an overwrite or delete cannot be undone
What it finds
Without versioned=True, writing an object replaces the old data and deleting it removes it for good, whether by mistake, by a bug or by an attacker. Versioning keeps the previous versions recoverable.
From the rule's source, s3_bucket_without_versioning.rs.
from aws_cdk import aws_s3 as s3 def stack(scope): s3.Bucket(scope, "Logs")tx0 reports: this bucket keeps no earlier versions s3.Bucket(scope, "Data", versioned=True) Turn it on, off or suppress it
The rule runs from the strict tier up. To turn it on in a lower tier, give it a level in tx0.toml:
[rules]
"tx0/python:s3-bucket-without-versioning" = "note"To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:
# tx0: ignore[tx0/python:s3-bucket-without-versioning] reason="..."tx0 explain tx0/python:s3-bucket-without-versioning shows the same in the terminal. Found a false positive? Report it.