Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagebash
{
  "Version": "2012-10-17",
  "Id": "policy-read-any",
  "Statement": [
    {
      "Sid": "read-write-any",
      "Effect": "Allow",
      "Principal": {
        "AWS": [
		   "*"
		]
      },
      "Action": [
        "s3:ListBucket",
        "s3:GetObject",
		"s3:PutObject"
      ],
      "Resource": [
        "arn:aws:s3:::*"
      ]
    }
  ]
}

Put up IP restrictions to read and write to a bucket: 

Code Block
languageyml
 {
       "Sid": "AllowIP",
       "Effect": "Deny",
       "Principal": {
         "AWS": ["*"]
       },
       "Action": [
         "s3:ListBucket",
         "s3:GetObject",
		 "s3:PutObject"
       ],
       "Resource": [
         "arn:aws:s3:::*"
       ],
       "Condition": {
           "IpAddress": {
               "aws:SourceIp": ["IP-ADDRESS/23"]
           }
      }
}