Event Forwarder Configuration API

Introduction

The Carbon Black Cloud Forwarder lets you send data about alerts and events to an AWS S3 bucket where it can be reconfigured to port into other applications in your security stack, such as Splunk. The Event Forwarder is recommended over APIs for obtaining large amounts of data from Carbon Black Cloud in real time.

Available Forwarder Types

  • endpoint.event
  • alert

Requirements

  • Carbon Black Cloud Endpoint Standard or Enterprise EDR
  • API Key with appropriate permissions
  • Configured S3 bucket in the same region as the forwarder

Quick Setup with Postman & S3 bucket Configuration

Follow the step-by step guide for enabling the Carbon Black Cloud Event Forwarder using Postman found here. This will walk you through the following steps:

  1. Create a bucket in your AWS Management Console
  2. Configure an AWS S3 Bucket to allow the Event Forwarder to write events
  3. Create New Access Level in the Carbon Black Cloud Console
  4. Create New API Key in the Carbon Black Cloud Console
  5. Configure the API in Postman
  6. Create a New Event or Alert Forwarder
  7. Monitor the Data Flow to the S3 Bucket

Alternative Bucket Setup

If you already have an AWS S3 bucket or are looking for additional ways to configure your bucket for varying levels of access and other use-cases, see here.

Data Format

S3 Data Storage Format

Currently the Carbon Black Cloud Event Forwarder only supports output to AWS S3 buckets provided by customers. The Event Forwarder outputs gzip compressed single-event-per-line JSON format (sometimes known as “JSONL”) to the customer’s S3 bucket with the following folder structure:

org_key={org_key}/year={year}/month={month}/day={day}/hour={hour}/minute={minute}/second={second}/{uuid}.jsonl.gz

Therefore, if a batch of events occurred on August 27, 2019 at 12:36:53UTC for the organization with org_key ABCD1234 can be located in:

org_key=ABCD1234/year=2019/month=8/day=27/hour=12/minute=36/second=53/ac203140-f0e2-48fe-90cf-05eb7289f628.jsonl.gz

Data Mapping

You can find the Event and Alert schema as well as sample data in the Data Mapping Guide.

Authentication

Use the following information for authentication, and see the Carbon Black Cloud Authentication Guide for full instructions.

  • Access Level: Before you create your API Key, you need to create a “Custom” Access Level for the “Event Forwarder” category
    • To use all functions of the Event Forwarder, allow the following permissions: Create, Read, Update, Delete(or see each call below for individual requirements)
  • API Key: When you create your API Key, use the Access Level Type of “Custom”, then select the Access Level you created.
  • Environment: use the URL of your Carbon Black Cloud console (this is the Dashboard URL).
  • API Route: event_forwarder_config/v1/orgs/<org_key>/configs
    • Note: when you insert your org_key, you must also remove the < > brackets.

API Calls

The following API calls can be used for either “endpoint.event” or “alert” forwarder types.

Create Forwarder

Use this call to create a new forwarder. The API will then make calls to check whether the Forwarder can write to the specified S3 Bucket using the configuration supplied. It will attempt to write a test message called healthcheck.json to the specified bucket. If the bucket is misconfigured (i.e. incorrect permissions, principle arn, etc.) or the configuration is incorrect (i.e. bucket prefix doesn’t match path specified in policy), the API will respond with a 400 error and message with information about what was incorrect and how to fix the issue.

If you want to forward both alert type data and endpoint.event type data, you should create a separate forwarder for each. The forwarder should be configured to send the data to its own subfolder in the S3 bucket using the S3 prefix property. The subfolder you configure will be automatically added to the S3 bucket.

RBAC Permissions Required

Permission (.notation name) Operation(s)
event-forwarder.settings CREATE

Request

POST https://defense-<environment>.conferdeploy.net/event_forwarder_config/v1/orgs/{org_key}/configs

Request Body

Required fields:
Name, s3_bucket_name, s3_prefix, type

{
  "name":"<string>",
  "s3_bucket_name":"<string>",
  "s3_prefix":"<string>",
  "type":"<string>"
}

Body Schema

Field Description Default Required
name Defined name for the specific event forwarder N/A Yes
s3_bucket_name Configured unique name for s3 bucket N/A Yes
s3_prefix Defined folder structure the forwarder will write events to N/A Yes
type The datastream type that is to be forwarded. Supported datastream types: ‘endpoint.event’, ‘alert’ N/A Yes

Response

Use the following to troubleshoot errors. For more troubleshooting tips, see below.

Code Description Content-Type Content
200 Successful creation of forwarder application/json View example response below
400 Bad request. The JSON body was malformed, or the configuration is invalid (misconfigured bucket or configuration value) application/json View example response below
404 Resource not found N/A N/A
500 Internal server error N/A N/A

Example

Request

POST https://defense-eap01.conferdeploy.net/event_forwarder_config/v1/orgs/ABCD1234/configs

Request Body

