Skip to main content

CollectorsCloud Collectors Administration Guide

Configure the AWS CloudWatch Cloud Collector

Set up the AWS CloudWatch Cloud Collector to continuously ingest events from the data sources CloudTrail, CloudWatch Logs, and Lambda logs of AWS services.

The configuration workflow includes the following tasks.

Configure the AWS CloudWatch Cloud Collector

  1. Before you configure the AWS CloudWatch Cloud Collector, ensure that you complete the prerequisites.

  2. Log in to the Exabeam Security Operations Platform with your registered credentials as an administrator.

  3. Navigate to Collectors > Cloud Collectors.

  4. Click New Collector.

    AWS_CloudWatch.png
  5. Click AWS CloudWatch.

  6. Enter the following information for the cloud collector.

    AWS_CloudWatch_1.png
    • NAME – Specify a name for the Cloud Collector instance.

    • Format – Displays JSON format in which the logs are collected from AWS Firehose.

  7. (Optional) SITE – Select an existing site or to create a new site with a unique ID, click manage your sites. Adding a site name helps you to ensure efficient management of environments with overlapping IP addresses.

    By entering a site name, you associate the logs with a specific independent site. A sitename metadata field is automatically added to all the events that are going to be ingested via this collector. For more information about Site Management, see Define a Unique Site Name.

  8. (Optional) TIMEZONE – Select a time zone applicable to you for accurate detections and event monitoring.

    By entering a time zone, you override the default log time zone. A timezone metadata field is automatically added to all events ingested through this collector.

    Timezone_sitename_site_management_1.png
  9. Click Install.

    AWS_CloudWatch2.png

    A confirmation message informs you that the new Cloud Collector is created. Record the authentication token to use it while creating Amazon Data Firehose. Ensure that you record the token immediately after configuration because this token cannot be retrieved later.

    The confirmation message window also displays the endpoint /firehose to which logs are sent. Record the link to use it while creating an Amazon Data Firehose.

Create a Firehose Stream

To stream all the CloudWatch logs to Amazon Data Firehose, create a Firehose stream on Amazon Data Firehose console using the following steps.

  1. On Amazon Data Firehose console, click Create Firehose stream.

    Create_Firehose1.png
  2. Select the Source as Direct PUT and the Destination as HTTP Endpoint.

    Create_Firehose2.png
  3. Specify a name for the Firehose stream.

  4. In the Destination settings section, paste the HTTP endpoint URL that you obtained after configuring the AWS CloudWatch Cloud Collector.

    Create_Firehose3.png
  5. In the Access key box, paste the token that you obtained while configuring the collector.

    Create_Firehose4.png
  6. Retain the default settings for Content encoding. By default, CloudWatch sends logs to Data Firehose in GZIP compressed format.

  7. In the Retry duration specify the duration in which Firehose retries to send data to the selected endpoint in case of failure in reaching the endpoint. After the specified time interval, if the error persists, the Destination Error Logs section in Firehose shows the error details.

    Create_Firehose5.png
  8. In Buffer hints section, specify the buffer size for the data to be collected and specify the buffer interval in seconds until which Firehose waits for data collection from CloudWatch.

    Create_Firehose6.png
  9. In the Backup settings section, specify if you want to push only failed data or all the data to the S3 bucket. It is recommended that you select Failed data only to send the data that failed to reach the HTTP endpoint from the firehose to the S3 bucket.

    Create_Firehose7.png
  10. In S3 backup bucket, browse to the folder where your S3 bucket is configured, in which you want to back up the data.

  11. Retain the other default settings and click Create Firehose stream.

    For more information, see Create a Firehose stream in the AWS documentation.

    The Firehose stream is created. Click the firehose that you created to view details.

    Create_Firehose8.png

    Proceed to create a CloudWatch Log group.

Configure CloudWatch Logs to Send Data to Firehose

To configure the CloudWatch logs to send data to the Amazon Data Firehose, use the following steps.

  1. Create an IAM role named CWLtoFirehoseRole that grants CloudWatch Logs permission to stream data into your AWS Data Firehose delivery stream.

    1. On the AWS console, navigate to IAM service and click Policies.

    2. Create a new policy.

    3. Select the policy editor as JSON and paste the following policy details.

      {
          "Version": "2012-10-17",
          "Statement": [
              {
                  "Sid": "Statement1",
                  "Effect": "Allow",
                  "Action": [
                      "firehose:PutRecord",
                      "firehose:PutRecordBatch"
                  ],
                  "Resource": [
                      "arn:aws:firehose:<REGION>:<ACCOUNT_NO>:deliverystream/<FIREHOSE_DELIVERY_STREAM_NAME>"
                  ]
              }
          ]
      }
    4. Replace <REGION> with AWS region, <ACCOUNT_NO> with 12 digit account number without any dashes and <FIREHOSE_DELIVERY_STREAM_NAME> with your firehose data delivery stream name.

    5. Specify a name for your policy such as PermissionsForCWL and click Create policy.

  2. To create a role using a custom trust policy, on the AWS Management Console, navigate to Roles.

  3. Select Create role.

  4. Select the Custom trust policy role type and paste the following policy details. For more information, see Creating an IAM role and Creating IAM policies in the AWS documentation.

    {
        "Version": "2012-10-17",
        "Statement": [
            {
                "Sid": "Statement1",
                "Effect": "Allow",
                "Principal": {
                    "Service": "logs.<REGION>.amazonaws.com"
                },
                "Action": "sts:AssumeRole"
            }
        ]
    }
  5. In the Add permission policies section select the name of the policy that you created such as PermissionsForCWL.

  6. Review the policy details and in the Role Name section specify a name: CWLtoFirehoseRole.

  7. Click Create Role.

    Use this role while creating a Subscription Filter.

Create a Log Group and Subscription Filter

To set up the CloudWatch Log group use the following steps.

  1. On Amazon CloudWatch console, navigate to Log groups and click Create log group.

    Create_log_group_1.png

    Note

    You can use existing log groups and add a subscription filter for each of the log groups. Although you can create and use multiple log groups and create subscription filters for each of them, it is recommended to create only one Data Firehose Subscription Filter per log group. Using multiple subscription filters may lead to data duplication.

  2. In the Log group details section, specify a name for the log group, and enter the required details.

    Create_log_group_2.png
  3. Click Create.

    The log group that you created is listed in the Log groups section. You can monitor the logs generated via Lambda or CloudWatch listed in the log group. For more information, see Working with log groups and log streams in the AWS documentation.

Set up Subscription Filters

After you create the log group, you must set up subscription filters. Use the following steps to create the subscription filter.

  1. After creating a log group, in the Log group details section, navigate to the Subscription filters tab.

    Create_log_group_3_subscription_filters.png
  2. Click Create Amazon Data Firehose subscription filter.

  3. In the Choose destination section, select the Amazon Data Firehose stream that you created in CloudWatch.

    subscription_filters_1.png
  4. In the Grant permission section, you can select the appropriate IAM role. For example: CWLtoFirehoseRole

  5. In the Configure log format and filters section, select the Log format as Other to stream all the logs from CloudWatch to Data Firehose irrespective of their format. You can select other log formats based on your requirements to narrow down the log volume.

    subscription_filters_2.png
  6. Specify a name for the subscription filter.

  7. Click Test pattern to verify if the logs are getting streamed and click Start streaming.

    The subscription filter is created.

Use this workflow to effectively stream CloudWatch Logs to AWS CloudWatch via AWS Data Firehose using the AWS Management Console.