AmazonInspector2AgentlessServiceRolePolicy
Last Modified
Aug 20, 2026
August 20, 2026 at 08:02 PM UTC
Version
v2
Total Versions
2
Created
Aug 20, 2026
Actions
18
Risk
no risk signalRead from this policy document alone: trust policies, boundaries and SCPs in your account still decide what actually succeeds. How this is assessed
IAM Access Analyzer (2)
- Suggestion / EQUIVALENT_TO_NULL_FALSE
We recommend replacing the key aws:ResourceTag/InspectorScan in the condition block of StringLike with {aws:ResourceTag/InspectorScan: false} to ensure better enforcement of the condition. AWS docs
- Suggestion / EQUIVALENT_TO_NULL_FALSE
We recommend replacing the key ec2:ResourceTag/InspectorScan in the condition block of StringLike with {ec2:ResourceTag/InspectorScan: false} to ensure better enforcement of the condition. AWS docs
Policy Document
View on GitHub{
"PolicyVersion": {
"Document": {
"Version": "2012-10-17",
"Statement": [
{
"Sid": "InstanceIdentification",
"Effect": "Allow",
"Action": [
"ec2:DescribeInstances",
"ec2:DescribeVolumes",
"ec2:DescribeSnapshots"
],
"Resource": "*"
},
{
"Sid": "GetSnapshotData",
"Effect": "Allow",
"Action": [
"ebs:ListSnapshotBlocks",
"ebs:GetSnapshotBlock"
],
"Resource": "arn:aws:ec2:*:*:snapshot/*",
"Condition": {
"StringLike": {
"aws:ResourceTag/InspectorScan": "*"
}
}
},
{
"Sid": "CreateSnapshotsAnyInstanceOrVolume",
"Effect": "Allow",
"Action": "ec2:CreateSnapshots",
"Resource": [
"arn:aws:ec2:*:*:instance/*",
"arn:aws:ec2:*:*:volume/*"
]
},
{
"Sid": "DenyCreateSnapshotsOnExcludedInstances",
"Effect": "Deny",
"Action": "ec2:CreateSnapshots",
"Resource": "arn:aws:ec2:*:*:instance/*",
"Condition": {
"StringEquals": {
"ec2:ResourceTag/InspectorEc2Exclusion": "true"
}
}
},
{
"Sid": "CreateSnapshotsOnAnySnapshotOnlyWithTag",
"Effect": "Allow",
"Action": "ec2:CreateSnapshots",
"Resource": "arn:aws:ec2:*:*:snapshot/*",
"Condition": {
"Null": {
"aws:TagKeys": "false"
},
"ForAllValues:StringEquals": {
"aws:TagKeys": "InspectorScan"
}
}
},
{
"Sid": "CreateOnlyInspectorScanTagOnlyUsingCreateSnapshots",
"Effect": "Allow",
"Action": "ec2:CreateTags",
"Resource": "arn:aws:ec2:*:*:snapshot/*",
"Condition": {
"StringLike": {
"ec2:CreateAction": "CreateSnapshots"
},
"Null": {
"aws:TagKeys": "false"
},
"ForAllValues:StringEquals": {
"aws:TagKeys": "InspectorScan"
}
}
},
{
"Sid": "DeleteOnlySnapshotsTaggedForScanning",
"Effect": "Allow",
"Action": "ec2:DeleteSnapshot",
"Resource": "arn:aws:ec2:*:*:snapshot/*",
"Condition": {
"StringLike": {
"ec2:ResourceTag/InspectorScan": "*"
}
}
},
{
"Sid": "DenyKmsDecryptForExcludedKeys",
"Effect": "Deny",
"Action": "kms:Decrypt",
"Resource": "arn:aws:kms:*:*:key/*",
"Condition": {
"StringEquals": {
"aws:ResourceTag/InspectorEc2Exclusion": "true"
}
}
},
{
"Sid": "DecryptSnapshotBlocksVolContext",
"Effect": "Allow",
"Action": "kms:Decrypt",
"Resource": "arn:aws:kms:*:*:key/*",
"Condition": {
"StringEquals": {
"aws:ResourceAccount": "${aws:PrincipalAccount}"
},
"StringLike": {
"kms:ViaService": "ec2.*.amazonaws.com",
"kms:EncryptionContext:aws:ebs:id": "vol-*"
}
}
},
{
"Sid": "DecryptSnapshotBlocksSnapContext",
"Effect": "Allow",
"Action": "kms:Decrypt",
"Resource": "arn:aws:kms:*:*:key/*",
"Condition": {
"StringEquals": {
"aws:ResourceAccount": "${aws:PrincipalAccount}"
},
"StringLike": {
"kms:ViaService": "ec2.*.amazonaws.com",
"kms:EncryptionContext:aws:ebs:id": "snap-*"
}
}
},
{
"Sid": "DescribeKeysForEbsOperations",
"Effect": "Allow",
"Action": "kms:DescribeKey",
"Resource": "arn:aws:kms:*:*:key/*",
"Condition": {
"StringEquals": {
"aws:ResourceAccount": "${aws:PrincipalAccount}"
},
"StringLike": {
"kms:ViaService": "ec2.*.amazonaws.com"
}
}
},
{
"Sid": "DecryptCrossAccountOrgVolContext",
"Effect": "Allow",
"Action": "kms:Decrypt",
"Resource": "arn:aws:kms:*:*:key/*",
"Condition": {
"StringEquals": {
"aws:ResourceOrgID": "${aws:PrincipalOrgID}"
},
"StringLike": {
"kms:ViaService": "ec2.*.amazonaws.com",
"kms:EncryptionContext:aws:ebs:id": "vol-*"
}
}
},
{
"Sid": "DecryptCrossAccountOrgSnapContext",
"Effect": "Allow",
"Action": "kms:Decrypt",
"Resource": "arn:aws:kms:*:*:key/*",
"Condition": {
"StringEquals": {
"aws:ResourceOrgID": "${aws:PrincipalOrgID}"
},
"StringLike": {
"kms:ViaService": "ec2.*.amazonaws.com",
"kms:EncryptionContext:aws:ebs:id": "snap-*"
}
}
},
{
"Sid": "DescribeCrossAccountOrgKeysForEbsOperations",
"Effect": "Allow",
"Action": "kms:DescribeKey",
"Resource": "arn:aws:kms:*:*:key/*",
"Condition": {
"StringEquals": {
"aws:ResourceOrgID": "${aws:PrincipalOrgID}"
},
"StringLike": {
"kms:ViaService": "ec2.*.amazonaws.com"
}
}
},
{
"Sid": "ListKeyResourceTags",
"Effect": "Allow",
"Action": "kms:ListResourceTags",
"Resource": "arn:aws:kms:*:*:key/*"
}
]
},
"VersionId": "v2",
"IsDefaultVersion": true,
"CreateDate": "2026-08-20T19:17:13+00:00"
}
}Version History (5 recorded)
Raw historyscope changed, no action added or removed
AmazonInspector2AgentlessServiceRolePolicy - Policy Version v1
No recorded action delta - this version predates the change index. View the raw diff.
Mar 12, 2026
251d966Update detected
No recorded action delta - this version predates the change index. View the raw diff.
Sep 18, 2024
aafbae9Update detected
No recorded action delta - this version predates the change index. View the raw diff.
May 13, 2024
1b36617Update detected
No recorded action delta - this version predates the change index. View the raw diff.
Nov 20, 2023
ac11a2a