> For the complete documentation index, see [llms.txt](https://docs.zata.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zata.ai/manage/bucket/bucket-policy-configuration.md).

# Bucket Policy Configuration

Bucket Policy is used to manage access control for a bucket by defining who can access it and what actions they can perform. It allows secure and fine-grained permission management using a JSON policy. By applying a bucket policy, specific users can be granted limited access such as read-only or download permissions without changing the bucket’s visibility. This ensures better security and controlled usage of object storage resources.\ <br>

Prerequisite – User Management

1. Go to **Users → Users**
2. Confirm that your sub-user is created and active.

<figure><img src="/files/OAqCn2GeSgy8JbOS4U0e" alt=""><figcaption></figcaption></figure>

Steps to Configure Bucket Policy:<br>

* Navigate to **Buckets** from the left menu.
* Select your required bucket, Click on **Bucket Settings**. then Open the **Access Control & Permissions** tab.

<figure><img src="/files/YsfokyiMy7x3Y5NZK7Wx" alt=""><figcaption></figcaption></figure>

In the policy editor, paste the required JSON policy

{% code expandable="true" %}

```
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "AWS": [
          "arn:aws:iam:::user/708c9b68-ba14-411f-bb4e-9c7a7dd7a617:accessuser"
        ]
      },
      "Action": "s3:GetObject",
      "Resource": [
        "arn:aws:s3:::prertest/*"
      ]
    }
  ]
}


```

{% endcode %}

{% hint style="info" %}
**Make sure first of all create a** [**USER**](https://docs.zata.ai/user)**.**
{% endhint %}

In this policy, the following values are defined:

* **Effect:** `Allow`\
  This specifies that the permission is granted.
* **Principal:**\
  The sub-user to whom access is given. In this case, the sub-user **accessuser** is used:

  ```
  {"AWS": ["arn:aws:iam:::user/708c9b68-ba14-411f-bb4e-9c7a7dd7a617:accessuser"]}
  ```
* **Action:** `s3:GetObject`\
  This allows the user to read and download objects from the bucket.
* **Resource:**

  ```
  arn:aws:s3:::prertest/*
  ```

  This applies the permission to all objects inside the **prertest** bucket.

<figure><img src="/files/HlBpd4K5o5j5Ugiil8pH" alt=""><figcaption></figcaption></figure>

Click on **Validate Policy** to verify the syntax and structure of the policy.After successful validation, click on **Save** to apply the policy.\
\
\
**Delete the Bucket policy:**

To delete a bucket policy, navigate to *Buckets → Bucket Settings → Access Control & Permissions*, clear the existing policy from the Bucket Policy editor, and click **Save**. This removes all custom access rules applied to the bucket.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.zata.ai/manage/bucket/bucket-policy-configuration.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