{
  "name":"DevRelTest",
  "s3_bucket_name":"DevRelTestBucket",
  "s3_prefix":"test",
  "type":"endpoint.event"
}

Response for valid configuration

{
  "id": "58aa259f-f42c-11e9-bd5d-2eca45f7dc1c",
  "org_key": "ABC123",
  "name": "DevRelTest",
  "enabled": true,
  "s3_bucket_name": "DevRelTestBucket",
  "s3_prefix": "test",
  "type": "endpoint.event",
  "create_time": "2019-10-21T17:58:11Z",
  "update_time": "2019-10-21T17:58:11Z"
}

Response for invalid configuration

If you receive an error indicating your configuration is invalid, either NoSuchBucket or AccessDenied, see the Troubleshooting Errors section below.

Forwarder Healthcheck

This call can be used to run a healthcheck on an Forwarder to determine if the forwarder is able to write to the specified S3 Bucket using the existing configuration. The healthcheck can indicate if the bucket is misconfigured (i.e. incorrect permissions, principle arn, etc.), if the configuration is incorrect (i.e. bucket prefix doesn’t match path specified in policy), or if the forwarder is working as expected. If successful, the healthcheck will write a test message called healthcheck.json to your S3 bucket and respond with a 200, regardless of whether the API was able to write to the bucket.

RBAC Permissions Required

Permission (.notation name) Operation(s)
event-forwarder.settings READ

Request

GET https://defense-<environment>.conferdeploy.net/event_forwarder_config/v1/orgs/{org_key}/configs/{config_id}/health_check

Response

Use the following to troubleshoot errors. For more troubleshooting tips, see below.

Code Description Content-Type Content
200 Healthcheck completed successfully application/json View example response below
404 Resource not found N/A N/A
500 Internal server error N/A N/A

Example

Request

GET
https://defense-eap01.conferdeploy.net/event_forwarder_config/v1/orgs/ABCD1234/configs/57b09141-f4e8-11e9-83de-22656feed3f2/health_check

Successful Response

Response for a successful healthcheck that was able to write to the S3 bucket using the specified configuration:

{
  "id": "57b09141-f4e8-11e9-83de-22656feed3f2",
  "enabled": true,
  "update_time": "2019-10-22T16:59:41Z",
  "status": "Valid Bucket Configuration for Bucket: DevRelTestBucket with Prefix: test",
  "error": ""
}

Successful Response with Error Status

Example response for successful healthcheck that was unable to write to the S3 bucket using the specified configuration:

{
  "id": "57b09141-f4e8-11e9-83de-22656feed3f2",
  "enabled": true,
  "update_time": "2019-10-22T16:59:41Z",
  "status": "Invalid Bucket Configuration for Bucket: IncorrectBucket with Prefix: test",
  "error": "AccessDenied"
}

If you received a NoSuchBucket error or AccessDenied error, see the Troubleshooting Errors section below for suggested fixes.

Delete Forwarder

Use this call to delete a forwarder.

RBAC Permissions Required

Permission (.notation name) Operation(s)
event-forwarder.settings DELETE

Request

DELETE https://defense-<environment>.conferdeploy.net/event_forwarder_config/v1/orgs/{org_key}/configs/{config_id}

Response

Use the following to troubleshoot errors. For more troubleshooting tips, see below.

Code Description Content-Type Content
200 Successful deletion of forwarder application/json View example response below
400 Resource not found N/A N/A
500 Internal server error N/A N/A

Example

Request

DELETE https://defense-eap01.conferdeploy.net/event_forwarder_config/v1/orgs/ABCD1234/configs/58aa259f-f42c-11e9-bd5d-2eca45f7dc1c

Response

{}

Get Configured Forwarders

Get all configured forwarders and their information

RBAC Permissions Required

Permission (.notation name) Operation(s)
event-forwarder.settings READ

Request

GET https://defense-<environment>.conferdeploy.net/event_forwarder_config/v1/orgs/{org_key}/configs

Response

Use the following to troubleshoot errors. For more troubleshooting tips, see below.

Code Description Content-Type Content
200 Successful acquiring of all configured forwarders application/json View example response below
400 Resource not found N/A N/A
500 Internal server error N/A N/A

Example

Request

GET https://defense-eap01.conferdeploy.net/event_forwarder_config/v1/orgs/ABCD1234/configs

Response

{
  "id": "57b09141-f4e8-11e9-83de-22656feed3f2",
  "org_key": "ABCD1234",
  "name": "DevRelTest",
  "enabled": true,
  "s3_bucket_name": "DevRelTestBucket",
  "s3_prefix": "test",
  "type": "endpoint.event",
  "create_time": "2019-10-22T16:23:55Z",
  "update_time": "2019-10-22T16:59:41Z"
}

Edit Forwarder

This call is used to edit an existing forwarder. You can edit the Enabling/Disabling functionality or change the s3 bucket name.

