AWSServiceRoleForSMS

Last Modified

Mar 12, 2026

March 12, 2026 at 09:26 PM UTC

Version

v10

Total Versions

15

Created

Oct 15, 2020

Actions

76

Risk

Medium

The same capabilities in a scoped form, resource policy writes, reads across all data, or full access to a whole service. Read from this policy document alone: trust policies, boundaries and SCPs in your account still decide what actually succeeds. How this is assessed

  • Medium

    Can launch resources that run as a more privileged role

    Grants the actions of 3 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:PassedToService
      • 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: on arn:aws:cloudformation:*:*:stack/sms-app-*/*
    • ec2-001iam:PassRole + ec2:RunInstancesscoped
      • iam:PassRole: condition iam:PassedToService

    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.

  • Medium

    Can take over existing resources that run as another role

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

    • ec2-002ec2:ModifyInstanceAttribute + ec2:StopInstances + ec2:StartInstancesscoped
      • ec2:ModifyInstanceAttribute: condition ec2:ResourceTag/aws:cloudformation:stack-id
      • ec2:StopInstances: condition ec2:ResourceTag/aws:cloudformation:stack-id
      • ec2:StartInstances: condition ec2:ResourceTag/aws:cloudformation:stack-id
    • ssm-002ssm:SendCommandscoped
      • ssm:SendCommand: on arn:aws:ssm:*::document/AWS-RunRemoteScript, arn:aws:s3:::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.

  • Medium

    Flagged by AWS IAM Access Analyzer

    AWS's own policy validation raises 1 security warning: STRING_LIKE_OPERATOR_WITH_ARN_CONDITION_KEYS.

    • Use the operator type ARN instead of operator string for the condition key iam:AssociatedResourceArn.

    Use with caution: Read AWS's finding and the documentation it links to.

IAM Access Analyzer (1)

  • Security warning / STRING_LIKE_OPERATOR_WITH_ARN_CONDITION_KEYS

    Use the operator type ARN instead of operator string for the condition key iam:AssociatedResourceArn. AWS docs

Policy Document

View on GitHub
{
  "PolicyVersion": {
    "Document": {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Effect": "Allow",
          "Action": [
            "cloudformation:CreateChangeSet",
            "cloudformation:CreateStack"
          ],
          "Resource": "arn:aws:cloudformation:*:*:stack/sms-app-*/*",
          "Condition": {
            "Null": {
              "cloudformation:ResourceTypes": "false"
            },
            "ForAllValues:StringEquals": {
              "cloudformation:ResourceTypes": [
                "AWS::EC2::Instance",
                "AWS::ApplicationInsights::Application",
                "AWS::ResourceGroups::Group"
              ]
            }
          }
        },
        {
          "Effect": "Allow",
          "Action": [
            "cloudformation:DeleteStack",
            "cloudformation:ExecuteChangeSet",
            "cloudformation:DeleteChangeSet",
            "cloudformation:DescribeChangeSet",
            "cloudformation:DescribeStacks",
            "cloudformation:DescribeStackEvents",
            "cloudformation:DescribeStackResource",
            "cloudformation:DescribeStackResources",
            "cloudformation:GetTemplate"
          ],
          "Resource": "arn:aws:cloudformation:*:*:stack/sms-app-*/*"
        },
        {
          "Effect": "Allow",
          "Action": [
            "cloudformation:ValidateTemplate",
            "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"
          ],
          "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:s3:::sms-app-*"
          ]
        },
        {
          "Effect": "Allow",
          "Action": "ssm:SendCommand",
          "Resource": "arn:aws:ec2:*:*:instance/*",
          "Condition": {
            "StringEquals": {
              "ssm:resourceTag/UseForSMSApplicationValidation": [
                "true"
              ]
            }
          }
        },
        {
          "Effect": "Allow",
          "Action": [
            "ssm:CancelCommand",
            "ssm:GetCommandInvocation"
          ],
          "Resource": "*"
        },
        {
          "Effect": "Allow",
          "Action": "ec2:CreateTags",
          "Resource": "arn:aws:ec2:*:*:snapshot/*",
          "Condition": {
            "StringEquals": {
              "ec2:CreateAction": "CopySnapshot"
            }
          }
        },
        {
          "Effect": "Allow",
          "Action": "ec2:CopySnapshot",
          "Resource": "arn:aws:ec2:*:*:snapshot/*",
          "Condition": {
            "StringLike": {
              "aws:RequestTag/SMSJobId": [
                "sms-*"
              ]
            }
          }
        },
        {
          "Effect": "Allow",
          "Action": [
            "ec2:ModifySnapshotAttribute",
            "ec2:DeleteSnapshot"
          ],
          "Resource": "arn:aws:ec2:*:*:snapshot/*",
          "Condition": {
            "StringLike": {
              "ec2:ResourceTag/SMSJobId": [
                "sms-*"
              ]
            }
          }
        },
        {
          "Effect": "Allow",
          "Action": [
            "ec2:CopyImage",
            "ec2:DescribeImages",
            "ec2:DescribeInstances",
            "ec2:DescribeSnapshots",
            "ec2:DescribeSnapshotAttribute",
            "ec2:DeregisterImage",
            "ec2:ImportImage",
            "ec2:DescribeImportImageTasks",
            "ec2:GetEbsEncryptionByDefault"
          ],
          "Resource": "*"
        },
        {
          "Effect": "Allow",
          "Action": [
            "iam:GetRole",
            "iam:GetInstanceProfile"
          ],
          "Resource": "*"
        },
        {
          "Effect": "Allow",
          "Action": [
            "ec2:DisassociateIamInstanceProfile",
            "ec2:AssociateIamInstanceProfile",
            "ec2:ReplaceIamInstanceProfileAssociation"
          ],
          "Resource": "arn:aws:ec2:*:*:instance/*",
          "Condition": {
            "StringLike": {
              "ec2:ResourceTag/aws:cloudformation:stack-id": "arn:aws:cloudformation:*:*:stack/sms-app-*/*"
            }
          }
        },
        {
          "Effect": "Allow",
          "Action": "iam:PassRole",
          "Resource": "*",
          "Condition": {
            "StringEquals": {
              "iam:PassedToService": "ec2.amazonaws.com"
            }
          }
        },
        {
          "Effect": "Allow",
          "Action": "iam:PassRole",
          "Resource": "*",
          "Condition": {
            "StringEqualsIfExists": {
              "iam:PassedToService": "cloudformation.amazonaws.com"
            },
            "StringLike": {
              "iam:AssociatedResourceArn": "arn:aws:cloudformation:*:*:stack/sms-app-*/*"
            }
          }
        },
        {
          "Effect": "Allow",
          "Action": [
            "ec2:RunInstances"
          ],
          "Resource": "*"
        },
        {
          "Effect": "Allow",
          "Action": [
            "ec2:CreateTags",
            "ec2:DeleteTags"
          ],
          "Resource": "arn:aws:ec2:*:*:instance/*"
        },
        {
          "Effect": "Allow",
          "Action": [
            "ec2:ModifyInstanceAttribute",
            "ec2:StopInstances",
            "ec2:StartInstances",
            "ec2:TerminateInstances"
          ],
          "Resource": "*",
          "Condition": {
            "StringLike": {
              "ec2:ResourceTag/aws:cloudformation:stack-id": "arn:aws:cloudformation:*:*:stack/sms-app-*/*"
            }
          }
        },
        {
          "Effect": "Allow",
          "Action": [
            "applicationinsights:Describe*",
            "applicationinsights:List*",
            "cloudformation:ListStackResources"
          ],
          "Resource": "*"
        },
        {
          "Effect": "Allow",
          "Action": [
            "applicationinsights:CreateApplication",
            "applicationinsights:CreateComponent",
            "applicationinsights:UpdateApplication",
            "applicationinsights:DeleteApplication",
            "applicationinsights:UpdateComponentConfiguration",
            "applicationinsights:DeleteComponent"
          ],
          "Resource": "arn:aws:applicationinsights:*:*:application/resource-group/sms-app-*"
        },
        {
          "Effect": "Allow",
          "Action": [
            "resource-groups:CreateGroup",
            "resource-groups:GetGroup",
            "resource-groups:UpdateGroup",
            "resource-groups:DeleteGroup"
          ],
          "Resource": "arn:aws:resource-groups:*:*:group/sms-app-*",
          "Condition": {
            "StringLike": {
              "aws:ResourceTag/aws:cloudformation:stack-id": "arn:aws:cloudformation:*:*:stack/sms-app-*/*"
            }
          }
        },
        {
          "Effect": "Allow",
          "Action": [
            "iam:CreateServiceLinkedRole"
          ],
          "Resource": [
            "arn:aws:iam::*:role/aws-service-role/application-insights.amazonaws.com/AWSServiceRoleForApplicationInsights"
          ],
          "Condition": {
            "StringEquals": {
              "iam:AWSServiceName": "application-insights.amazonaws.com"
            }
          }
        }
      ]
    },
    "VersionId": "v10",
    "IsDefaultVersion": true,
    "CreateDate": "2020-10-15T17:28:13+00:00"
  }
}

Version History (18 recorded)

Raw history

AWSServiceRoleForSMS - Policy Version v10

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

Mar 12, 2026

f5783d3

Update detected

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

Sep 18, 2024

aafbae9

Update detected

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

May 13, 2024

1b36617

Update detected

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

Oct 15, 2020

aab43a3

Update detected

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

Sep 29, 2020

52904e3

Update detected

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

Aug 12, 2020

aaae935

Update detected

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

Aug 11, 2020

115f98b

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.

Jul 25, 2020

784e207

Update detected

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

Jul 20, 2020

b6b8a17

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 21, 2019

055f641

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

Update

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

Aug 6, 2019

d45a47b