Storage security

S3 Object Lock: test versions, not just object names

A delete marker can hide a protected version. Recovery tooling must know which version it needs.

3 min readAmazon S3Object LockRetention

An S3 object can disappear from a normal listing while a protected version remains intact. The reverse mistake is just as costly: seeing Object Lock enabled on a bucket and assuming every version has the required retention. Inspect and retrieve the specific versions the recovery plan depends on.

Understand the unit of protection

Amazon S3 Object Lock applies to object versions. AWS documents governance and compliance retention modes, along with legal holds. A new version or a delete marker can exist above a protected version. Governance bypass requires specific authority and a bypass request; compliance retention has a different boundary. See AWS Object Lock documentation.

These are Amazon S3 semantics. An S3-compatible product needs its own compatibility review. Do not assume identical retention behavior because both systems accept an S3 client.

Inspect a known test object

With AWS CLI installed and a read-only role authorized for a dedicated lab bucket, replace the example names and version identifier:

Command sequence
Inspect a known test object An excerpt from the example below. Expand the text to read and copy the complete listing. Illustrative example; not a captured production run. Open full size · Scroll sideways to inspect the terminal.
Read and copy the example as text
aws s3api get-object-lock-configuration --bucket example-recovery-lab
aws s3api list-object-versions --bucket example-recovery-lab --prefix test.txt
aws s3api get-object-retention --bucket example-recovery-lab \
  --key test.txt --version-id EXAMPLE_VERSION_ID
aws s3api get-object-legal-hold --bucket example-recovery-lab \
  --key test.txt --version-id EXAMPLE_VERSION_ID

Capture the exact version ID. An access-denied response means the inspection is incomplete; it does not mean retention is absent. Likewise, a bucket default is not a substitute for examining the version you intend to recover.

Design positive and negative tests

Upload synthetic data under an approved short test retention. Confirm that the protected version cannot be permanently removed by the ordinary application role. Test any governance-bypass role separately, with a disposable object and an explicit expected result.

Then verify that the recovery role can retrieve the intended historical version even when it is no longer the current one. Compare its content against a local test checksum. Do not perform these deletion exercises against actual backup objects.

Preserve the other dependencies

Object retention does not preserve an application’s encryption keys, restore catalog, account access, or business knowledge about which point is clean. Keep those in the recovery design. A backup system should also document its required permissions and supported bucket configuration before retention is enforced.

Monitor failed writes, cleanup failures, and capacity growth after rollout. Protection that interferes with a backup product’s lifecycle can create a different outage while appearing to improve security.

Evidence that answers the question

Keep the bucket configuration, protected version ID, retention state and tested identities with the results of the deletion-denial and retrieval tests. “Object Lock enabled” is only one line in that report.

Compare this model with PowerScale SmartLock; the two are related design problems, not interchangeable implementations.

All articles