Skip to content

Commit 4c533b5

Browse files
author
ievgeniia ieromenko
committed
adding tags and rules
1 parent 5178ff6 commit 4c533b5

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

aws_sra_examples/solutions/genai/sra_guardduty_malware_protection_for_s3/README.md

+8-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
## Introduction
1212

13-
This solution deploys Amazon GuardDuty Malware Protection for S3 buckets using AWS CloudFormation. It creates protection plan to enable automated scanning of new objects in S3 buckets for malware and sends notifications of scan results. GuardDuty Malware Protection for S3 can detect malicious content in files before they are processed or used by other systems, enhancing the security of data stored in S3.
13+
This solution deploys Amazon GuardDuty Malware Protection for S3 using AWS CloudFormation. It creates protection plan to enable automated scanning of new objects in S3 buckets for malware and sends notifications of scan results. GuardDuty Malware Protection for S3 can detect malicious content in files before they are processed or used by other systems, enhancing the security of data stored in S3.
1414
A key use case for this solution is in the preparation of knowledge bases for Retrieval Augmented Generation (RAG) with Amazon Bedrock. The malware protection capabilities help enhance the security controls for documents and files used in Amazon Bedrock knowledge base construction, contributing to the overall security posture of AI-powered applications.
1515

1616
### Features
@@ -88,13 +88,18 @@ You can deploy this solution using the AWS Console or AWS CLI.
8888
### Deploying via AWS CLI
8989
1. Run the following command to deploy the stack:
9090
#### Notes:
91-
- Update parameter values with your specific settings.
91+
- Update parameter values with your specific settings.
92+
- When deploying with an existing bucket, add the following parameters to your CloudFormation deployment command:
93+
```bash
94+
ParameterKey=pExistingBucketName,ParameterValue="bucket-name" \
95+
ParameterKey=pExistingBucketKmsKey,ParameterValue="kms-key-arn"
96+
```
9297
- This example assumes the CloudFormation template file is saved in the templates directory. Adjust the --template-body path if necessary.
9398
- Ensure the --capabilities CAPABILITY_NAMED_IAM flag is included to allow CloudFormation to create the necessary IAM resources.
9499

95100
```bash
96101
aws cloudformation create-stack \
97-
--stack-name SraGuardDutyS3MalwareProtection \
102+
--stack-name SraGuardDutyMalwareProtectionForS3 \
98103
--template-body file://aws_sra_examples/solutions/genai/sra_guardduty_malware_protection_for_s3/templates/sra-guardduty-malware-protection-for-s3-main.yaml \
99104
--region us-east-2 \
100105
--parameters \

aws_sra_examples/solutions/genai/sra_guardduty_malware_protection_for_s3/templates/sra-guardduty-malware-protection-for-s3-main.yaml

+8-2
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,11 @@ Rules:
128128
Assertions:
129129
- Assert: !Not [!Equals [!Ref pExistingBucketName, '']]
130130
AssertDescription: Existing bucket name is required when using an existing bucket
131+
EmailAddressValidation:
132+
RuleCondition: !Equals [!Ref pSRAAlarmEmail, '']
133+
Assertions:
134+
- Assert: !Not [!Equals [!Ref pSRAAlarmEmail, '']]
135+
AssertDescription: Must provide a valid email address
131136

132137
Conditions:
133138
cCreateNewBucket: !Equals
@@ -235,6 +240,9 @@ Resources:
235240
- Effect: Allow
236241
Action: sqs:SendMessage
237242
Resource: !GetAtt rGuardDutyS3ProtectionRuleDLQ.Arn
243+
Tags:
244+
- Key: sra-solution
245+
Value: !Ref pSRASolutionName
238246

239247
rGuardDutyS3ProtectionRuleDLQ:
240248
Type: AWS::SQS::Queue
@@ -414,7 +422,6 @@ Resources:
414422
Version: '2012-10-17'
415423
ManagedPolicyArns:
416424
- !Sub ${rIAMS3MalwareBucketPolicy.PolicyArn}
417-
418425
Tags:
419426
- Key: sra-solution
420427
Value: !Ref pSRASolutionName
@@ -437,7 +444,6 @@ Resources:
437444
Value: !Ref pSRASolutionName
438445

439446
rS3MalwareProtectionPlanAlarmTopic:
440-
# Condition: cCreateDLQAlarm
441447
Type: AWS::SNS::Topic
442448
Properties:
443449
DisplayName: !Sub ${pSRASolutionName}-alarm

0 commit comments

Comments
 (0)