Integrating AWS GuardDuty
To set up AWS GuardDuty
Log into AWS GuardDuty.
Copy your Account ID and save it in a secure place to use in step 6 and the To enable the AWS GuardDuty integration procedure below.
Under Settings, copy your detector ID and save it in a secure place to use in step 6 and the To enable the AWS GuardDuty integration procedure below.
To create the encryption key for GuardDuty to write findings to AWS S3, do the following:
Navigate to AWS KMS service.
Under Customer Managed Key, create a new key named "
guardduty-findings".
Key type: Symmetric
Alias: "guardduty-findings"Select "
AWSServiceRoleForAmazonGuardDuty" for key administrator and key usage permissions.
NOTE Do not attach a key policy during the initial setup.Copy your KMS Key ID and save it in a secure place to use in step 6 and the To enable the AWS GuardDuty integration procedure below.
Copy and paste the following code to a text file:
{"Sid":"AllowGuardDutyKey", "Effect": "Allow", "Principal": {"Service": "guardduty.us-east-1.amazonaws.com"},"Action": "kms:GenerateDataKey","Resource": "arn:aws:kms:us-east-1:<ACCOUNT_NUMBER>:key/<KEY_ID>", "Condition": {"StringEquals": {"aws:SourceAccount": "<ACCOUNT_NUMBER>", "aws:SourceArn": "arn:aws:guardduty:us-east-1:<ACCOUNT_NUMBER>:detector/<GUARDDUTY_DETECTOR_ID>"}}}In the code you just pasted, change the following to the information you just selected:
<ACCOUNT_NUMBER>to your Account ID<KEY_ID>to your KMS Key ID<GUARDDUTY_DETECTOR_ID>to your detector ID
Navigate to the KMS key created in the previous step.
Add the edited policy from step 6 to the array.
For more information, see Exporting generated GuardDuty findings to Amazon S3 buckets.
Next, create a new S3 bucket. Set the encryption to use the KMS key generated in step 4.
Once the S3 bucket is created, navigate back to AWS GuardDuty.
Select Settings and configure the S3 bucket you created as the export for findings.
Paste in the ARN of the S3 bucket and KMS you created previously.
Select View Policy for S3 Bucket copy and paste this policy. In a new tab, open the S3 bucket you created in step 9. Select the permissions tab and click Edit next to Bucket Policy. Copy and paste the policy and save your changes.
Click the GuardDuty tab, then click Save.
NOTE If the setting does not save, that indicates that your KMS or S3 policy is incorrectly setup.Navigate to AWS SQS service.
Create a new queue of named
guardduty-findings.Leave the default configurations and click Save.
Make sure the access policy (permissions has S3 in it) is like below
{"Version": "2008-10-17","Id": " default_policy_ID", "Statement": [{"Sid": " owner_statement", "Effect": "Allow", "Principal": {"Service": "s3.amazonaws.com"},"Action": "SQS:*","Resource": "arn:aws:sqs:us-east-1:<AWS_ACCOUNT_NUMBER>:guardduty-findings"}]}Navigate to AWS S3 and click the bucket that was just created from GuardDuty.
Click the Properties tab.
Create a new event notification and name the event notification guardduty-findings.
Enable the All object create events checkbox. Ensure all others are cleared.
In the Destinations section, select SQS.
Select the SQS you created in previous steps called
guardduty-findingsand click Save Changes.
From this point, all GuardDuty events created in the S3 bucket are also notified in SQS queue.Navigate to IAM.
Create a new user with the policy that can read the SQS queue and receive messages.
NOTE The policy should also allow the user to Get objects from the S3 bucket created previously.
The following is a sample policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0", "Effect": "Allow", "Action": ["s3:GetObject", "sqs:GetQueueUrl","sqs:ListDeadLetterSourceQueues", "sqs:ListMessageMoveTasks", "sqs:ReceiveMessage", "sqs:GetQueueAttributes", "sqs:ListQueueTags"],
"Resource": [
"arn:aws:s3:::test-guardduty-cuda/*",
"arn:aws:sqs:us-east-1:521187741917:jlevineguardduty2"
]
},
{
"Sid": "VisualEditor1", "Effect": "Allow","Action": "sqs:ListQueues", "Resource": "*"}
To enable the AWS GuardDuty integration
Before doing this procedure, collect the following information (See steps 2, 3, and step 4 in To set up AWS GuardDuty above.):
SQS Queue URL
AWS Access Key
AWS Secret Access Key
In the Barracuda XDR Dashboard, navigate to Integrations
.
On the AWS GuardDuty card, click Setup.
Select the Enable check box.
Enter the following:
SQS Queue URL
AWS Access Key
AWS Secret Access Key
Optionally, click Test to verify the credentials.
Click Save.