Skip to main content

Object Lock

Object Lock uses the WORM (Write Once Read Many) principle and allows you to lock objects to prevent them from being overwritten or deleted.

To use Object Lock, the bucket must have versioning enabled. Object lock applies only to object versions.

Locking can be of different types and modes. Depending on the lock type, it can be set on individual objects or on a bucket by default — the lock will apply to new objects.

The ability to manage locks also depends on the user role and bucket policy rules; for details, see the Manage access to S3 manual. You can work with Object Lock in the control panel (capabilities are limited), via the S3 API, and via tools that use it, such as the AWS CLI.

To manage object locking after configuring Object Lock, use the Manage object locking manual.

If you delete a project that contains locked objects, they will not be deleted while the lock is active. However, they will not be displayed in the control panel and via the API. To restore locked objects after deleting a project, submit a ticket.

Types and retention modes

Locking can be temporary or indefinite. Temporary locking has two modes: Governance and Compliance.

If both a temporary and an indefinite lock are enabled for an object, the indefinite lock takes precedence.

IndefiniteRetention: Governance modeRetention: Compliance mode
What it can be applied toTo objects
  • to objects;
  • to a bucket by default — the lock will apply to all new objects
  • to objects;
  • to a bucket by default — the lock will apply to all new objects
Possible actions with the lockDisabling the lock

Object retention:

  • shortening the lock retention period *;
  • extending the lock duration;
  • changing the locking mode to Compliance
Object retention — only extending the retention period

Default bucket retention:

  • changing the retention period;
  • changing the lock mode;
  • disabling the lock

Default bucket retention:

  • changing the retention period;
  • changing the lock mode;
  • disabling the lock
Ability to delete objectsNot allowed for anyone while the lock is enabledObject retention — allowed *Object retention — not allowed for anyone until the retention period expires

Default bucket retention — deleting objects does not depend on whether default retention is enabled in the bucket at the time of deletion. It depends only on the lock status of the specific object:

  • object is locked — until the retention period expires, deletion is available only to specific users *;
  • object is not locked — deletion is available to everyone

Default bucket retention — deleting objects does not depend on whether default retention is enabled in the bucket at the time of deletion. It depends only on the lock status of the specific object:

  • object is locked — deletion is not available until the retention period expires;
  • object is not locked — deletion is available

* Available only to users:

Enable Object Lock in a bucket

For your information

The following users can enable Object Lock:

Once you have enabled Object Lock, you cannot disable it or suspend versioning.

Enabling Object Lock does not lock objects automatically. After configuring Object Lock in a bucket, you can:

If versioning is disabled or suspended in the bucket, it will be enabled automatically when Object Lock is enabled.

  1. In the control panel, in the top menu, click Products and select S3.

  2. Go to the Buckets section.

  3. Open the bucket page → Configuration tab.

  4. In the Data protection block, on the Object Lock line, click Edit.

  5. Select the Enable Object Lock checkbox.

  6. Optional: enable default bucket retention:

    6.1. Select the Enable default retention checkbox.

    6.2. Select a lock mode.

    6.3. Specify the retention period. Maximum retention period:

    • for Compliance mode — one year. To set a Compliance lock for more than a year, use the API or tools such as the AWS CLI;
    • for Governance mode — 100 years.

    You can manage default retention even after enabling Object Lock.

  7. Click Save.

Manage default bucket retention

For your information

The following users can manage default retention:

Check default retention

The presence of default retention means that after it was enabled, all new objects were locked upon upload. However, the bucket may contain unlocked objects — those uploaded:

  • before the lock was enabled in the bucket;
  • after the lock was enabled in the bucket and were immediately locked, but their retention period has expired.

To check retention on a specific object, refer to the Check retention section of the Manage object locks instructions.

  1. In the control panel, in the top menu, click Products and select S3.
  2. Go to the Buckets section.
  3. Open the bucket page → Configuration tab.
  4. In the Data protection block, on the Object Lock line, check the information about the status, mode, and duration of the default retention.

Enable default retention

Retention will apply to all new objects in the bucket. Previously uploaded objects will not be locked. To lock already uploaded objects, refer to the Enable retention section of the Manage object lock instructions.

  1. In the control panel, in the top menu, click Products and select S3.

  2. Go to the Buckets section.

  3. Open the bucket page → Configuration tab.

  4. In the Data protection block, on the Object Lock line, click Edit.

  5. Make sure that the Enable Object Lock checkbox is selected.

  6. Select the Enable default retention checkbox.

  7. Select a lock mode.

  8. Specify the retention period. Maximum retention period:

    • for Compliance mode — one year. To set a Compliance lock for more than a year, use the API or tools such as the AWS CLI;
    • for Governance mode — 100 years.
  9. Click Save.

Change default retention period

The modified retention period will apply to all new objects in the bucket. The retention period for previously uploaded objects will remain unchanged. To change the retention period of already uploaded objects, refer to the Change retention period section of the Manage object lock instructions.

  1. In the control panel, in the top menu, click Products and select S3.

  2. Go to the Buckets section.

  3. Open the bucket page → Configuration tab.

  4. In the Data protection block, on the Object Lock line, click Edit.

  5. Specify a new retention period. Maximum retention period:

    • for Compliance mode — one year. To set a Compliance lock for more than a year, use the API or tools such as the AWS CLI;
    • for Governance mode — 100 years.
  6. Click Save.

Change default retention mode

The modified retention mode will apply to all new objects in the bucket. The retention mode of previously uploaded objects will remain unchanged. To change the retention mode of already uploaded objects, refer to the Change retention mode section of the Manage object lock instructions.

  1. In the control panel, in the top menu, click Products and select S3.

  2. Go to the Buckets section.

  3. Open the bucket page → Configuration tab.

  4. In the Data protection block, on the Object Lock line, click Edit.

  5. Select the Compliance lock mode.

  6. Select a new lock mode.

  7. Specify the retention period. Maximum retention period:

    • for Compliance mode — one year. To set a Compliance lock for more than a year, use the API or tools such as the AWS CLI;
    • for Governance mode — 100 years.
  8. Click Save.

Disable default retention

After disabling default retention, new objects will not be locked, but Object Lock will remain enabled on the bucket — it cannot be disabled.

Objects that were uploaded and automatically locked before disabling default retention will remain locked according to the lock mode. To disable retention in Governance mode for already uploaded objects, refer to the Disable retention section of the Manage object lock instructions.

Temporary lock can be disabled in the Control Panel only by the Account Owner or a user with the member role.

  1. In the control panel, in the top menu, click Products and select S3.
  2. Go to the Buckets section.
  3. Open the bucket page → Configuration tab.
  4. In the Data protection block, on the Object Lock line, click Edit.
  5. Clear the Enable default retention checkbox.
  6. Click Save.