SCPs - conditions for a specific OU?

0

I know I can assign SCPs to a specific OU. Am I able to apply an SCP at root, but then limit or choose specific OUs within the json file?

So for example, restrict resources or services in all OUs except one? It would be useful for us with dev and prod.

질문됨 2년 전840회 조회
3개 답변
1
수락된 답변

Yes, it could be used to control the use of EC2 instances:

{
        "Sid": "",
        "Effect": "Deny",
        "Action": [
          "ec2:RunInstances"
        ],
        "Resource": [
          "arn:aws:ec2:*:*:instance/*"
        ],
        "Condition": {
          "StringNotEquals": {
            "ec2:InstanceType": [
              "c5.large"
            ]
          },
          "ForAllValues:StringNotLike": {
            "aws:PrincipalOrgPaths": [
              "o-a1234bcd/r-abc1/ou-123-xyz789/*"
            ]
          }
        }
      }

This policy denies the use of c5.large instances in anything other than the specified OU.

profile pictureAWS
Jake
답변함 2년 전
1

Hey - Principal Org Paths can be used to target specific OUs.

You can set a condition and use StringLike or StringNotLike to apply or exempt the policy from specific OUs.

"Condition": {
                "ForAllValues:StringNotLike": {
                  "aws:PrincipalOrgPaths": [
                    "o-a1234bcd/r-abc1/ou-123-xyz789/*"
                  ]
                }
              }

The above condition means that the policy would not apply to that specific OU.

profile pictureAWS
Jake
답변함 2년 전
  • Thank you!!!

    Could it be used to restrict specific instances (EC2) to prod/dev OUs?

0

Take a look at this blog post- How to control access to AWS resources based on AWS account, OU, or organization.

URL: https://aws.amazon.com/blogs/security/how-to-control-access-to-aws-resources-based-on-aws-account-ou-or-organization/

AWS
답변함 2년 전

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

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

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

관련 콘텐츠