Courseiva

Predict IAM decisions with a source-IP restriction

about 5 minutes

A company only allows console and API access from its office network, 192.0.2.0/24. This policy is attached alongside the user's other permissions. Decide each request.

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "S3ReadAll",
      "Effect": "Allow",
      "Action": [
        "s3:Get*",
        "s3:List*"
      ],
      "Resource": "*"
    },
    {
      "Sid": "OfficeOnly",
      "Effect": "Deny",
      "Action": "*",
      "Resource": "*",
      "Condition": {
        "NotIpAddress": {
          "aws:SourceIp": "192.0.2.0/24"
        }
      }
    }
  ]
}
  • GetObject from the office (192.0.2.15)MFA: no · source 192.0.2.15
  • GetObject from home (203.0.113.40)MFA: no · source 203.0.113.40
  • ListBucket from the office (192.0.2.200)MFA: no · source 192.0.2.200
  • PutObject from the office (192.0.2.15)MFA: no · source 192.0.2.15