Deprecated

Removed from AWS on 2025-05-29 - Active for 3 years, 2 months

AWSMarketplaceImageBuildFullAccess

Last Modified

Sep 18, 2024

September 18, 2024 at 10:06 AM UTC

Version

v3

Total Versions

7

Created

Mar 4, 2022

Actions

28

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 1 documented escalation path, but only on named resources or under a condition. Review that scope before trusting it.

    • ec2-001iam:PassRole + ec2:RunInstancesscoped
      • iam:PassRole: condition iam:PassedToService, on arn:aws:iam::*:role/*Automation*, arn:aws:iam::*:role/*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": {
    "CreateDate": "2022-03-04T17:05:09Z",
    "VersionId": "v3",
    "Document": {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Action": [
            "aws-marketplace:ListBuilds",
            "aws-marketplace:StartBuild",
            "aws-marketplace:DescribeBuilds"
          ],
          "Resource": "*",
          "Effect": "Allow"
        },
        {
          "Action": "ec2:TerminateInstances",
          "Resource": "*",
          "Effect": "Allow",
          "Condition": {
            "StringLike": {
              "ec2:ResourceTag/marketplace-image-build:build-id": "*"
            }
          }
        },
        {
          "Action": "iam:PassRole",
          "Resource": [
            "arn:aws:iam::*:role/*Automation*",
            "arn:aws:iam::*:role/*Instance*"
          ],
          "Effect": "Allow",
          "Condition": {
            "StringEquals": {
              "iam:PassedToService": [
                "ec2.amazonaws.com"
              ]
            }
          }
        },
        {
          "Action": [
            "ssm:GetAutomationExecution",
            "ssm:ListDocuments",
            "ssm:DescribeDocument",
            "ec2:DeregisterImage",
            "ec2:CopyImage",
            "ec2:DescribeSnapshots",
            "ec2:DescribeSecurityGroups",
            "ec2:DescribeImages",
            "ec2:DescribeSubnets",
            "ec2:DeleteSnapshot",
            "ec2:CreateImage",
            "ec2:RunInstances",
            "ec2:DescribeInstanceStatus",
            "sns:GetTopicAttributes",
            "iam:GetRole",
            "iam:GetInstanceProfile"
          ],
          "Resource": "*",
          "Effect": "Allow"
        },
        {
          "Action": [
            "s3:GetObject",
            "s3:ListBucket"
          ],
          "Resource": [
            "arn:aws:s3:::*image-build*"
          ],
          "Effect": "Allow"
        },
        {
          "Action": [
            "ec2:CreateTags"
          ],
          "Resource": [
            "arn:aws:ec2:*::image/*",
            "arn:aws:ec2:*:*:instance/*"
          ],
          "Effect": "Allow"
        },
        {
          "Action": [
            "sns:Publish"
          ],
          "Resource": [
            "arn:aws:sns:*:*:*image-build*"
          ],
          "Effect": "Allow"
        },
        {
          "Action": [
            "ssm:StartAutomationExecution"
          ],
          "Resource": [
            "arn:aws:ssm:eu-central-1:906690553262:automation-definition/*",
            "arn:aws:ssm:us-east-1:058657716661:automation-definition/*",
            "arn:aws:ssm:ap-northeast-1:340648487307:automation-definition/*",
            "arn:aws:ssm:eu-west-1:564714592864:automation-definition/*",
            "arn:aws:ssm:us-west-2:243045473901:automation-definition/*",
            "arn:aws:ssm:ap-southeast-2:362149219987:automation-definition/*",
            "arn:aws:ssm:eu-west-2:587945719687:automation-definition/*",
            "arn:aws:ssm:us-east-2:134937423163:automation-definition/*"
          ],
          "Effect": "Allow"
        },
        {
          "Action": [
            "iam:PassRole"
          ],
          "Resource": [
            "*"
          ],
          "Effect": "Allow",
          "Condition": {
            "StringLike": {
              "iam:AssociatedResourceARN": [
                "arn:aws:ssm:eu-central-1:906690553262:automation-definition/*",
                "arn:aws:ssm:us-east-1:058657716661:automation-definition/*",
                "arn:aws:ssm:ap-northeast-1:340648487307:automation-definition/*",
                "arn:aws:ssm:eu-west-1:564714592864:automation-definition/*",
                "arn:aws:ssm:us-west-2:243045473901:automation-definition/*",
                "arn:aws:ssm:ap-southeast-2:362149219987:automation-definition/*",
                "arn:aws:ssm:eu-west-2:587945719687:automation-definition/*",
                "arn:aws:ssm:us-east-2:134937423163:automation-definition/*"
              ],
              "iam:PassedToService": [
                "ssm.amazonaws.com"
              ]
            }
          }
        },
        {
          "Action": [
            "ec2:CreateTags"
          ],
          "Resource": [
            "arn:aws:ec2:*:*:instance/*"
          ],
          "Effect": "Deny",
          "Condition": {
            "StringLike": {
              "aws:RequestTag/marketplace-image-build:build-id": "*"
            },
            "StringNotEquals": {
              "ec2:CreateAction": "RunInstances"
            }
          }
        }
      ]
    },
    "IsDefaultVersion": true
  }
}

Version History (9 recorded)

Raw history

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.

Mar 4, 2022

bec123a

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