Policy actions, resources and conditions
Describe the permission
An IAM permissions policy is a document that describes access rules. In a common JSON statement, Effect is Allow or Deny, Action identifies the operation, Resource identifies the target, and an optional Condition restricts when the statement matches. An identity-based policy attaches to an IAM identity; a resource-based policy attaches to a supported resource and generally identifies its principal.
A reader policy for reports
This illustrative identity policy permits the S3 GetObject action for keys starting with reports/ in one fictional bucket, only when the request context indicates secure transport. A bucket stores objects (named pieces of data); a key is the object name. This example is static JSON, not a command to deploy.
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": "s3:GetObject", "Resource": "arn:aws:s3:::amzn-s3-demo-bucket1/reports/*", "Condition": { "Bool": { "aws:SecureTransport": "true" } } } ]}Match action and resource types
The Version value names the policy language version, not the current date. The object ARN has a bucket name and object-key pattern. GetObject uses an object resource; ListBucket instead uses a bucket ARN such as arn:aws:s3:::amzn-s3-demo-bucket1. Listing object names and reading a known object are different permissions. The wildcard in reports/* covers keys under that prefix; it does not authorize all buckets or all actions.
Reason about conditions and least privilege
The Bool condition checks aws:SecureTransport. In this example, a request with false does not match the Allow statement. That alone is not an explicit Deny: another applicable policy might allow it. A reader does not need PutObject or DeleteObject. Start with the smallest set of actions and resources required, then review conditions and service-specific dependencies. For example, reading an SSE-KMS encrypted object may also require authorization to decrypt with its KMS key. This policy alone is not a complete production access design.
Practice reviewing a policy
Predict whether this statement matches a secure read of reports/jan.csv, a secure read of photos/a.jpg, and an upload to reports/jan.csv. Only the first matches. Explain why replacing the action with s3:* would be excessive. Use the official service authorization reference to check supported action, resource and condition combinations before proposing any real policy.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Policy actions, resources and conditions — knowledge check
Apply IAM concepts in fictional offline scenarios.
Which action allows reading a known S3 object?
Which ARN type is used for s3:ListBucket in the example?
What happens to the example Allow statement when aws:SecureTransport is false?
Which scope fits a reader that only needs reports?
Which additional permission may be required to read an SSE-KMS encrypted object?