CloudConsole

IAM policy: read-only access to a single S3 bucket

Updated 17 November 2026 · How we write and check guides

Short answer

Allow s3:ListBucket on the bucket ARN (arn:aws:s3:::my-bucket) and s3:GetObject on the object ARN (arn:aws:s3:::my-bucket/*). Those are two different resources, so they need two statements. Nothing else is required to list and download objects with the CLI or an SDK.

Policy diagram: 2 statement(s); first Allow s3:ListBucket, s3:GetBucketLocation on s3: my-bucket
The policy on this page drawn statement by statement: who it applies to, the actions, the resources and any condition.

The policy

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "ListTheBucket",
      "Effect": "Allow",
      "Action": [
        "s3:ListBucket",
        "s3:GetBucketLocation"
      ],
      "Resource": "arn:aws:s3:::my-bucket"
    },
    {
      "Sid": "ReadObjects",
      "Effect": "Allow",
      "Action": "s3:GetObject",
      "Resource": "arn:aws:s3:::my-bucket/*"
    }
  ]
}

Replace my-bucket with your bucket name. The policy grants nothing in any other bucket and cannot write, delete or change settings.

What each statement allows

  • ListTheBucket: s3:ListBucket is the permission behind ListObjectsV2, which is what aws s3 ls s3://my-bucket/ and aws s3 sync call. It applies to the bucket, so the resource is the bucket ARN with no trailing slash. s3:GetBucketLocation lets older tools discover the bucket's region; it is harmless to include.
  • ReadObjects: s3:GetObject covers downloading objects and HeadObject metadata calls. It applies to objects, so the resource ends in /*.

Without ListBucket, a download of a key that doesn't exist returns 403 Access Denied instead of 404, which confuses people debugging a missing file. That is deliberate: S3 won't tell a caller that a key is absent unless the caller could have listed it.

Attach it

In the console: IAM → Policies → Create policy → JSON, paste, name it my-bucket-read, then attach it to the user, group or role from its Permissions tab. From the CLI:

aws iam create-policy --policy-name my-bucket-read \
  --policy-document file://my-bucket-read.json

aws iam attach-role-policy --role-name reporting-app \
  --policy-arn arn:aws:iam::123456789012:policy/my-bucket-read

# test it as the role
aws s3 ls s3://my-bucket/ --profile reporting-app
aws s3 cp s3://my-bucket/reports/latest.csv . --profile reporting-app

Variations

  • Only one folder. Change the object resource to arn:aws:s3:::my-bucket/reports/* and add a condition to the list statement: "Condition": {"StringLike": {"s3:prefix": ["reports/", "reports/*"]}}. Without it, the caller can still see every key name in the bucket.
  • Older versions. Add s3:GetObjectVersion and s3:ListBucketVersions if people need to restore a previous version.
  • Console browsing. The S3 console first lists all buckets. Add s3:ListAllMyBuckets on "Resource": "*" if the user works in the console; it reveals bucket names in the account, not contents.
  • KMS-encrypted objects. If the bucket uses SSE-KMS with a customer managed key, also allow kms:Decrypt on that key ARN. See the KMS decrypt policy.

Common mistakes

MistakeSymptom
s3:ListBucket on my-bucket/*aws s3 ls fails with AccessDenied; downloads work.
s3:GetObject on arn:aws:s3:::my-bucketListing works; every download is denied.
Using s3:* "just to test"Grants delete and policy changes. Remove it once the real issue is found.
Bucket in another accountThe bucket policy must also grant your role. See bucket policy vs IAM policy.

If access is still denied, check for an explicit deny in the bucket policy, an SCP, or a permissions boundary; the error text usually names which. S3 Access Denied walks through it.

Questions

Does s3:GetObject allow listing the bucket?

No. Listing is s3:ListBucket on the bucket ARN. GetObject only lets you download a key you already know.

What is the difference between arn:aws:s3:::my-bucket and arn:aws:s3:::my-bucket/*?

The first is the bucket itself, used for bucket-level actions such as ListBucket. The second matches every object in it, used for object actions such as GetObject and PutObject.

Is the AmazonS3ReadOnlyAccess managed policy good enough?

It grants read access to every bucket in the account, including their contents. Use the scoped policy above when the job only needs one bucket.

When this happens away from your desk

A read-only bucket policy is a good fit for a phone: you can check whether last night's export landed without carrying credentials that can delete it. CloudConsole is being built to browse resources on a phone using exactly this kind of read-only role.

About the app → · Download on the App Store

Sources