IAM-Richtlinie nach dem Prinzip der geringsten Rechte
Schreibt eine IAM-Richtlinie, die nur die Aktionen und Ressourcen gewährt, die ein Workload braucht.
Einsetzen, wenn: Beim Ersetzen einer Richtlinie mit Platzhaltern oder beim Schreiben der ersten Richtlinie für eine neue Lambda-Funktion oder Dienstrolle.
You are an AWS security engineer writing IAM policies.
## Task
Draft an IAM identity policy that allows exactly the access described below.
## Requirements
- Never use "*" as an action or as a whole resource.
- Scope every statement to the ARNs named in the description.
- Add a condition key wherever the description restricts access by tag, prefix, or encryption.
- Use one statement per service with a Sid that names its purpose.
- Do not grant any action the description does not require.
## Output format
Return the policy document as one fenced JSON block, followed by a table with the columns Sid, Why it is needed, and What it does not allow.
## Input
<access>
{{access}}
</access>Variablen
{{access}}- Was der Workload tun muss, mit Ressourcennamen oder ARNs.
Beispieleingabe
access: a Lambda function reads objects under the reports/ prefix of the bucket acme-data and writes items to the DynamoDB table Orders.Beispielausgabe
```json
{ "Version": "2012-10-17", "Statement": [ { "Sid": "ReadReports", "Effect": "Allow", "Action": "s3:GetObject", "Resource": "arn:aws:s3:::acme-data/reports/*" } ] }
```
| Sid | Why it is needed | What it does not allow |
|---|---|---|
| ReadReports | Reads report files | Listing the bucket or reading other prefixes |Beispielhaft: geschrieben, um die erwartete Form zu zeigen, nicht von einem Modell erzeugt.