# Zasady IAM

## Konfiguracja polityki IAM

Aby **zwiększyć poziom bezpieczeństwa** i **wyeliminować użycie tokenów**, możesz **wyłączyć klucze dostępu i klucze poufne** dla swoich **zasobników (bucketów) AWS** oraz skorzystać z **integracji za pomocą zasad IAM**. Takie podejście ma jednak określone wymagania — **integracja zasobnika przy użyciu zasad IAM** wymaga utworzenia **zasady IAM** dostępnej dla usługi **Amazon EC2** oraz wskazania **instancji EC2**, która może komunikować się bezpośrednio z zasobnikiem.

Ponieważ **szablon maszyny Xopero** <mark style="color:red;">**nie jest dostępny**</mark> w środowisku **EC2**, należy utworzyć instancję z obsługiwanym systemem operacyjnym i zainstalować na niej **agenta Xopero**.

{% hint style="warning" %}
Agent w chmurze (cloud worker) domyślnie <mark style="color:red;">**nie może się komunikować**</mark> z zasobnikiem za pomocą zasad IAM.
{% endhint %}

Kroki dla administratora **AWS**:

1. Utwórz rolę IAM dostępną dla **instancji EC2**.
2. Dodaj politykę do utworzonej roli.
3. Przypisz rolę do wybranej **instancji EC2**.
4. Zainstaluj agenta kopii zapasowej na instancji **EC2**.

{% 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 %}

***

## Włączanie uwierzytelniania IAM <a href="#enabling-iam-authentication" id="enabling-iam-authentication"></a>

W panelu administratora **Xopero ONE Management Service** (**XMS**), włącz przełącznik **Użyj Amazon IAM** i wybierz agenta w instancji **EC2,** w sekcji **Domyślny worker** na dole.

<figure><img src="https://1873867500-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fwg6DDqlTFok8F9zv6rqa%2Fuploads%2FAdCqh42tIVL5ka5cZmze%2FAWS-S3_IAM-zasady-toggle.png?alt=media&#x26;token=87d5c0f6-d28c-42eb-a4b7-3fbdde17c4c2" alt=""><figcaption></figcaption></figure>

***

## Przydatne linki i materiały

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


---

# Agent Instructions: 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:

```
GET https://helpcenter.xopero.com/xopero-one-en/pl/magazyny-danych/magazyn-w-chmurze/aws-s3/zasady-iam.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
