AmazonECSServiceRolePolicy

Last Modified

Apr 23, 2026

April 23, 2026 at 12:03 AM UTC

Version

v24

Total Versions

17

Created

Apr 22, 2026

Actions

64

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-001ssm:StartSessionscoped
      • ssm:StartSession: on arn:aws:ecs:*:*:task/*, arn:aws:ssm:*:*:document/AmazonECS-ExecuteInteractiveCommand

    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 rewrite resource policies and sharing

    Grants 2 permissions management actions across 1 service (ec2) on any resource, enough to share resources outside the account.

    ec2:createnetworkinterfacepermissionec2:deletenetworkinterfacepermission

    Use with caution: Turn on IAM Access Analyzer external access findings, and keep account-level guards like S3 Block Public Access enabled.

IAM Access Analyzer (1)

  • Suggestion / EQUIVALENT_TO_NULL_FALSE

    We recommend replacing the key aws:RequestTag/AmazonECSManaged in the condition block of StringLike with {aws:RequestTag/AmazonECSManaged: false} to ensure better enforcement of the condition. AWS docs

Policy Document

View on GitHub
{
  "PolicyVersion": {
    "Document": {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Sid": "ECSTaskManagement",
          "Effect": "Allow",
          "Action": [
            "ec2:AttachNetworkInterface",
            "ec2:AssociateTrunkInterface",
            "ec2:CreateNetworkInterface",
            "ec2:CreateNetworkInterfacePermission",
            "ec2:DeleteNetworkInterface",
            "ec2:DeleteNetworkInterfacePermission",
            "ec2:Describe*",
            "ec2:DetachNetworkInterface",
            "ec2:DisassociateTrunkInterface",
            "elasticloadbalancing:DeregisterInstancesFromLoadBalancer",
            "elasticloadbalancing:DeregisterTargets",
            "elasticloadbalancing:Describe*",
            "elasticloadbalancing:RegisterInstancesWithLoadBalancer",
            "elasticloadbalancing:RegisterTargets",
            "route53:ChangeResourceRecordSets",
            "route53:CreateHealthCheck",
            "route53:DeleteHealthCheck",
            "route53:Get*",
            "route53:List*",
            "route53:UpdateHealthCheck",
            "servicediscovery:DeregisterInstance",
            "servicediscovery:Get*",
            "servicediscovery:List*",
            "servicediscovery:RegisterInstance",
            "servicediscovery:UpdateInstanceCustomHealthStatus"
          ],
          "Resource": "*"
        },
        {
          "Sid": "AutoScaling",
          "Effect": "Allow",
          "Action": [
            "autoscaling:Describe*"
          ],
          "Resource": "*"
        },
        {
          "Sid": "AutoScalingManagement",
          "Effect": "Allow",
          "Action": [
            "autoscaling:DeletePolicy",
            "autoscaling:PutScalingPolicy",
            "autoscaling:SetInstanceProtection",
            "autoscaling:UpdateAutoScalingGroup",
            "autoscaling:PutLifecycleHook",
            "autoscaling:DeleteLifecycleHook",
            "autoscaling:CompleteLifecycleAction",
            "autoscaling:RecordLifecycleActionHeartbeat",
            "autoscaling:TerminateInstanceInAutoScalingGroup"
          ],
          "Resource": "*",
          "Condition": {
            "Null": {
              "autoscaling:ResourceTag/AmazonECSManaged": "false"
            }
          }
        },
        {
          "Sid": "AutoScalingPlanManagement",
          "Effect": "Allow",
          "Action": [
            "autoscaling-plans:CreateScalingPlan",
            "autoscaling-plans:DeleteScalingPlan",
            "autoscaling-plans:DescribeScalingPlans",
            "autoscaling-plans:DescribeScalingPlanResources"
          ],
          "Resource": "*"
        },
        {
          "Sid": "EventBridge",
          "Effect": "Allow",
          "Action": [
            "events:DescribeRule",
            "events:ListTargetsByRule"
          ],
          "Resource": "arn:aws:events:*:*:rule/ecs-managed-*"
        },
        {
          "Sid": "EventBridgeRuleManagement",
          "Effect": "Allow",
          "Action": [
            "events:PutRule",
            "events:PutTargets"
          ],
          "Resource": "*",
          "Condition": {
            "StringEquals": {
              "events:ManagedBy": "ecs.amazonaws.com"
            }
          }
        },
        {
          "Sid": "CWAlarmManagement",
          "Effect": "Allow",
          "Action": [
            "cloudwatch:DeleteAlarms",
            "cloudwatch:DescribeAlarms",
            "cloudwatch:PutMetricAlarm"
          ],
          "Resource": "arn:aws:cloudwatch:*:*:alarm:*"
        },
        {
          "Sid": "ECSTagging",
          "Effect": "Allow",
          "Action": [
            "ec2:CreateTags"
          ],
          "Resource": "arn:aws:ec2:*:*:network-interface/*"
        },
        {
          "Sid": "CWLogGroupManagement",
          "Effect": "Allow",
          "Action": [
            "logs:CreateLogGroup",
            "logs:DescribeLogGroups",
            "logs:PutRetentionPolicy"
          ],
          "Resource": "arn:aws:logs:*:*:log-group:/aws/ecs/*"
        },
        {
          "Sid": "CWLogStreamManagement",
          "Effect": "Allow",
          "Action": [
            "logs:CreateLogStream",
            "logs:DescribeLogStreams",
            "logs:PutLogEvents"
          ],
          "Resource": "arn:aws:logs:*:*:log-group:/aws/ecs/*:log-stream:*"
        },
        {
          "Sid": "ExecuteCommandSessionManagement",
          "Effect": "Allow",
          "Action": [
            "ssm:DescribeSessions"
          ],
          "Resource": "*"
        },
        {
          "Sid": "ExecuteCommand",
          "Effect": "Allow",
          "Action": [
            "ssm:StartSession"
          ],
          "Resource": [
            "arn:aws:ecs:*:*:task/*",
            "arn:aws:ssm:*:*:document/AmazonECS-ExecuteInteractiveCommand"
          ]
        },
        {
          "Sid": "OpenDataChannel",
          "Effect": "Allow",
          "Action": [
            "ssmmessages:OpenDataChannel"
          ],
          "Resource": [
            "arn:aws:ssm:*:*:session/*"
          ],
          "Condition": {
            "StringEquals": {
              "aws:PrincipalAccount": "${aws:ResourceAccount}"
            }
          }
        },
        {
          "Sid": "CloudMapResourceCreation",
          "Effect": "Allow",
          "Action": [
            "servicediscovery:CreateHttpNamespace",
            "servicediscovery:CreateService"
          ],
          "Resource": "*",
          "Condition": {
            "ForAllValues:StringEquals": {
              "aws:TagKeys": [
                "AmazonECSManaged"
              ]
            }
          }
        },
        {
          "Sid": "CloudMapResourceTagging",
          "Effect": "Allow",
          "Action": "servicediscovery:TagResource",
          "Resource": "*",
          "Condition": {
            "StringLike": {
              "aws:RequestTag/AmazonECSManaged": "*"
            }
          }
        },
        {
          "Sid": "CloudMapResourceDeletion",
          "Effect": "Allow",
          "Action": [
            "servicediscovery:DeleteService"
          ],
          "Resource": "*",
          "Condition": {
            "Null": {
              "aws:ResourceTag/AmazonECSManaged": "false"
            }
          }
        },
        {
          "Sid": "CloudMapResourceDiscovery",
          "Effect": "Allow",
          "Action": [
            "servicediscovery:DiscoverInstances",
            "servicediscovery:DiscoverInstancesRevision"
          ],
          "Resource": "*"
        },
        {
          "Sid": "CloudMapResourceAttributeManagement",
          "Effect": "Allow",
          "Action": [
            "servicediscovery:UpdateServiceAttributes"
          ],
          "Resource": "*",
          "Condition": {
            "Null": {
              "aws:ResourceTag/AmazonECSManaged": "false"
            }
          }
        },
        {
          "Sid": "ReadOnlyPermissionsForInstanceEventWindows",
          "Effect": "Allow",
          "Action": [
            "ec2:DescribeInstanceEventWindows"
          ],
          "Resource": "*"
        }
      ]
    },
    "VersionId": "v24",
    "IsDefaultVersion": true,
    "CreateDate": "2026-04-22T23:12:09+00:00"
  }
}

Version History (22 recorded)

Raw history
v24updated

1 action added

4bbd3a1

AmazonECSServiceRolePolicy - Policy Version v23

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

Mar 12, 2026

5bc875e

AmazonECSServiceRolePolicy - Policy Version v23

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

Feb 12, 2026

bb4b595

AmazonECSServiceRolePolicy - Policy Version v19

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

Feb 12, 2026

80bdf7e

AmazonECSServiceRolePolicy - Policy Version v15

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

Jan 21, 2026

9d96a9c

AmazonECSServiceRolePolicy - Policy Version v14

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

Nov 21, 2025

4be7c24

AmazonECSServiceRolePolicy - Policy Version v13

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

Nov 17, 2025

18492da

Update detected

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

Jun 24, 2025

774933a

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.

Dec 4, 2023

df5207d

Update detected

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

Oct 10, 2023

64af321

Update detected

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

Oct 14, 2022

a577de1

Update detected

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

Jan 14, 2021

937690c

Update detected

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

Nov 22, 2019

684326f

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