AWSDeepLensServiceRolePolicy

Last Modified

Mar 12, 2026

March 12, 2026 at 09:25 PM UTC

Version

v6

Total Versions

7

Created

Sep 25, 2019

Actions

113

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.

    • sagemaker-002iam:PassRole + sagemaker:CreateTrainingJobscoped
      • iam:PassRole: condition iam:PassedToService
      • sagemaker:CreateTrainingJob: on arn:aws:sagemaker:*:*:training-job/deeplens*

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

    • lambda-003lambda:UpdateFunctionCodescoped
      • lambda:UpdateFunctionCode: on arn:aws:lambda:*:*:function:deeplens*

    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 read secrets

    Reads Lambda environment variables, where credentials often live, on any resource with no condition.

    lambda:GetFunctionConfiguration

    Use with caution: Where the holder needs only some secrets, write your own policy scoped to their ARNs or tags, and limit decryption in the KMS key policies.

  • Medium

    Can rewrite resource policies and sharing

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

    iot:attachprincipalpolicyiot:createpolicyiot:createpolicyversioniot:detachprincipalpolicy

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

  • Medium

    Full deeplens access on every resource

    Uses deeplens:* with Resource "*" and no condition, so every action AWS adds to that service later is granted too.

    deeplens:*

    Use with caution: The grant grows every time the service does. For long-lived access, prefer a policy that lists the actions you actually need.

Policy Document

