> For the complete documentation index, see [llms.txt](https://helpcenter.gitprotect.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://helpcenter.gitprotect.io/storage/cloud-storage/aws-s3/iam-rules.md).

# IAM rules

## IAM policy configuration

To increase security and eliminate the use of tokens, you can disable access/secret keys for your **AWS** buckets and use integration via IAM rules. This approach, however, has specific requirements— integrating a bucket using IAM rules involves creating an IAM policy accessible to **Amazon EC2** and designating an **EC2** instance that can communicate directly with the bucket.

Since the **GitProtect** machine template is not available in **EC2**, you must create an instance using a supported operating system and install the **GitProtect worker** on it.

{% hint style="warning" %}
The **cloud worker** cannot communicate with the bucket via IAM rules by default.
{% endhint %}

Steps for an **AWS** administrator:

1. Create an IAM role accessible to **EC2**.
2. Add a policy to the created role.
3. Assign the role to the selected **EC2** instance.
4. Install the backup worker on the **EC2** instance.

{% code title="Policy" %}

```json
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor1",
"Effect": "Allow",
"Action": [
"s3:"
],
"Resource": [
"arn:aws:s3:::[bucket_name]",
"arn:aws:s3:::[bucket_name]/",
"arn:aws:s3:::[bucket_name]/"
]
}
]
}
```

{% endcode %}

***

## Enabling IAM authentication <a href="#enabling-iam-authentication" id="enabling-iam-authentication"></a>

In the **GitProtect Management Service** admin panel, enable the **Use Amazon IAM** toggle and specify your **EC2** worker in the **Default worker** section at the bottom.

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

***

## Useful links and items

{% embed url="<https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html>" %}


---

# 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://helpcenter.gitprotect.io/storage/cloud-storage/aws-s3/iam-rules.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.
