Join our Newsletter — 33% off our NHI Course

How do you enable S3 Object Lock by default on Amazon S3 buckets?

Enable S3 Object Lock by creating buckets with Object Lock enabled and applying a default retention policy where immutability is required. Existing buckets cannot simply be switched on in place, so plan for new protected buckets and lifecycle controls. Verify retention mode, legal holds, and permissions that could bypass protection.

What “by default” really means for S3 Object Lock

Amazon s3 object lock is not a bucket toggle you can safely retrofit after the fact. If you want protected storage by default, the bucket must be created with object lock enabled, then governed with a default retention policy so new objects inherit immutability automatically. That makes the bucket a deliberate control point, not an ordinary storage container.

For practitioners, the key design choice is whether immutability is required for every object or only for a subset of buckets and workflows. If retention is mandatory, create dedicated protected buckets and treat bucket creation as a controlled provisioning event rather than a routine application setting.

Because the control is bucket-scoped, default behaviour matters as much as retention mode. A bucket can look “enabled” while still allowing uploads that do not meet your intended protection posture if retention, legal hold usage, and writer permissions are not aligned.

How to implement default immutability without creating gaps

Start by creating a new bucket with Object Lock enabled and then apply the default retention rule at creation time or immediately after, using the retention mode that matches your policy. Governance mode is typically used when administrators need limited override authority, while compliance mode is stricter and designed for stronger immutability guarantees.

Next, verify the full path that can affect object protection. That means checking who can write objects, who can set or shorten retention, who can apply legal holds, and whether any automation, replication process, or deployment role has permissions that could bypass your intended safeguards.

The most common implementation mistake is assuming the bucket setting alone is enough. It is not. Object Lock only gives you the control plane for retention, and the real protection depends on how uploads are performed, which roles are allowed to manage retention, and whether your application lifecycle matches the retention period you chose.

For a broader view of AWS storage protection patterns, use the AWS Security Guide as the parent control context, then apply the bucket-specific design for immutable storage. If your risk comes from misconfigured storage or default settings, the Cloud Misconfiguration Guide is the right companion reference for understanding how storage controls fail in practice.

What to check before you trust the bucket is protected

Confirm that the default retention rule is actually active on newly written objects, not just documented in infrastructure code. Then test whether the intended mode, retention period, and legal hold workflow behave the way your incident response and legal teams expect under pressure.

Also check for privilege paths that can undermine immutability indirectly. A role with the ability to create replacement buckets, change replication targets, or write to an unprotected destination can defeat the business purpose even when the original bucket is configured correctly.

There is also a lifecycle issue: if you need immutable storage for backups or evidence, the bucket is only one part of the control. Restore testing, deletion resistance, and operational ownership all need to be designed together, otherwise you may preserve data that you cannot practically use when recovery time matters. The Backup Security and Immutable Backup Guide is useful when s3 object Lock is serving a backup or recovery role rather than a general storage role.

Risk and Threat Considerations

Object Lock is attractive because it can block destructive actions after compromise, but it also becomes a high-value target for an attacker who gets write or retention-management access. If the surrounding permissions are weak, the attacker may not need to delete the protected object, they may only need to redirect writes, create a parallel bucket, or abuse a role that can weaken the retention workflow.

Failure mechanism: The control fails when bucket creation, retention policy, and privileged access are not governed as one design. An overly broad role, a poorly scoped deployment pipeline, or a secondary bucket without equivalent protection can recreate the same data-loss path the lock was meant to block.

Impact: The result is false confidence. Teams may believe data is immutable while the actual recovery path, compliance posture, or evidence integrity can still be undermined by privilege misuse, misrouted writes, or unmanaged bucket creation.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Non-Human Identity Top 10 addresses the attack and risk surface, while CSA Cloud Controls Matrix and NIST SP 800-53 Rev 5 set the governance and control requirements practitioners need to meet.

Framework Control / Reference Relevance
CSA Cloud Controls Matrix IAM — Identity and Access Management Object Lock depends on tightly scoped access to retention and bucket management.
Recommendation — Restrict retention-changing and bucket-admin permissions to approved roles.
NIST SP 800-53 Rev 5 AC-6 — Least Privilege Prevent roles from bypassing retention or redirecting data to weaker destinations.
CM-6 — Configuration Settings Default retention is a configuration control that must be set and verified at creation.
AU-9 — Protection of Audit Information Immutable storage is often used to preserve logs and evidence from alteration.
Recommendation — Limit bucket, retention, and replication privileges to the minimum required. Standardize Object Lock bucket settings through approved configuration baselines. Store audit and evidence data in write-protected locations with governed retention.
OWASP Non-Human Identity Top 10 NHI-05 — Overprivileged NHI Automation and service roles that manage S3 can bypass immutability if overprivileged.
Recommendation — Review non-human roles that touch S3 and remove excess permissions.

Practitioner Guidance

What to prioritise: Treat protected S3 buckets as an exception-based storage tier. Define which workloads genuinely need immutability, then make bucket creation, retention mode, and retention period part of the approval workflow rather than an ad hoc console action.

What to verify: Verify the effective permissions on every role that can write to the bucket, manage retention, or create alternate storage paths. If a role can shorten protection or move data elsewhere, the control is not complete.

Decision rule: If the data must survive deletion or tampering during an incident, choose a dedicated new bucket with default retention and tightly bounded administration. If the use case does not need immutability, do not force Object Lock into a general-purpose bucket and create operational friction without a clear security gain.

Practitioner takeaway: The real control is not “turning on Object Lock”, it is proving that new data lands in a bucket whose retention, permissions, and recovery design all preserve immutability end to end.