zmoog / public-notes

Apache License 2.0
0 stars 1 forks source link

Figure out how to collect AWS Network Firewall using Amazon Data Firehose #84

Open zmoog opened 2 months ago

zmoog commented 2 months ago

Goal

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

Context

What are the AWS Network Firewall logs?

Requirements & Limitations

Preparation

Steps

zmoog commented 2 months ago

Select a resource

Use an existing AWS Network Firewall

Create a new AWS Network Firewall for testing

Open the VPC service in the AWS console

The best option to create a VPC for a quick test is to use the wizard in the AWS console.

Create a VPC and other networking resources

The default settings are fine, you only need to pick a good name for your VPC resources.

CleanShot 2024-05-02 at 13 06 52

Create an AWS Network Firewall

Set up the firewall policy

Deploy an EC2 to generate network traffic

Set up logging

To enable logging, edit your firewall setting by opening the "Logging" section.

If you want to quickly check your Network Firewall logs before setting up Firehose, you can enable logging on CloudWatch, and then inspect the log events:

CleanShot 2024-05-02 at 16 39 03

Visit CloudWatch and open your log group. If everything is working correctly, you will see something like this:

CleanShot 2024-05-02 at 16 42 47

zmoog commented 2 months ago

Create a Firehose stream

We need a Firehose stream to collect the AWS Network Firewall 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

Follow the instructions up to step 3 except for the "parameters".

Use the following parameters:

Name Value
es_datastream_name logs-aws.firewall_logs-default
zmoog commented 2 months ago

Set up logging

CleanShot 2024-05-02 at 16 53 08

zmoog commented 2 months ago

Verify

WIP

CleanShot 2024-05-02 at 17 31 27