personal-lifecycle-tracker / security / zero-trust-cfn-service-role-policy.json
zero-trust-cfn-service-role-policy.json
Raw
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "UserCloudFormationStackControl",
      "Effect": "Allow",
      "Action": [
        "cloudformation:CreateStack",
        "cloudformation:UpdateStack",
        "cloudformation:DeleteStack",
        "cloudformation:DescribeStacks",
        "cloudformation:DescribeStackEvents",
        "cloudformation:DescribeStackResources",
        "cloudformation:GetTemplate",
        "cloudformation:ListStacks"
      ],
      "Resource": "arn:aws:cloudformation:*:*:stack/personal-lifecycle-tracker-*/*"
    },
    {
      "Sid": "UserCloudFormationValidateTemplate",
      "Effect": "Allow",
      "Action": "cloudformation:ValidateTemplate",
      "Resource": "*"
    },
    {
      "Sid": "UserPassRoleToCloudFormationOnly",
      "Effect": "Allow",
      "Action": "iam:PassRole",
      "Resource": "arn:aws:iam::*:role/personal-lifecycle-tracker-cfn-execution-role",
      "Condition": {
        "StringEquals": {
          "iam:PassedToService": "cloudformation.amazonaws.com"
        }
      }
    },
    {
      "Sid": "UserSSMSessionInspection",
      "Effect": "Allow",
      "Action": [
        "ssm:StartSession",
        "ssm:DescribeInstanceInformation"
      ],
      "Resource": "*"
    },
    {
      "Sid": "UserZeroTrustDenyAllPrivilegeEscalation",
      "Effect": "Deny",
      "Action": [
        "iam:CreateUser",
        "iam:DeleteUser",
        "iam:CreateAccessKey",
        "iam:DeleteAccessKey",
        "iam:AttachUserPolicy",
        "iam:PutUserPolicy",
        "organizations:*",
        "account:*",
        "aws-portal:*",
        "budgets:*"
      ],
      "Resource": "*"
    }
  ]
}