Object Locking
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
How it works
- You create the bucket with Object lock (WORM) on. This also turns on versioning: when an object is overwritten, the old version is kept.
- 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.
- 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
Start creating a bucket
Open Object Storage, click Create Bucket, and fill in the name, location and storage type. See Create a bucket.
Turn on Object lock (WORM)
Under Versioning and object lock, turn on Object lock (WORM). Versioning turns on with it.
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.
Open Lock Settings
Open the bucket → Settings → Lock Settings. The Default Retention Policy card shows Configured or Not configured.
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:
- Click Set Retention.
- Choose Governance (Admin can override) or Compliance (Cannot delete by anyone).
- Enter Retain for (days). The dialog shows the Locked until date.
- Click Lock File. The menu then shows the Locked until date instead of Set Retention.
Add or remove a legal hold:
- Click Set Legal Hold, switch the Legal hold status to ON, and click Apply ON.
- 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.
