# Object Lock: Governance, Compliance and Legal Hold

https://www.gyrohosting.com/en/knowledgebase/article/s3-object-lock

- **What you will learn**: What Object Lock does, the difference between the three lock modes, how to create a locked bucket, set a default retention for a bucket, view and extend the retention of a single file and apply a Legal Hold, from the panel and with aws-cli.
- **Time**: 15 minutes

> **Read this first**
> 
> Object Lock can have consequences that cannot be undone. Data you lock in Compliance mode cannot be deleted by **you, your team or anyone at Gyro** before the period ends; during that time the service cannot be cancelled and billing continues. Do your first tests in Governance mode with short periods (1 day).

## 1. What is Object Lock?

Object Lock applies "write once, read many" (WORM) protection to file versions. A locked version cannot be deleted or overwritten during its retention period. You can upload a new file under the same name, but that creates a new version; the locked old version stays in place. "Deleting" a file only adds a delete marker; the locked version remains and can be restored.

Object Lock works through the standard S3 Object Lock API; Veeam, restic, rclone, aws-cli and AWS SDKs can use it directly.

## 2. The three modes

|  | Governance | Compliance | Legal Hold |
| --- | --- | --- | --- |
| Deletion before the period ends | You cannot; only authorised Gyro staff on your request, with a record kept | **No one**, Gyro included | No one until the Legal Hold is removed; you remove it from the panel or with a key that has write permission on the bucket |
| Period | You set it in days | You set it in days | Indefinite |
| Shortening the period | Not possible, only extended (can also be upgraded to Compliance) | **Not possible**, only extended | No period; it ends when removed |
| Service cancellation | Doesn't block it; data is deleted with the service | Cancellation request cannot be opened until the period ends | Cancellation request cannot be opened until it is removed |
| Best for | Protection against accidental deletion, trials | Immutable backups, ransomware protection | Retention with no fixed end date: investigations, legal proceedings |

- **Legal Hold** is independent of the retention period. A version can have both a retention period and a Legal Hold; it is protected until it is released from both.
- You place and remove a **Legal Hold** from the panel or with an access key that has **write permission** on the bucket. Because someone who obtains a write key could also remove the Legal Hold (standard S3 behaviour), don't rely on Legal Hold alone against ransomware; rely on a **Compliance** period. Use Legal Hold as an extra measure alongside a retention period, and don't manage it with the key on your backup server.
- A **Governance** lock cannot be bypassed with your access keys or from the panel. If you really must delete a Governance version, open a support ticket; authorised Gyro staff delete it on your request and with a record kept.

## 3. Pricing and contract

- Object Lock is an add-on; **each unit gives one locked-bucket entitlement**. It costs **€2.99** per bucket per month (list price €3.99), excl. VAT; term discounts do not apply. The TL amount is shown when you order. Your remaining entitlement appears on the **Buckets** page as "Object-locked bucket entitlement: x/y".
- Locked data counts against your plan space. Choose your plan for the data that will build up during the lock period; when the space is full you cannot upload new data and you cannot free space by deleting locked data.
- While data under a Compliance lock or Legal Hold exists, a **cancellation request cannot be opened** for the service; the service and billing continue until the last lock period ends. Even if the service ends for another reason (for example non-payment), this data is kept and billed until the end of its period (Service Agreement, article 3.19).
- If you cancel the Object Lock add-on later, existing locked buckets stay locked; you just can't create new locked buckets.

## 4. Create a locked bucket and default retention in the panel

1. In your Protected Storage service, under **Buckets**, press **New bucket**, enter the bucket name and tick **Turn on Object Lock (WORM)**. The bucket name is completed with a short code specific to your service (for example `archive` → `archive-<code>`); the bucket name can't be changed afterwards. Lock can only be chosen at this step; it cannot be turned on or off later. If the box is greyed out, you have no free locked-bucket entitlement.
2. The bucket is listed with an **Object-locked** badge. Go to the **Object lock** page.
3. In the locked bucket's **Default retention** field, choose the mode (**Off**, **GOVERNANCE** or **COMPLIANCE**) and the number of days (1-3650) and save. From then on, **every new version** uploaded to the bucket is locked for that period. Existing versions are not affected.
4. When you choose **COMPLIANCE**, the panel shows a warning and asks you to **type the bucket name** to confirm. Read the warning carefully.
5. You can change the default retention later or set it to **Off**; this only affects later uploads. The periods of versions already locked do not change.
6. The lock summary at the top of the page (counts of Compliance, Governance and Legal Hold, latest end date) is refreshed regularly; press **Scan now** to see it immediately.

