File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
modules/scanning-delegate-role Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -73,14 +73,29 @@ data "aws_iam_policy_document" "scanning_orchestrator_policy_document" {
73
73
}
74
74
}
75
75
76
+ // IAM makes a distinction between source and destination snapshot permissions
77
+ // when using CopySnapshot. We need a policy statement for both of them.
78
+ //
79
+ // reference: https://aws.amazon.com/blogs/storage/enhancing-resource-level-permissions-for-copying-amazon-ebs-snapshots/
76
80
statement {
77
- sid = " DatadogAgentlessScannerCopySnapshot "
81
+ sid = " DatadogAgentlessScannerCopySnapshotSource "
78
82
effect = " Allow"
79
83
actions = [
80
84
" ec2:CopySnapshot"
81
85
]
82
86
resources = [
83
- " arn:${ data . aws_partition . current . partition } :ec2:*:*:snapshot/*" ,
87
+ " arn:${ data . aws_partition . current . partition } :ec2:*:*:snapshot/snap-*" ,
88
+ ]
89
+ }
90
+
91
+ statement {
92
+ sid = " DatadogAgentlessScannerCopySnapshotDestination"
93
+ effect = " Allow"
94
+ actions = [
95
+ " ec2:CopySnapshot"
96
+ ]
97
+ resources = [
98
+ " arn:${ data . aws_partition . current . partition } :ec2:*:*:snapshot/$${*}" ,
84
99
]
85
100
// Enforcing created snapshot has DatadogAgentlessScanner tag
86
101
condition {
You can’t perform that action at this time.
0 commit comments