Skip to navigation

Object Lock is a bucket feature that stops objects from being deleted or overwritten for a period you choose. It’s sometimes called WORM — write once, read many. Use it for records you must keep unchanged (invoices, audit logs, regulated data) and to protect backups from ransomware or accidental deletion.

Object Lock can only be turned on when you create a bucket, and it can’t be turned off. A bucket with Object Lock can never be deleted, even when empty. Create one only for data that truly needs it.

When to use Object Lock, and which mode

You want to…UseWho can remove the protection early
Protect backups from mistakes, but keep an escape hatchGovernance retentionUsers with special permission
Meet a legal or regulatory duty to keep records unchangedCompliance retentionNo one, not even an admin, until the date passes
Keep one object for an unknown time (a lawsuit, an investigation)Legal holdAnyone with write access, by removing the hold
Delete old files automaticallyA lifecycle rule, not Object Lock—

How it works

  1. You create the bucket with Object lock (WORM) on. This also turns on versioning: when an object is overwritten, the old version is kept.
  2. A retention period (a number of days or years) is set on each new object — from the bucket’s default retention, or one object at a time. Until it ends, the object version can’t be deleted or overwritten.
  3. A legal hold can be added to any object. It has no end date and protects the object until someone removes it.

Before you begin

  • Decide before you create the bucket: Object Lock can’t be added later. To use it for existing data, create a new bucket with it on and copy the data over.
  • Choose the retention mode and period. Check them twice: Compliance retention can’t be shortened.
  • Write access to create the bucket and change its settings.

Turn on Object Lock when you create a bucket

1

Start creating a bucket

Open Object Storage, click Create Bucket, and fill in the name, location and storage type. See Create a bucket.

2

Turn on Object lock (WORM)

Under Versioning and object lock, turn on Object lock (WORM). Versioning turns on with it.

3

Pick the default retention

Choose None (No default retention policy is applied.), Governance (Admins with permissions can update or bypass retention.) or Compliance (Strict lock until retention expires.). For Governance or Compliance, enter the Retention period in days: 30 by default, at least 1.

4

Create the bucket

Click Create Bucket. On the bucket’s Settings → General tab, Object Lock now shows as enabled.

With the API, add "object_lock_enabled": true and, optionally, "default_retention": {"mode": "COMPLIANCE", "days": 365} to POST /object-storage/buckets.

Change the default retention

The default applies to objects uploaded after you save it.

1

Open Lock Settings

Open the bucket → Settings → Lock Settings. The Default Retention Policy card shows Configured or Not configured.

2

Edit it

Click Edit. Choose the Retention Mode — GOVERNANCE or COMPLIANCE — and set the Retention Period as a number of Days or Years. The page shows the Total Retention Period.

3

Save

Click Save Changes (or Save Retention Policy the first time).

With the API, once management resumes: PUT /object-storage/buckets/{bucket_name}/object-lock with {"rule": {"mode": "GOVERNANCE", "days": 30}}, or {"rule": null} to remove the default. GET on the same path returns it.

Lock one object

In a bucket with Object Lock, each object’s actions menu on the Objects tab has two extra entries.

Set a retention date:

  1. Click Set Retention.
  2. Choose Governance (Admin can override) or Compliance (Cannot delete by anyone).
  3. Enter Retain for (days). The dialog shows the Locked until date.
  4. Click Lock File. The menu then shows the Locked until date instead of Set Retention.

Add or remove a legal hold:

  1. Click Set Legal Hold, switch the Legal hold status to ON, and click Apply ON.
  2. To lift it, click Remove Legal Hold.

Per-object retention and legal hold are set in the portal only: the S3 calls PutObjectRetention and PutObjectLegalHold return 501, and the REST API has no operation for them.

Verify

  • Settings → General shows Object Lock enabled.
  • Lock Settings shows Configured with your mode and period.
  • On a locked object, the delete icon is disabled with Cannot delete: object has retention lock or Cannot delete: object has legal hold.

Limits

Value
When you can turn it onOnly at bucket creation
Turning it offNot possible
Deleting a bucket with Object LockNot possible, even when empty
Default retention in the API1 to 36,500 days, or 1 to 100 years
Default retention at creation in the portal30 days by default; at least 1 day
Which objects the default applies toObjects uploaded after it is saved
Legal holdNo end date; stays until removed
Empty bucketNot available for Object Lock buckets

Troubleshooting

You seeWhat it meansWhat to do
Object Lock not enabled — Object locking must be enabled when creating the bucket to use retention policies. This setting cannot be changed after bucket creation.The bucket was created without Object LockCreate a new bucket with Object lock (WORM) on and copy the data.
Bucket cannot be deleted because Object Lock is enabled.Object Lock buckets are permanentKeep the bucket; stop using it if no longer needed.
Cannot delete “NAME”. This object is protected.The object has a retention date or legal holdWait until Locked until, or remove the legal hold.
Object is locked and cannot be modified or deleted. Check retention settings or legal hold status. (API)Same as aboveSame as above.
An object uploaded earlier isn’t protectedThe default retention applies only to later uploadsUse Set Retention on that object.
Lifecycle rules don’t remove some objectsLocked objects can’t be deleted until the lock endsExpected; they’re removed after the lock ends.
API GET …/object-lock returns 404, or PUT returns 400The bucket has no Object LockIt can’t be added; create a new bucket.