View on GitHub
{
  "PolicyVersion": {
    "Document": {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Sid": "DeepLensIoTThingAccess",
          "Effect": "Allow",
          "Action": [
            "iot:CreateThing",
            "iot:DeleteThing",
            "iot:DeleteThingShadow",
            "iot:DescribeThing",
            "iot:GetThingShadow",
            "iot:UpdateThing",
            "iot:UpdateThingShadow"
          ],
          "Resource": [
            "arn:aws:iot:*:*:thing/deeplens*"
          ]
        },
        {
          "Sid": "DeepLensIoTCertificateAccess",
          "Effect": "Allow",
          "Action": [
            "iot:AttachThingPrincipal",
            "iot:DetachThingPrincipal",
            "iot:UpdateCertificate",
            "iot:DeleteCertificate",
            "iot:DetachPrincipalPolicy"
          ],
          "Resource": [
            "arn:aws:iot:*:*:thing/deeplens*",
            "arn:aws:iot:*:*:cert/*"
          ]
        },
        {
          "Sid": "DeepLensIoTCreateCertificateAndPolicyAccess",
          "Effect": "Allow",
          "Action": [
            "iot:CreateKeysAndCertificate",
            "iot:CreatePolicy",
            "iot:CreatePolicyVersion"
          ],
          "Resource": [
            "*"
          ]
        },
        {
          "Sid": "DeepLensIoTAttachCertificatePolicyAccess",
          "Effect": "Allow",
          "Action": [
            "iot:AttachPrincipalPolicy"
          ],
          "Resource": [
            "arn:aws:iot:*:*:policy/deeplens*",
            "arn:aws:iot:*:*:cert/*"
          ]
        },
        {
          "Sid": "DeepLensIoTDataAccess",
          "Effect": "Allow",
          "Action": [
            "iot:GetThingShadow",
            "iot:UpdateThingShadow"
          ],
          "Resource": [
            "arn:aws:iot:*:*:thing/deeplens*"
          ]
        },
        {
          "Sid": "DeepLensIoTEndpointAccess",
          "Effect": "Allow",
          "Action": [
            "iot:DescribeEndpoint"
          ],
          "Resource": [
            "*"
          ]
        },
        {
          "Sid": "DeepLensAccess",
          "Effect": "Allow",
          "Action": [
            "deeplens:*"
          ],
          "Resource": [
            "*"
          ]
        },
        {
          "Sid": "DeepLensS3ObjectAccess",
          "Effect": "Allow",
          "Action": [
            "s3:GetObject"
          ],
          "Resource": [
            "arn:aws:s3:::deeplens*"
          ]
        },
        {
          "Sid": "DeepLensS3Buckets",
          "Effect": "Allow",
          "Action": [
            "s3:DeleteBucket",
            "s3:ListBucket"
          ],
          "Resource": [
            "arn:aws:s3:::deeplens*"
          ]
        },
        {
          "Sid": "DeepLensCreateS3Buckets",
          "Effect": "Allow",
          "Action": [
            "s3:CreateBucket"
          ],
          "Resource": [
            "*"
          ]
        },
        {
          "Sid": "DeepLensIAMPassRoleAccess",
          "Effect": "Allow",
          "Action": [
            "iam:PassRole"
          ],
          "Resource": [
            "*"
          ],
          "Condition": {
            "StringEquals": {
              "iam:PassedToService": [
                "greengrass.amazonaws.com",
                "sagemaker.amazonaws.com"
              ]
            }
          }
        },
        {
          "Sid": "DeepLensIAMLambdaPassRoleAccess",
          "Effect": "Allow",
          "Action": [
            "iam:PassRole"
          ],
          "Resource": [
            "arn:aws:iam::*:role/AWSDeepLens*",
            "arn:aws:iam::*:role/service-role/AWSDeepLens*"
          ],
          "Condition": {
            "StringEqualsIfExists": {
              "iam:PassedToService": "lambda.amazonaws.com"
            }
          }
        },
        {
          "Sid": "DeepLensGreenGrassAccess",
          "Effect": "Allow",
          "Action": [
            "greengrass:AssociateRoleToGroup",
            "greengrass:AssociateServiceRoleToAccount",
            "greengrass:CreateResourceDefinition",
            "greengrass:CreateResourceDefinitionVersion",
            "greengrass:CreateCoreDefinition",
            "greengrass:CreateCoreDefinitionVersion",
            "greengrass:CreateDeployment",
            "greengrass:CreateFunctionDefinition",
            "greengrass:CreateFunctionDefinitionVersion",
            "greengrass:CreateGroup",
            "greengrass:CreateGroupCertificateAuthority",
            "greengrass:CreateGroupVersion",
            "greengrass:CreateLoggerDefinition",
            "greengrass:CreateLoggerDefinitionVersion",
            "greengrass:CreateSubscriptionDefinition",
            "greengrass:CreateSubscriptionDefinitionVersion",
            "greengrass:DeleteCoreDefinition",
            "greengrass:DeleteFunctionDefinition",
            "greengrass:DeleteGroup",
            "greengrass:DeleteLoggerDefinition",
            "greengrass:DeleteSubscriptionDefinition",
            "greengrass:DisassociateRoleFromGroup",
            "greengrass:DisassociateServiceRoleFromAccount",
            "greengrass:GetAssociatedRole",
            "greengrass:GetConnectivityInfo",
            "greengrass:GetCoreDefinition",
            "greengrass:GetCoreDefinitionVersion",
            "greengrass:GetDeploymentStatus",
            "greengrass:GetDeviceDefinition",
            "greengrass:GetDeviceDefinitionVersion",
            "greengrass:GetFunctionDefinition",
            "greengrass:GetFunctionDefinitionVersion",
            "greengrass:GetGroup",
            "greengrass:GetGroupCertificateAuthority",
            "greengrass:GetGroupCertificateConfiguration",
            "greengrass:GetGroupVersion",
            "greengrass:GetLoggerDefinition",
            "greengrass:GetLoggerDefinitionVersion",
            "greengrass:GetResourceDefinition",
            "greengrass:GetServiceRoleForAccount",
            "greengrass:GetSubscriptionDefinition",
            "greengrass:GetSubscriptionDefinitionVersion",
            "greengrass:ListCoreDefinitionVersions",
            "greengrass:ListCoreDefinitions",
            "greengrass:ListDeployments",
            "greengrass:ListDeviceDefinitionVersions",
            "greengrass:ListDeviceDefinitions",
            "greengrass:ListFunctionDefinitionVersions",
            "greengrass:ListFunctionDefinitions",
            "greengrass:ListGroupCertificateAuthorities",
            "greengrass:ListGroupVersions",
            "greengrass:ListGroups",
            "greengrass:ListLoggerDefinitionVersions",
            "greengrass:ListLoggerDefinitions",
            "greengrass:ListSubscriptionDefinitionVersions",
            "greengrass:ListSubscriptionDefinitions",
            "greengrass:ResetDeployments",
            "greengrass:UpdateConnectivityInfo",
            "greengrass:UpdateCoreDefinition",
            "greengrass:UpdateDeviceDefinition",
            "greengrass:UpdateFunctionDefinition",
            "greengrass:UpdateGroup",
            "greengrass:UpdateGroupCertificateConfiguration",
            "greengrass:UpdateLoggerDefinition",
            "greengrass:UpdateSubscriptionDefinition",
            "greengrass:UpdateResourceDefinition"
          ],
          "Resource": [
            "*"
          ]
        },
        {
          "Sid": "DeepLensLambdaAdminFunctionAccess",
          "Effect": "Allow",
          "Action": [
            "lambda:CreateFunction",
            "lambda:DeleteFunction",
            "lambda:GetFunction",
            "lambda:GetFunctionConfiguration",
            "lambda:ListFunctions",
            "lambda:ListVersionsByFunction",
            "lambda:PublishVersion",
            "lambda:UpdateFunctionCode",
            "lambda:UpdateFunctionConfiguration"
          ],
          "Resource": [
            "arn:aws:lambda:*:*:function:deeplens*"
          ]
        },
        {
          "Sid": "DeepLensLambdaUsersFunctionAccess",
          "Effect": "Allow",
          "Action": [
            "lambda:GetFunction",
            "lambda:GetFunctionConfiguration",
            "lambda:ListFunctions",
            "lambda:ListVersionsByFunction"
          ],
          "Resource": [
            "arn:aws:lambda:*:*:function:*"
          ]
        },
        {
          "Sid": "DeepLensSageMakerWriteAccess",
          "Effect": "Allow",
          "Action": [
            "sagemaker:CreateTrainingJob",
            "sagemaker:DescribeTrainingJob",
            "sagemaker:StopTrainingJob"
          ],
          "Resource": [
            "arn:aws:sagemaker:*:*:training-job/deeplens*"
          ]
        },
        {
          "Sid": "DeepLensSageMakerReadAccess",
          "Effect": "Allow",
          "Action": [
            "sagemaker:DescribeTrainingJob"
          ],
          "Resource": [
            "arn:aws:sagemaker:*:*:training-job/*"
          ]
        },
        {
          "Sid": "DeepLensKinesisVideoStreamAccess",
          "Effect": "Allow",
          "Action": [
            "kinesisvideo:CreateStream",
            "kinesisvideo:DescribeStream",
            "kinesisvideo:DeleteStream"
          ],
          "Resource": [
            "arn:aws:kinesisvideo:*:*:stream/deeplens*/*"
          ]
        },
        {
          "Sid": "DeepLensKinesisVideoEndpointAccess",
          "Effect": "Allow",
          "Action": [
            "kinesisvideo:GetDataEndpoint"
          ],
          "Resource": [
            "*"
          ]
        }
      ]
    },
    "VersionId": "v6",
    "IsDefaultVersion": true,
    "CreateDate": "2019-09-25T19:25:06+00:00"
  }
}

Version History (10 recorded)

Raw history

AWSDeepLensServiceRolePolicy - Policy Version v6

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

Mar 12, 2026

ce6ac69

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

1c37a57

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