Object Storage Service (OSS) supports the Write Once Read Many (WORM) feature. The feature helps prevent objects from being deleted or overwritten within a specified period of time. Enterprises use this feature to comply with the regulations of the U.S. Securities and Exchange Commission (SEC) and Financial Industry Regulatory Authority (FINRA).

Usage notes

  • You cannot configure retention policies in the China (Guangzhou), China (Nanjing - Local Region), and US (Virginia) regions.
  • You can configure retention policies only for buckets in OSS.
  • A bucket cannot have versioning and retention policies at the same time. If versioning is enabled for a bucket, you cannot configure retention policies for the bucket. For more information about versioning, see Overview.
  • We recommend that you do not enable the OSS-HDFS service and configure retention policies for a bucket at the same time.

    If you enable the OSS-HDFS service and configure a retention policy for a bucket, and then delete data from the .dlsdata/ directory by using the methods that are supported by the OSS-HDFS service, a message that indicates that the data is successfully deleted is displayed. However, OSS still retains the deleted data in the retention period that is specified for the retention policy and OSS cannot recognize and delete the data after the retention period expires.

  • During the retention period, you can configure lifecycle rules to convert the storage classes of the objects in the bucket. This way, you can reduce costs and ensure compliance. For more information about lifecycle rules, see Overview.


  1. Log on to the OSS console.
  2. In the left-side navigation pane, click Buckets. On the Buckets page, click the name of the bucket in which you want to create a directory.
  3. In the left-side navigation pane, choose Basic Settings > Retention Policy. In the Retention Policy section, click Configure.
  4. Click Create Policy.
  5. In the Create Policy dialog box, set Retention Period.
    The retention period ranges from one day to 70 years.
  6. Click OK.
    After you create the policy, the policy is in the InProgress state. You can click Lock or Delete to lock or delete a policy in the InProgress state.
  7. Click Lock.
  8. In the message that appears, click OK.
    • The policy enters the Locked state. You cannot delete the policy or shorten the retention period. However, you can click Edit to extend the retention period.
    • During the retention period, data in the bucket is protected. If you attempt to delete or modify the data, the following error message is displayed: The file is locked and cannot be operated.

Calculate the expiration time of an object

To calculate the time when an object expires, add the retention period and the time when the object was last updated. For example, the retention policy for Bucket A specifies the retention period as 10 days. An object in the bucket was last updated at 12:00 on February 15, 2022. The object expired at 12:01 on February 25, 2022.