Deprecated

Removed from AWS on 2021-04-02 - Active for 8 months

ServerMigrationServiceRole

Last Modified

Aug 1, 2020

August 1, 2020 at 04:49 AM UTC

Version

v7

Total Versions

10

Created

Aug 1, 2020

Actions

49

Risk

High

An unrestricted escalation path, identity administration, secret reads or the power to switch off security monitoring. Read from this policy document alone: trust policies, boundaries and SCPs in your account still decide what actually succeeds. How this is assessed

  • High

    Can take over existing resources that run as another role

    Grants every action of 1 documented escalation path on any resource with no condition.

    Use with caution: List the roles attached to the functions, instances, pipelines or notebooks it can modify: the holder effectively has them too.

  • Medium

    Can launch resources that run as a more privileged role

    Grants the actions of 2 documented escalation paths, but only on named resources or under a condition. Review that scope before trusting it.

    • cloudformation-001iam:PassRole + cloudformation:CreateStackscoped
      • iam:PassRole: condition iam:AssociatedResourceArn
      • cloudformation:CreateStack: condition cloudformation:ResourceTypes, on arn:aws:cloudformation:*:*:stack/sms-app-*/*
    • cloudformation-005cloudformation:CreateChangeSet + cloudformation:ExecuteChangeSetscoped
      • cloudformation:CreateChangeSet: condition cloudformation:ResourceTypes, on arn:aws:cloudformation:*:*:stack/sms-app-*/*
      • cloudformation:ExecuteChangeSet: condition cloudformation:ResourceTypes, on arn:aws:cloudformation:*:*:stack/sms-app-*/*

    Use with caution: Check which roles, users or policies fall inside the scope shown above. Within it the escalation works as documented, so keep privileged principals out of it.

Policy Document

View on GitHub
{
  "PolicyVersion": {
    "Document": {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Action": [
            "cloudformation:CreateChangeSet",
            "cloudformation:CreateStack",
            "cloudformation:DeleteStack",
            "cloudformation:ExecuteChangeSet"
          ],
          "Resource": "arn:aws:cloudformation:*:*:stack/sms-app-*/*",
          "Effect": "Allow",
          "Condition": {
            "ForAllValues:StringLikeIfExists": {
              "cloudformation:ResourceTypes": [
                "AWS::EC2::*"
              ]
            }
          }
        },
        {
          "Action": [
            "cloudformation:DeleteChangeSet",
            "cloudformation:DescribeChangeSet",
            "cloudformation:DescribeStackEvents",
            "cloudformation:DescribeStackResources",
            "cloudformation:GetTemplate"
          ],
          "Resource": "arn:aws:cloudformation:*:*:stack/sms-app-*/*",
          "Effect": "Allow"
        },
        {
          "Action": [
            "cloudformation:DescribeStacks",
            "cloudformation:ValidateTemplate",
            "cloudformation:DescribeStackResource",
            "s3:ListAllMyBuckets"
          ],
          "Resource": "*",
          "Effect": "Allow"
        },
        {
          "Action": [
            "s3:CreateBucket",
            "s3:DeleteBucket",
            "s3:DeleteObject",
            "s3:GetBucketAcl",
            "s3:GetBucketLocation",
            "s3:GetObject",
            "s3:ListBucket",
            "s3:PutObject",
            "s3:PutObjectAcl",
            "s3:PutLifecycleConfiguration",
            "s3:ListAllMyBuckets"
          ],
          "Resource": "arn:aws:s3:::sms-app-*",
          "Effect": "Allow"
        },
        {
          "Action": [
            "sms:CreateReplicationJob",
            "sms:DeleteReplicationJob",
            "sms:GetReplicationJobs",
            "sms:GetReplicationRuns",
            "sms:GetServers",
            "sms:ImportServerCatalog",
            "sms:StartOnDemandReplicationRun",
            "sms:UpdateReplicationJob"
          ],
          "Resource": "*",
          "Effect": "Allow"
        },
        {
          "Action": "ssm:SendCommand",
          "Resource": [
            "arn:aws:ssm:*:*:document/AWS-RunRemoteScript",
            "arn:aws:ssm:*:*:document/AWS-RunPowerShellScript",
            "arn:aws:ssm:*:*:document/AWS-RunShellScript",
            "arn:aws:ec2:*:*:instance/*",
            "arn:aws:ssm:*:*:managed-instance/*",
            "arn:aws:s3:::*"
          ],
          "Effect": "Allow"
        },
        {
          "Action": [
            "ssm:CancelCommand",
            "ssm:GetCommandInvocation"
          ],
          "Resource": "*",
          "Effect": "Allow"
        },
        {
          "Action": [
            "ec2:ModifySnapshotAttribute",
            "ec2:CopySnapshot",
            "ec2:CopyImage",
            "ec2:Describe*",
            "ec2:DeleteSnapshot",
            "ec2:DeregisterImage",
            "ec2:CreateTags",
            "ec2:DeleteTags",
            "ec2:ImportImage",
            "ec2:DescribeImportImageTasks",
            "ec2:GetEbsEncryptionByDefault"
          ],
          "Resource": "*",
          "Effect": "Allow"
        },
        {
          "Action": "iam:GetRole",
          "Resource": "*",
          "Effect": "Allow"
        },
        {
          "Action": "iam:PassRole",
          "Resource": "*",
          "Effect": "Allow",
          "Condition": {
            "StringLike": {
              "iam:AssociatedResourceArn": "arn:aws:cloudformation:*:*:stack/sms-app-*/*"
            }
          }
        },
        {
          "Effect": "Allow",
          "Action": "iam:GetInstanceProfile",
          "Resource": "*"
        }
      ]
    },
    "VersionId": "v7",
    "IsDefaultVersion": true,
    "CreateDate": "2020-08-01T03:40:03Z"
  }
}

Version History (10 recorded)

Raw history

Update detected

No recorded action delta - this version predates the change index. View the raw diff.

Aug 1, 2020

7ee79d5

Update detected

No recorded action delta - this version predates the change index. View the raw diff.

Apr 20, 2020

ee5062f

Update detected

No recorded action delta - this version predates the change index. View the raw diff.

Dec 24, 2019

5ee1bd8

Update detected

No recorded action delta - this version predates the change index. View the raw diff.

Nov 26, 2019

f693044

Update detected

No recorded action delta - this version predates the change index. View the raw diff.

Sep 16, 2019

49aa1d0

Update detected

No recorded action delta - this version predates the change index. View the raw diff.

Sep 16, 2019

71619cf

Update detected

No recorded action delta - this version predates the change index. View the raw diff.

Sep 16, 2019

8279033

`2019-08-29`

No recorded action delta - this version predates the change index. View the raw diff.

Aug 29, 2019

5016d52

I updated my CLI and it looks like it reordered everything and changed the white-space, so everything looks changed, but is not

No recorded action delta - this version predates the change index. View the raw diff.

Jul 12, 2019

9d2dff1

First commit

No recorded action delta - this version predates the change index. View the raw diff.

Feb 10, 2019

ad4c2e8