|
| 1 | +Version: "2012-10-17" |
| 2 | +Statement: |
| 3 | +- Sid: AllowManagedRuleToSendS3EventsToGuardDuty |
| 4 | + Effect: Allow |
| 5 | + Action: |
| 6 | + - events:PutRule |
| 7 | + Resource: |
| 8 | + - arn:${partition}:events:${region}:${account}:rule/DO-NOT-DELETE-AmazonGuardDutyMalwareProtectionS3* |
| 9 | + Condition: |
| 10 | + StringEquals: |
| 11 | + events:ManagedBy: malware-protection-plan.guardduty.amazonaws.com |
| 12 | + ForAllValues:StringEquals: |
| 13 | + events:source: aws.s3 |
| 14 | + events:detail-type: |
| 15 | + - Object Created |
| 16 | + - AWS API Call via CloudTrail |
| 17 | + 'Null': |
| 18 | + events:source: 'false' |
| 19 | + events:detail-type: 'false' |
| 20 | +- Sid: AllowUpdateTargetAndDeleteManagedRule |
| 21 | + Effect: Allow |
| 22 | + Action: |
| 23 | + - events:DeleteRule |
| 24 | + - events:PutTargets |
| 25 | + - events:RemoveTargets |
| 26 | + Resource: |
| 27 | + - arn:${partition}:events:${region}:${account}:rule/DO-NOT-DELETE-AmazonGuardDutyMalwareProtectionS3* |
| 28 | + Condition: |
| 29 | + StringEquals: |
| 30 | + events:ManagedBy: malware-protection-plan.guardduty.amazonaws.com |
| 31 | +- Sid: AllowGuardDutyToMonitorEventBridgeManagedRule |
| 32 | + Effect: Allow |
| 33 | + Action: |
| 34 | + - events:DescribeRule |
| 35 | + - events:ListTargetsByRule |
| 36 | + Resource: |
| 37 | + - arn:${partition}:events:${region}:${account}:rule/DO-NOT-DELETE-AmazonGuardDutyMalwareProtectionS3* |
| 38 | +- Sid: AllowEnableS3EventBridgeEvents |
| 39 | + Effect: Allow |
| 40 | + Action: |
| 41 | + - s3:PutBucketNotification |
| 42 | + - s3:GetBucketNotification |
| 43 | + Resource: |
| 44 | + - "${bucket_arn}" |
| 45 | + Condition: |
| 46 | + StringEquals: |
| 47 | + aws:ResourceAccount: "${account}" |
| 48 | +- Sid: AllowPostScanTag |
| 49 | + Effect: Allow |
| 50 | + Action: |
| 51 | + - s3:GetObjectTagging |
| 52 | + - s3:GetObjectVersionTagging |
| 53 | + - s3:PutObjectTagging |
| 54 | + - s3:PutObjectVersionTagging |
| 55 | + Resource: |
| 56 | + - "${bucket_arn}/* |
| 57 | + Condition: |
| 58 | + StringEquals: |
| 59 | + aws:ResourceAccount: "${account}" |
| 60 | +- Sid: AllowPutValidationObject |
| 61 | + Effect: Allow |
| 62 | + Action: |
| 63 | + - s3:PutObject |
| 64 | + Resource: |
| 65 | + - "${bucket_arn}/malware-protection-resource-validation-object" |
| 66 | + Condition: |
| 67 | + StringEquals: |
| 68 | + aws:ResourceAccount: "${account}" |
| 69 | +- Sid: AllowCheckBucketOwnership |
| 70 | + Effect: Allow |
| 71 | + Action: |
| 72 | + - s3:ListBucket |
| 73 | + Resource: |
| 74 | + - "${bucket_arn}" |
| 75 | + Condition: |
| 76 | + StringEquals: |
| 77 | + aws:ResourceAccount: "${account}" |
| 78 | +- Sid: AllowMalwareScan |
| 79 | + Effect: Allow |
| 80 | + Action: |
| 81 | + - s3:GetObject |
| 82 | + - s3:GetObjectVersion |
| 83 | + Resource: |
| 84 | + - "${bucket_arn}/*" |
| 85 | + Condition: |
| 86 | + StringEquals: |
| 87 | + aws:ResourceAccount: "${account}" |
| 88 | +- Sid: AllowDecryptForMalwareScan |
| 89 | + Effect: Allow |
| 90 | + Action: |
| 91 | + - kms:GenerateDataKey |
| 92 | + - kms:Decrypt |
| 93 | + Resource: ${kms_key_arn} |
| 94 | + Condition: |
| 95 | + StringEquals: |
| 96 | + kms:CallerAccount: "${account}" |
| 97 | + kms:ViaService: s3.${region}.amazonaws.com |
| 98 | + StringLike: |
| 99 | + kms:EncryptionContext:aws:s3:arn: "${bucket_arn} |
0 commit comments