---
title: "Change Bucket Policy"
sidebar_label: "Change Bucket Policy"
description: "How to change Bucket Policy settings, change, or delete rules"
sidebar_position: 3
---

import Formbricks from '@theme/MDXComponents/Formbricks'
import MoreVerticalIcon from '@selectel/docux/icons/more-vertical'

# Change Bucket Policy

When changing the policy, you can [add new rules](/s3/buckets/bucket-policy/create-policy.mdx#add-rule), [modify](#edit-rule) or [delete](#delete-rule) existing ones. You can add and remove conditions in rules.

## Edit rule \{#edit-rule}

When editing rules, you can change all settings, as well as add, modify, and delete conditions.

1. In the [control panel](https://my.selectel.ru/storage/), on the top menu, click **Products** and select **S3**.
2. Go to the **Buckets** section.
3. Open the bucket page → **Bucket Policy** tab.
4. Click **Edit**.
5. Open the rule card.
6. Change the rule name.
7. In the **Access** field, select the rule type.
8. Specify the principal: select the users to whom the rule will apply:

   * all — for users with any [role](/access-control/access-management.mdx) and unauthorized users who have accessed the bucket;
   * authorized — for individual project users.
9. If you selected access for authorized users, add users from the list.
10. Select the set of actions applied in the rule:

* reader — a set of rights to view the bucket and objects in it;
* editor — a set of rights to edit the bucket and objects in it;
* custom — an empty set to which you can add any actions;
* all — a set of all [actions](/s3/buckets/bucket-policy/about-bucket-policy.mdx#actions).

11. If you selected the **Custom** set, add actions to it.
12. Optional: if you selected a different set, add new actions or remove pre-filled ones if necessary. When editing a set, its type will change to **Custom**.
13. Specify the bucket resources to which the rule will apply. You cannot specify resources of another bucket:

    * all bucket objects: `<bucket_name>/*`
    * objects with a specific prefix: `<bucket_name>/<prefix>/*`
    * object: `<bucket_name>/<prefix>/<object_name>`
14. Optional: to add a [condition](/s3/buckets/bucket-policy/about-bucket-policy.mdx#conditions) that determines when the rule will work, click **Add condition**. You can add any number of conditions. For a condition, specify:

    * [key](/s3/buckets/bucket-policy/about-bucket-policy.mdx#keys) — a parameter to which the condition will apply;
    * [operator](/s3/buckets/bucket-policy/about-bucket-policy.mdx#operators) — checks that the request value matches the key value;
    * value — the key value; you can add multiple values;
    * optional: select the **Apply if field exists** checkbox (equivalent to the `IfExists` operator). If the checkbox is selected and the field with such a key exists, the condition will be applied. If the field does not exist, it will be created with the specified value.
15. Click **Save**.

## Delete rule \{#delete-rule}

1. In the [control panel](https://my.selectel.ru/storage/), on the top menu, click **Products** and select **S3**.
2. Go to the **Buckets** section.
3. Open the bucket page → **Bucket Policy** tab.
4. Click **Edit**.
5. In the <MoreVerticalIcon /> rule menu, click **Delete rule** → **Delete**.

<Formbricks />
