EDR: How to Setup the Event Forwarder to Export to an External S3 Bucket
book
Article ID: 291064
calendar_today
Updated On:
Products
Carbon Black EDR (formerly Cb Response)
Issue/Introduction
How to setup the EDR event forwarder to export to an external S3 bucket.
Environment
EDR: 7.1.x +
EDR Event Forwarder: 3.6 +
Resolution
Create an S3 Bucket:
Sign into the AWS Management Console.
In the top right corner of the page, you will see a region. Ensure that the selected region is the same region that the Event Forwarder is in. Use the dropdown to select the correct region. The table below gives the applicable AWS Region for each Carbon Black EDR URL.
Under Services, navigate to the S3 console.
Choose Create Bucket. The Create bucket wizard will open.
In Bucket Name, enter a unique name for your bucket. This can be anything.
Region should default to the region you selected in step 2. Ensure that the region selected is the same region that the Event Forwarder is in by referring to the table in step 2.
The Bucket Settings for Block Public Access defaults to block all public access. This default should be sufficient; public access is not required for the S3 bucket to work with the Event Forwarder.
Select Create Bucket. Configure S3 Bucket to allow the Event Forwarder to write events.
Configuring the Bucket Policy:
Once the bucket is created and the page is loaded with a success message, select Go to Bucket Details from the message.
Navigate to Permissions and select Bucket Policy. The bucket policy gives the Event Forwarder permissions to write to your bucket.
Next to the text that reads Bucket Policy Editor, you will see the ARN for your bucket. Copy this value for use in the policy.
At the bottom of the page, select Policy Generator. The policy editor will open in a new window. We will want to setup 2 statements
Setup a statement for 'GetObject', 'PutObject', and 'DeleteObject' Actions:
In Step 1: Select Policy Type, select S3 Bucket Policy.
In Step 2: Add Statement(s) under Effect, select Allow.
In Step 2: Add Statement(s) under Principal, enter the ARN for the role you want the Event Forwarder to assume. This can be a user or group.
In Step 2: Add Statement(s), AWS Service should be Amazon S3.
In Step 2: Add Statement(s), for Actions select the following:
GetObject
PutObject
DeleteObject
In Step 2: Add Statement(s) in Amazon Resource Name (ARN), paste your S3 bucket’s ARN copied in step 11.
If you wish to allow the Event Forwarder to write to any object within this bucket, append "/*" to the ARN.
Example:arn:aws:s3:::example-bucket/*
If instead you wish to only allow the Event Forwarder to write to a specific path within the bucket, append the directory path followed by "/*" to the ARN.
Example: to only allow the Event Forwarder to write to the /carbonblack/events subdirectory within the bucket, use arn:aws:s3:::example-bucket/carbonblack/events/*
The "/*" is required at the end of the ARN regardless of directory structure to allow the Event Forwarder to create time-based subdirectories to store events.
The path must match the S3 prefix configured in the Event Forwarder.
Select Add Statement.
Setup an additional statement for 'ListBucket'
In Step 1: Select Policy Type, select S3 Bucket Policy.
In Step 2: Add Statement(s) under Effect, select Allow.
In Step 2: Add Statement(s) under Principal, enter the ARN for the role you want the Event Forwarder to assume. This can be a user or group.
In Step 2: Add Statement(s), AWS Service should be Amazon S3.
In Step 2: Add Statement(s), for Actions select the following:
ListBucket
In Step 2: Add Statement(s) in Amazon Resource Name (ARN), paste your S3 bucket’s ARN copied in step 11.
Example:arn:aws:s3:::example-bucket
Select Add Statement.
The 2 policies created above should resemble the image below:
Select Generate Policy in Step 3: Generate Policy. A pop-up will open with your Policy JSON Document. Copy the contents.
Returning to Permissions > Bucket Policy within the S3 console for your bucket, paste the Policy JSON Document in the editor and select Save.
Next select “Management” tab
Go to lifecycle and add lifecycle rule:
Select Apply to all objects in the bucket
Select Next twice to go to the “Expiration” page
Select Current Version so it’s checked. Expire the current version after desired days (7 is default) from object creation.
From the EDR product, navigate to the event forwarder tab
Enable the desired events you would like the product to upload to s3
Scroll down to Output and Type and set to s3
Put in the s3 bucket name, for example:
Format: [<region>:]<bucket-name>
Example using the policy above: Us-east-1:edrforwarder
Input the credential profile name, take note of the name (typically 'default' as is denoted in the aws.creds.ini example below)so that it can be added to the aws credential file.
Select upload AWS credentials file in ini format (Example name: aws.creds.ini). Below is an example of a profile:
Select Save and restart the service for the changes to take effect.