Cloud security IAM policies 2 min read

What does an IAM policy allow?

The monthly report job needs to open monthly/march.csv in S3. Its IAM role has an Allow for that file. Why might S3 still say no?

  1. The report job asks for one file

    The job sends a request for s3:GetObject on arn:aws:s3:::reports/monthly/march.csv. The Allow on its role names the same API action and object, so those fields match.

    A statement can also require something about the request, such as a particular network path. In this example, the Allow has no extra condition.

    In short A statement matches the action, the resource, and any conditions it specifies.

  2. The Allow matches. S3 still says no.

    S3 also checks the bucket policy. In this example, it explicitly denies reads on this object from outside an approved network. The job is running elsewhere, so that Deny matches the same request.

    For the same GetObject request, the role policy allows it and the bucket policy explicitly denies it. AWS denies the request. Role policyAllow matchesBucket policyExplicit Deny matchesRead denied

    In short An applicable explicit Deny wins over a matching Allow.

What one IAM policy doesn’t tell you

This example follows one request. To review what else the role can do, check its effective permissions across the resources and request contexts you care about. A wildcard such as monthly/* covers more than this one file.

Keep this

Check the decision for the request you care about.

Start with the job’s action and resource, then check the policies that apply to that request.

Sources

Last reviewed 20 November 2026.

Next byte · Cloud identity How should you protect the root user?