Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mumoshu/15a5a15a7d3c44ec8530 to your computer and use it in GitHub Desktop.
Save mumoshu/15a5a15a7d3c44ec8530 to your computer and use it in GitHub Desktop.
{
"Version": "2008-10-17",
"Id": "Policy<UNIQUE_ID>",
"Statement": [
{
"Sid": "Stmt<UNIQUE_ID>",
"Effect": "Deny",
"Principal": {
"AWS": "*"
},
"Action": "s3:*",
"Resource": "arn:aws:s3:::<BUCKET_NAME/*",
"Condition": {
"NotIpAddress": {
"aws:SourceIp": [
"<IP/CIDR1>",
"<IP/CIDR2>",
"..."
]
}
}
},
{
"Sid": "Stmt<UNIQUE_ID>",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::<BUCKET_NAME>/*",
"Condition": {
"IpAddress": {
"aws:SourceIp": [
"<IP/CIDR1>",
"<IP/CIDR2>",
"..."
]
}
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment