AWSEC2SqlHaServiceRolePolicy

Last Modified

Mar 12, 2026

March 12, 2026 at 09:26 PM UTC

Version

v1

Total Versions

1

Created

Nov 13, 2025

Actions

16

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 take over existing resources that run as another role

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

    • ssm-002ssm:SendCommandscoped
      • ssm:SendCommand: condition aws:ResourceTag/SqlHaMonitored, on arn:aws:ec2:*:*:instance/*

    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": [
        {
          "Sid": "AllowSSMSendCommandToTaggedInstances",
          "Effect": "Allow",
          "Action": "ssm:SendCommand",
          "Resource": [
            "arn:aws:ec2:*:*:instance/*"
          ],
          "Condition": {
            "StringLike": {
              "aws:ResourceTag/SqlHaMonitored": "true"
            }
          }
        },
        {
          "Sid": "AllowSSMSendCommandOfOwnedDoc",
          "Effect": "Allow",
          "Action": "ssm:SendCommand",
          "Resource": [
            "arn:aws:ssm:*:*:document/AWSEC2-DetectSqlHa*"
          ]
        },
        {
          "Sid": "AllowSSMNonMutating",
          "Effect": "Allow",
          "Action": [
            "ssm:DescribeInstanceInformation",
            "ssm:GetCommandInvocation",
            "ssm:ListCommands",
            "ssm:ListCommandInvocations"
          ],
          "Resource": "*"
        },
        {
          "Sid": "AllowEC2NonMutating",
          "Effect": "Allow",
          "Action": [
            "ec2:DescribeInstances",
            "ec2:DescribeInstanceAttribute",
            "ec2:DescribeInstanceStatus",
            "ec2:DescribeTags"
          ],
          "Resource": "*"
        },
        {
          "Sid": "AllowEventsMutateManagedRule",
          "Effect": "Allow",
          "Action": [
            "events:PutTargets",
            "events:PutRule",
            "events:DeleteRule",
            "events:RemoveTargets"
          ],
          "Condition": {
            "StringEquals": {
              "events:ManagedBy": "ec2sqlha.amazonaws.com",
              "aws:PrincipalAccount": "${aws:ResourceAccount}"
            }
          },
          "Resource": "arn:aws:events:*:*:rule/AWSEC2SqlHa*"
        },
        {
          "Sid": "AllowEventsNonMutatingManagedRule",
          "Effect": "Allow",
          "Action": [
            "events:ListTargetsByRule",
            "events:DescribeRule"
          ],
          "Resource": "arn:aws:events:*:*:rule/AWSEC2SqlHa*"
        }
      ]
    },
    "VersionId": "v1",
    "IsDefaultVersion": true,
    "CreateDate": "2025-11-13T01:34:10+00:00"
  }
}

Version History (2 recorded)

Raw history

AWSEC2SqlHaServiceRolePolicy - Policy Version v1

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

Mar 12, 2026

41eeb96

AWSEC2SqlHaServiceRolePolicy - Policy Version v1

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

Nov 13, 2025

105e7b1