S3 access policies (Publisher & Reader)

S3 access policies (Publisher & Reader)

Team sharing (S3) explains how to point a folder at a bucket. This page is for whoever administers that bucket: it gives two ready-made access levels so a publisher can push results without being able to read them back, and readers can pull everything without being able to change it.

Both levels are locked to your office / VPN IP addresses.

Level

Can do

Cannot do

Publisher

Upload every shared file; read and write issues.csv

Read any other shared file

Reader

List and download everything shared; write issues.csv

Change anything except issues.csv

issues.csv is the exception in both directions on purpose — it is the one file both sides need to write, so issues raised by readers survive and publishers can see them.

Before you paste

Replace these placeholders everywhere they appear:

Attach each policy to its own identity, so one set of keys is a publisher and the other a reader.

Publisher

Uploads anything, reads nothing but issues.csv.

{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "DenyOutsideAllowedIPs",
"Effect": "Deny",
"Action": "s3:*",
"Resource": [
"arn:aws:s3:::stood-flows-share",
"arn:aws:s3:::stood-flows-share/*"
],
"Condition": {
"NotIpAddress": {
"aws:SourceIp": ["203.0.113.0/24", "198.51.100.7/32"]
}
}
},
{
"Sid": "DenyInsecureTransport",
"Effect": "Deny",
"Action": "s3:*",
"Resource": [
"arn:aws:s3:::stood-flows-share",
"arn:aws:s3:::stood-flows-share/*"
],
"Condition": { "Bool": { "aws:SecureTransport": "false" } }
},
{
"Sid": "ListBucketForConnectionTest",
"Effect": "Allow",
"Action": "s3:ListBucket",
"Resource": "arn:aws:s3:::stood-flows-share"
},
{
"Sid": "PublishAnyShareableObject",
"Effect": "Allow",
"Action": "s3:PutObject",
"Resource": "arn:aws:s3:::stood-flows-share/shared/*"
},
{
"Sid": "ReadIssuesCsvOnly",
"Effect": "Allow",
"Action": ["s3:GetObject", "s3:GetObjectVersion"],
"Resource": "arn:aws:s3:::stood-flows-share/shared/graphs/*/issues.csv"
},
{
"Sid": "DenyReadingAnythingElse",
"Effect": "Deny",
"Action": ["s3:GetObject", "s3:GetObjectVersion"],
"NotResource": "arn:aws:s3:::stood-flows-share/shared/graphs/*/issues.csv"
}
]
}

Reader

Downloads everything, writes nothing but issues.csv.

{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "DenyOutsideAllowedIPs",
"Effect": "Deny",
"Action": "s3:*",
"Resource": [
"arn:aws:s3:::stood-flows-share",
"arn:aws:s3:::stood-flows-share/*"
],
"Condition": {
"NotIpAddress": {
"aws:SourceIp": ["203.0.113.0/24", "198.51.100.7/32"]
}
}
},
{
"Sid": "DenyInsecureTransport",
"Effect": "Deny",
"Action": "s3:*",
"Resource": [
"arn:aws:s3:::stood-flows-share",
"arn:aws:s3:::stood-flows-share/*"
],
"Condition": { "Bool": { "aws:SecureTransport": "false" } }
},
{
"Sid": "ListShared",
"Effect": "Allow",
"Action": "s3:ListBucket",
"Resource": "arn:aws:s3:::stood-flows-share"
},
{
"Sid": "ReadEverythingShared",
"Effect": "Allow",
"Action": ["s3:GetObject", "s3:GetObjectVersion"],
"Resource": "arn:aws:s3:::stood-flows-share/shared/*"
},
{
"Sid": "WriteIssuesCsvOnly",
"Effect": "Allow",
"Action": "s3:PutObject",
"Resource": "arn:aws:s3:::stood-flows-share/shared/graphs/*/issues.csv"
},
{
"Sid": "DenyWritingAnythingElse",
"Effect": "Deny",
"Action": ["s3:PutObject", "s3:PutObjectAcl", "s3:DeleteObject", "s3:DeleteObjectVersion"],
"NotResource": "arn:aws:s3:::stood-flows-share/shared/graphs/*/issues.csv"
}
]
}

Good to know

Published with Nuclino