Skip to content
This repository was archived by the owner on May 29, 2024. It is now read-only.

Commit 22768fd

Browse files
authored
Merge pull request #15 from aws-samples/ckp/update-step-2
Ckp/update step 2
2 parents f9cb771 + d5d5434 commit 22768fd

File tree

1 file changed

+22
-8
lines changed

1 file changed

+22
-8
lines changed

docs/step-2.md

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
11
# Step 2 - Customising and extending AWS WAF Security Automations Solution
22

3+
In this step, you will configure the WAF Security Automation Solution. Once you have configured the HTTP Flood Protection and Probe/Scanner Log Parser, you will test this new configuration.
34

45
## 2.1.1 Customise HTTP Flood Protection (AWS Lambda Log Parser)
56

7+
The HTTP Flood protection provided by the Security Automation Solution can be configured. In this step, you will explore the possible configuration options. [See the documentation](https://docs.aws.amazon.com/solutions/latest/aws-waf-security-automations/appendix-c.html) for a complete list
8+
9+
610
The HTTP Flood log parser comes with some extensions points, they are:
711

812
* Request Threshold: the maximum acceptable requests per five minutes per IP address.
913
* Block Period: the period (in minutes) to block applicable IP addresses.
1014
* Ignored Suffixes: requests accessing this type of resource will not count to request threshold. By default, this list is empty.
1115
* URI List: use this to define a custom request threshold and block period for specifics URLs. By default, this list is empty.
1216

13-
The goal now is to apply customizations and check how it affects the log parser behavior.
17+
The goal now is to apply customisations and check how it affects the log parser behavior.
18+
1419

20+
### 2.1.2 Customising the HTTP Log Parser
1521

16-
### 2.1.2 Customising the Parser
22+
In this step you will edit the configuration file for the HTTP Log parser. This configuration is used by the Lambda Log Parser when processing log files.
1723

1824
* Go to the S3 bucket used for WAF Logs Bucket. To check it's name, go to stack's Outputs tab and search for the value defined for WafLogBucket;
1925
* Download the configuration file `<stack_name>-waf_log_conf.json`;
@@ -39,11 +45,17 @@ Here is a sample of changed file:
3945
```
4046

4147
### 2.1.3 Testing the new rules
42-
Let's test your HTTP flood protection. We will use [Apache AB](https://httpd.apache.org/docs/2.4/programs/ab.html).
4348

44-
> ⚠️ **Warning**: Do not run the benchmarking tool from your local machine!
49+
To test the HTTP Flood protection you customised earlier in this step, you will generate a large number of requests. The Flood Protection should add the source IP of the requests to a deny list.
4550

46-
We will use [Systems Manager Session Manager](https://console.aws.amazon.com/systems-manager/session-manager/start-session) to connect to the instance and run the `ab` benchmarking tool.
51+
We will use [Apache AB](https://httpd.apache.org/docs/2.4/programs/ab.html).
52+
Apache AB is a tool for benchmarking a web server. You will use it to generate a specified number of HTTP requests against your sample Application
53+
54+
> ⚠️ **Warning**: Do not run the benchmarking tool from your local machine! \
55+
> Doing so will generate a large amount of traffic on your local network. \
56+
> Use the EC2 instance of the Sample Web App to perform the requests against the external endpoint.
57+
58+
You will use [Systems Manager Session Manager](https://console.aws.amazon.com/systems-manager/session-manager/start-session) to connect to the instance and run the `ab` benchmarking tool. Apache AB is pre-installed on the instance.
4759

4860
Run against your endpoint 50,000 requests, with concurrency 100.
4961
```bash
@@ -62,12 +74,14 @@ curl -s -o /dev/null -w "Return Code: %{http_code}\n" <your-endpoint>
6274

6375

6476

65-
Now we will customise our Scanner and Probe rules. These use Amazon Athena.
66-
The solutions refer to the Athena by a saved query ID. As Athena don't allow you to change saved queries, the process to apply customizations to Athena query is by creating a new query and updating the Athena log parser event to use the new query ID.
77+
Now you will customise our Scanner and Probe rules. These use Amazon Athena to query the logs generated by an application.
78+
The solutions refer to Athena by a saved query ID. As Athena doesn't allow you to change saved queries, you need to create a new query and update the Athena log parser event to use the new query ID.
79+
80+
By customising the query performed by Athena, you can specify the rules for blocking scanners and probes. For further details, [see the documentation](https://docs.aws.amazon.com/solutions/latest/aws-waf-security-automations/appendix-d.html)
6781

6882
### 2.2.1
6983
* Navigate to the Amazon Athena console, select the Saved Queries tab;
70-
* Select the query you want to customize (ScannersProbesLogParser);
84+
* Select the query you want to customise (ScannersProbesLogParser);
7185

7286
![athena-saved-queries](2-01-athena-saved-queries.png)
7387

0 commit comments

Comments
 (0)