> **If you use Veeam**
> 
> Leave **Default retention** **Off** on the Veeam bucket. Veeam sets the period of each backup file itself. Details: [Immutable backups with Veeam](https://www.gyrohosting.com/bilgi-bankasi/makale/veeam-degistirilemez-yedek-s3).

## 5. See, extend and Legal Hold for a single file

### 5.1 From the panel

1. On the **Object lock** page, in the **File / version lock** section, choose the bucket and type the file name; for a specific version enter the version ID (leave it empty for the current version) and press **Open**. You see the file's lock mode, end date and Legal Hold status. You can reach the same window with the **Lock** button on the **Versions** page.
2. To apply retention or extend the period, enter the mode and the new end date and save. The period cannot be shortened; COMPLIANCE cannot be lowered to GOVERNANCE. For COMPLIANCE you are again asked to type the bucket name.
3. For Legal Hold, use **Set / remove legal hold**.

### 5.2 With aws-cli

Use the options `--profile gyro-kilit --endpoint-url https://s3-kilit.gyrohosting.com` in the commands (profile setup: [Versioning guide](https://www.gyrohosting.com/bilgi-bankasi/makale/s3-versiyonlama-eski-surume-donme), Section 2). The key needs **write** permission on the bucket. In the examples the bucket is `firma-arsiv` and the file is `2026/ledger.pdf`.

1. See the bucket's lock configuration and default retention (you change the default retention from the panel):

```
aws s3api get-object-lock-configuration --bucket firma-arsiv
```

1. Lock a file with its own period when you upload it:

```
aws s3api put-object --bucket firma-arsiv --key 2026/ledger.pdf --body ledger.pdf \
  --object-lock-mode COMPLIANCE --object-lock-retain-until-date 2031-01-01T00:00:00Z
```

1. See a version's lock:

```
aws s3api get-object-retention --bucket firma-arsiv --key 2026/ledger.pdf --version-id <VERSION_ID>
```

1. Extend the period (only a later date is accepted):

```
aws s3api put-object-retention --bucket firma-arsiv --key 2026/ledger.pdf --version-id <VERSION_ID> \
  --retention '{"Mode":"COMPLIANCE","RetainUntilDate":"2032-01-01T00:00:00Z"}'
```

1. Apply a Legal Hold, check its status, remove it:

```
aws s3api put-object-legal-hold --bucket firma-arsiv --key 2026/ledger.pdf --version-id <VERSION_ID> --legal-hold Status=ON
aws s3api get-object-legal-hold --bucket firma-arsiv --key 2026/ledger.pdf --version-id <VERSION_ID>
aws s3api put-object-legal-hold --bucket firma-arsiv --key 2026/ledger.pdf --version-id <VERSION_ID> --legal-hold Status=OFF
```

> **Note**
> 
> The `--bypass-governance-retention` option does not work with customer keys; a request to delete a Governance-locked version or shorten its period is rejected.

## 6. Choosing the right period

- **Backups against ransomware:** An attack can take days to notice. Keeping backups locked for at least 14-30 days is a common starting point; set it according to your own recovery needs.
- **Archive:** You set the retention period according to your internal rules and legal obligations. Work out the plan-space and cost impact of long Compliance periods in advance.
- **Trial:** Try GOVERNANCE with a 1-day period first, then move to COMPLIANCE.

## 7. Troubleshooting

| Symptom | Likely cause | What to do |
| --- | --- | --- |
| No lock setting shows on the bucket | The bucket was created without "Turn on Object Lock (WORM)" | It can't be turned on later. Create a new locked bucket and copy the data. |
| The "Turn on Object Lock (WORM)" box is greyed out | You have no free locked-bucket entitlement | Buy one more unit of the Object Lock add-on. |
| I can't cancel the service | There is data under a Compliance lock or Legal Hold | The panel shows the latest end date; remove the Legal Hold or wait for the lock period to end. |
| Deleting or changing the period gives `AccessDenied` | The version is locked or under Legal Hold, or you are trying to shorten the period | Wait until the period ends; open a support ticket if a Governance version absolutely must be deleted. |
| `put-object` with lock options is rejected | The bucket is not locked or the date format is wrong | Write the date as `2031-01-01T00:00:00Z`; check that the bucket is locked. |
| Upload rejected with `403` | Plan space is full | Check **Usage**; clean up unlocked old versions or upgrade the plan. |

## 8. FAQ

**Can I turn the lock on or off later?**

No. Object Lock is chosen when the bucket is created and doesn't change for the life of the bucket. To protect an unlocked bucket, create a new locked bucket and copy the data.

**I entered the wrong period in Compliance mode. What can I do?**

The period can't be shortened, not even by Gyro. The data is kept and billed until the end of the period, and the service can't be cancelled during that time. That is why the panel asks you to type the bucket name for COMPLIANCE; try GOVERNANCE first.

**What happens if I "delete" a locked file?**

Deleting without a version ID only adds a delete marker; the locked version stays in place and can be restored. A request to delete a specific locked version is rejected.

**Can I overwrite a locked file?**

You can upload a new file under the same name; that creates a new version. The locked old version stays unchanged.

**Who can remove a Legal Hold?**

You can: from the panel or with your access key that has write permission on the bucket. A version under Legal Hold can't be deleted until it is removed.

**I need to delete a Governance-locked file. What should I do?**

A Governance lock can't be bypassed with customer keys or from the panel. Open a support ticket; authorised Gyro staff delete it on your request and with a record kept.

**Is this a regulatory compliance certificate?**

No. Object Lock is a technical measure that creates an immutable copy. You decide which data is kept and for how long.

## Next step

- **Lock your Veeam backups:** [Immutable backups with Veeam](https://www.gyrohosting.com/bilgi-bankasi/makale/veeam-degistirilemez-yedek-s3).
- **For server backups:** [Protected Storage with restic and rclone](https://www.gyrohosting.com/bilgi-bankasi/makale/restic-rclone-korumali-depolama).
