What the extra '1' is supposed to guarantee
How S3 Object Lock decides whether a delete succeeds
s3:BypassGovernanceRetention permission and sends the x-amz-bypass-governance-retention: true header can delete the version or shorten its retention. An IAM policy that grants s3:* includes that permission, and so does most of what people call 'admin'. Governance mode protects against mistakes and against limited service accounts. It does not stop someone holding a full admin role.
In compliance mode, no user can delete the version or shorten the retention until the date passes. That includes the account root user. Retention can only be extended. Because a bucket must be empty before it can be deleted, locked versions also block deletion of the bucket itself. Lifecycle rules cannot expire a locked version early either. At most they add delete markers on top of it.
| Mechanism | What refuses the delete | Who can still remove it |
|---|---|---|
| Backup app 'immutable' setting | Application logic | Anyone with backup server admin or the storage credentials |
| S3 Object Lock, governance mode | Storage service | Any principal with s3:BypassGovernanceRetention |
| S3 Object Lock, compliance mode | Storage service | Nobody until the retain-until date, subject to account-level risks below |
Linux immutable flag (chattr +i) | Kernel, per inode | Root, or anyone who can reach the disk below the filesystem |
| Tape or disk physically removed | Physics | Someone with physical access |
What an admin can still do under compliance mode
Why the immutable flag on a Linux repository is weaker than it looks
chattr +i sets the immutable attribute on a file's inode through the FS_IOC_SETFLAGS ioctl. Once it is set, the kernel refuses unlink, rename, writes, truncation, and new hard links for that inode with EPERM, and it does so even for root.
TEXT
Illustrative output format
# lsattr /backup/repo/job1.vbk
----i---------e------- /backup/repo/job1.vbk
# rm /backup/repo/job1.vbk
rm: cannot remove '/backup/repo/job1.vbk': Operation not permittedCAP_LINUX_IMMUTABLE capability, and root has that capability by default. A root shell runs chattr -i and then rm, and the protection is gone. Root can also skip the filesystem entirely by writing to the block device, reformatting the partition, or, on a virtualized repository, deleting the VM disk from the hypervisor. On a Proxmox host, for example, anyone with admin rights on the host can destroy the guest's storage without ever logging into the guest.
This is why 'hardened repository' designs focus less on the flag and more on keeping root out of reach. In practice that means no SSH access, a backup service account that cannot escalate, local accounts that are not joined to the production directory, and ideally separate hardware or a separate hypervisor with its own credentials. The flag does the job only when nobody the attacker can impersonate is able to become root on that box or administer the platform underneath it.
Offline media works on a different principle. A tape on a shelf or a disk in a drawer cannot be reached over the network at all. A tape that is still loaded in an online library is not offline, because the backup software can usually overwrite or erase it.
Testing deletion with the credentials an attacker would have
BASH
# Bucket-level lock defaults (mode and default retention)
aws s3api get-object-lock-configuration --bucket my-backup-bucket
# Versions and delete markers for one backup file
aws s3api list-object-versions --bucket my-backup-bucket --prefix backups/
# Retention on one specific version
aws s3api get-object-retention --bucket my-backup-bucket --key backups/job1.tar --version-id 'VERSION_ID'BASH
# Upload a canary with a short governance lock, using the profile under test
aws s3api put-object --bucket my-backup-bucket --key locktest/canary.txt --body canary.txt --object-lock-mode GOVERNANCE --object-lock-retain-until-date '2026-11-27T00:00:00Z' --profile cloud-admin
# Attempt 1: plain version delete. Expected: AccessDenied
aws s3api delete-object --bucket my-backup-bucket --key locktest/canary.txt --version-id 'VERSION_ID' --profile cloud-admin
# Attempt 2: with bypass. If this succeeds, this profile can erase your 'immutable' copy
aws s3api delete-object --bucket my-backup-bucket --key locktest/canary.txt --version-id 'VERSION_ID' --bypass-governance-retention --profile cloud-admin