When editing an existing forwarder, the API will make additional calls to check whether the Carbon Black Cloud Event Forwarder can write to the specified S3 Bucket using the configuration supplied. It will attempt to write a test message called healthcheck.json to the specified bucket. If the bucket is misconfigured (i.e. incorrect permissions, principle arn, etc.) or the configuration is incorrect (i.e. bucket prefix doesn’t match path specified in policy or bucket does not exist), the Event Forwarder Configuration API will respond with a 400 and message including information regarding what was incorrect, providing the customer with feedback that enables them to fix issues as needed.

RBAC Permissions Required

Permission (.notation name) Operation(s)
event-forwarder.settings UPDATE

Request

PUT https://defense-<environment>.conferdeploy.net/event_forwarder_config/v1/orgs/{org_key}/configs/{config_id}

Request Body

Required fields:
Name, s3_bucket_name, s3_prefix, type

{
  "name":"<string>",
  "s3_bucket_name":"<string>",
  "s3_prefix":"<string>",
  "type":"<string>",
  "enabled": "<boolean>"
}

Body Schema

Field Description Default Required
name Defined name for the specific event forwarder N/A Yes
s3_bucket_name Configured unique name for s3 bucket N/A Yes
s3_prefix Defined folder structure the forwarder will write events to N/A Yes
type The datastream type that is to be forwarded. Supported datastream types: ‘endpoint.event’, ‘alert’ N/A Yes

Response

Use the following to troubleshoot errors. For more troubleshooting tips, see below.

Code Description Content-Type Content
200 Successful editing of forwarder application/json View example response below
400 Bad request. The JSON body was malformed, or some part of the JSON body included an invalid value application/json View example response below
404 Resource not found N/A N/A
500 Internal server error N/A N/A

Example

Request

PUT https://defense-eap01.conferdeploy.net/event_forwarder_config/v1/orgs/ABCD1234/configs/57b09141-f4e8-11e9-83de-22656feed3f2

Request Body

{
  "name":"DevRelTest",
  "s3_bucket_name":"DevRelTestBucket",
  "s3_prefix":"test",
  "type":"endpoint.event",
  "enabled": false
}

Response for valid configuration

{
  "id": "57b09141-f4e8-11e9-83de-22656feed3f2",
  "org_key": "ABCD1234",
  "name": "DevRelTest",
  "enabled": false,
  "s3_bucket_name": "DevRelTestBucket",
  "s3_prefix": "test",
  "type": "endpoint.event",
  "create_time": "2019-10-22T16:23:55Z",
  "update_time": "2019-10-22T16:26:01Z"
}

Response for invalid configuration

If you receive a response for invalid configuration, see the Troubleshooting Errors section below for suggested fixes.

Troubleshooting Errors

Error Code Reason For Error Suggested Fix
NoSuchBucket Configuration is invalid. The specified S3 bucket name doesn’t exist Follow the Quick Start Guide to create an S3 bucket for use by the CBC Event Forwarder
AccessDenied Either: Bucket was created in the wrong region OR The policy is malformed Ensure that your bucket is created in the same region as the where the Event Forwarder is deployed. Refer to the Event Forwarder and S3 Policy document for policy troubleshooting and configuration instructions
400 The reason varied depending on the API call Refer to the individual API call you are making to validate the JSON body
401 Problem using the specified token to authenticate Check that your X-Auth-Token matches the format secret_key/api_id and that the values are correct
404 This could be due to a specified resource could not be found, an incorrect org key in the path, or incorrect permissions on the API key’s access level Verify that you specified the correct values (path, org key, forwarder id, etc.) and your forwarder configuration is using the correct Authentication information

Guides & Resources

Quick Setup in Postman & S3 Bucket Configuration
Carbon Black Cloud Authentication Guide
Writing a Bucket Policy for the CBC Event Forwarder
Carbon Black Cloud Event Forwarder Data Mapping
Deconstructing the Process GUID
PSC: What URLs are used to access the APIs?

FAQ

  • Where do I go to get help?
  • Do I need a Carbon Black employee to enable Event Forwarder for me?
  • Is there a way that I can scope down the Event Forwarder’s access to my S3 resources?
    • Yes, you may configure your S3 policy in a variety of ways to ensure that the Event Forwarder only has permissions to certain resources. Please see the Event Forwarder and S3 Policy document for details
  • Is there a way to choose what types of files the Event Forwarder forwards?
    • No, only gzipped JSONL (.jsonl.gz) files are supported.
  • Is there a way to choose what specific types of events or alerts are forwarded?
    • At this time, no. Event Filtration will be supported in the future.
  • Are there other types supported besides “endpoint.event” and “alert”?
    • No, only event and alert forwarders are currently supported.
  • What does this field in my data mean?
  • I am migrating from EDR to the Carbon Black Cloud Event Forwarder. How do the data sent differ between the two?
    • Refer to the Migration Guide for information on how EDR event data map to Carbon Black Cloud Event Forwarder event data. Some Carbon Black Cloud Event Forwarder fields may be outdated and the Data Mapping document should be referenced for the most up to date information.
  • Why am I getting an error?
Last modified on May 1, 2020