Service Control Policy - Availability Zones

0

I know we can (and have) locked down access to specific AWS regions. My question is, is it possible to lockdown AZ's with service control policies?

질문됨 2년 전322회 조회
2개 답변
0

Yes you can do this, this policy blocked me from launching an ec2 instance in "us-east-1a"

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "Statement1",
      "Effect": "Deny",
      "Action": [
        "ec2:*"
      ],
      "Resource": [
        "*"
      ],
      "Condition": {
        "ForAnyValue:StringEquals": {
          "ec2:AvailabilityZone": [
            "us-east-1a"
          ]
        }
      }
    }
  ]
}

Decoded failure message

{
  "allowed": false,
  "explicitDeny": true,
  "matchedStatements": {
    "items": [
      {
        "statementId": "Statement1",
        "effect": "DENY",
        "principals": {
          "items": [
            {
              "value": "xxxxxxxxxxxxxxxx"
            }
          ]
        },
        "principalGroups": {
          "items": []
        },
        "actions": {
          "items": [
            {
              "value": "ec2:RunInstances"
            },
            {
              "value": "ec2:*"
            }
          ]
        },
        "resources": {
          "items": [
            {
              "value": "*"
            }
          ]
        },
        "conditions": {
          "items": [
            {
              "key": "ec2:AvailabilityZone",
              "values": {
                "items": [
                  {
                    "value": "us-east-1a"
                  }
                ]
              }
            }
          ]
        }
      }
    ]
  },
profile pictureAWS
전문가
Matt-B
답변함 2년 전
0

You can add an inline policy and add a condition to to restrict access to availability zone.

답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