zmoog / public-notes

Apache License 2.0
0 stars 1 forks source link

Figure out how to collect AWS VPC Flow logs using Amazon Data Firehose #89

Open zmoog opened 5 months ago

zmoog commented 5 months ago

Goal

Suppose I own an AWS account, and I want to export AWS VPC Flow log events from AWS to an Elastic cluster.

Context

What are the VPC Flow logs?

Requirements & Limitations

Preparation

Steps

Overview

image

Resources

zmoog commented 3 months ago

Create a Firehose stream

We need a Firehose stream to collect the VPC Flow logs and send them to a data stream on an Elastic stack.

To create a Firehose stream, you can use the instructions at Monitor Amazon Web Services (AWS) with Amazon Data Firehose up to step 3.

However, you must set two things differently.

Name

Pick a name for your Firehose stream.

Parameters

Use the following parameters:

Name Value
es_datastream_name logs-aws.vpcflow-default

If you're publishing flow logs to a different account, create the required IAM roles, as described in IAM roles for cross account delivery.

zmoog commented 3 months ago

Create a flow log that publishes to Amazon Data Firehose

CleanShot 2024-07-24 at 01 38 53@2x

zmoog commented 3 months ago

Verify

Now, the network interface / VPC / subnet you set up is sending the VPC flow logs to the Firehose data stream, which is forwarding them to the Elasticsearch cluster.

Here are the VPC flow logs in the logs-aws.vpcflow-default data stream using Discover and Log Explorer:

image

CleanShot 2024-07-24 at 02 01 31@2x