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

Commit e9441df

Browse files
committed
Step 0, 3
1 parent 8f71331 commit e9441df

File tree

7 files changed

+60
-58
lines changed

7 files changed

+60
-58
lines changed

README.md

Lines changed: 6 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -6,65 +6,14 @@ A workshop about [AWS WAF](https://aws.amazon.com/waf/) and the [WAF Security Au
66

77
> Warning: This project is currently being developed and the code shouldn't be used in production.
88
9-
### usage
9+
# Prerequisites
1010

11-
- create a VPC, add two public subnets in two separate AZs
12-
- point an ALB at an AutoScaling Group
13-
- allow http:80 access
14-
- instantiate EC2s with a running webserver
11+
To deploy the application you will require an AWS account. If you don’t already have an AWS account, create one at <https://aws.amazon.com> by following the on-screen instructions. Your access to the AWS account must have IAM permissions to launch AWS CloudFormation templates that create IAM roles.
1512

13+
### [Step 0 - Deploy the Cloudformation Stacks](docs/step-0.md)
14+
### [Step 1 - Getting Started with AWS WAF Security Automations Solution](docs/step-1.md)
15+
### [Step 2 - Customising and extending AWS WAF Security Automations Solution](docs/step-2.md)
1616

17-
#### deploy
18-
19-
`aws s3 mb s3://$BUCKETNAME`
20-
> bucket must be created in same region as deployment
21-
22-
`aws cloudformation package --template-file main.template --s3-bucket $BUCKETNAME --s3-prefix stacks --output-template-file rootstack --force-upload`
23-
24-
`aws cloudformation deploy --template-file rootstack --stack-name WAFDEMO --capabilities CAPABILITY_IAM CAPABILITY_NAMED_IAM CAPABILITY_AUTO_EXPAND && aws cloudformation list-exports --query 'Exports[].{Name: Name, Value: Value}'`
25-
26-
`aws cloudformation delete-stack --stack-name WAFDEMO && rm rootstack.json`
27-
28-
29-
#### TODO
30-
- convert config to inst and add cfn-sig?
31-
- cloudwatch dashboards
32-
- use fargate?
33-
34-
35-
#### userdata to spin up sample web servers on **port 80**
36-
37-
*httpserver on python2.7:* no special installs nor updates required, so quick to spin up
38-
39-
```
40-
#!/bin/bash
41-
echo "<h1>Hello AWS WAF Security Automations</h1>" > index.html
42-
python -m SimpleHTTPServer 80 .
43-
```
44-
45-
*default example:* provided by US builders for waf demo
46-
```
47-
#!/bin/bash
48-
sudo yum update -y
49-
sudo yum install -y httpd
50-
sudo systemctl enable httpd
51-
sudo touch /var/www/html/index.html
52-
sudo chmod 666 /var/www/html/index.html
53-
echo "<h1>Hello AWS WAF Security Automations</h1>" > /var/www/html/index.html
54-
sudo systemctl restart httpd
55-
```
56-
57-
*juiceshop:* full fledged vulnerable site
58-
59-
```
60-
#!/bin/bash
61-
yum update -y
62-
yum install -y httpd-tools
63-
yum install -y docker
64-
service docker start
65-
docker pull bkimminich/juice-shop\ndocker run -d -p 80:3000 bkimminich/juice-shop
66-
```
67-
68-
## License
17+
# License
6918

7019
This library is licensed under the MIT-0 License. See the LICENSE file.

docs/deploy-to-aws.png

907 Bytes
Loading

docs/step-0.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Step 0 - Deploy the Cloudformation Stacks
2+
3+
To run the lab, you will need to deploy the [WAF Security Automations Solution](https://aws.amazon.com/solutions/aws-waf-security-automations/) and a sample Web App that we'll use for testing.
4+
5+
## Deploy the WAF Security Automations Solution
6+
7+
|Region|Launch Template|
8+
|------|---------------|
9+
|**US East (N. Virginia)** (us-east-1) | [![Deploy AWS WAF Security Automations Solution](docs/deploy-to-aws.png)](https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/new?stackName=AWSWAFSecurityAutomations&templateURL=https://s3.amazonaws.com/solutions-reference/aws-waf-security-automations/v2.3.0/aws-waf-security-automations.template)|
10+
|**US East (Ohio)** (us-east-2) | [![Deploy AWS WAF Security Automations Solution](docs/deploy-to-aws.png)](https://console.aws.amazon.com/cloudformation/home?region=us-east-2#/stacks/new?stackName=AWSWAFSecurityAutomations&templateURL=https://s3.amazonaws.com/solutions-reference/aws-waf-security-automations/v2.3.0/aws-waf-security-automations.template)|
11+
|**US West (Oregon)** (us-west-2) | [![Deploy AWS WAF Security Automations Solution](docs/deploy-to-aws.png)](https://console.aws.amazon.com/cloudformation/home?region=us-west-2#/stacks/new?stackName=AWSWAFSecurityAutomations&templateURL=https://s3.amazonaws.com/solutions-reference/aws-waf-security-automations/v2.3.0/aws-waf-security-automations.template)|
12+
|**EU (Ireland)** (eu-west-1) | [![Deploy AWS WAF Security Automations Solution](docs/deploy-to-aws.png)](https://console.aws.amazon.com/cloudformation/home?region=eu-west-1#/stacks/new?stackName=AWSWAFSecurityAutomations&templateURL=https://s3.amazonaws.com/solutions-reference/aws-waf-security-automations/v2.3.0/aws-waf-security-automations.template)|
13+
|**EU (London)** (eu-west-2) | [![Deploy AWS WAF Security Automations Solution](docs/deploy-to-aws.png)](https://console.aws.amazon.com/cloudformation/home?region=eu-west-2#/stacks/new?stackName=AWSWAFSecurityAutomations&templateURL=https://s3.amazonaws.com/solutions-reference/aws-waf-security-automations/v2.3.0/aws-waf-security-automations.template)|
14+
15+
Step by step instructions:
16+
* Provide your stack with a unique name. *Note: Be careful not to exceed the 64-character stack name limit*
17+
* Provide the following template parameters:
18+
* **Activate HTTP Flood Protection** = "yes - AWS Lambda log parser"
19+
* **Activate Scanner & Probe Protection** = "yes - Amazon Athena log parser"
20+
* **Endpoint Type** = "ALB"
21+
* **Application Access Log Bucket Name** (must be all lower case to match regex) = `<enter a random bucket name here>`
22+
* Leave all other parameters set to their default values.
23+
* Continue through the remaining pages using the default values.
24+
* On the final page, check the box at the bottom allowing AWS CloudFormation to create IAM resources with custom names.
25+
* Click the orange "Create stack" button at the bottom-right of the page to deploy the stack into your account.
26+
27+
## Deploy the sample Web App
28+
29+
|Region|Launch Template|
30+
|------|---------------|
31+
|**US East (N. Virginia)** (us-east-1) | [![Deploy WAF Workshop Sample Web App](docs/deploy-to-aws.png)](https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/new?stackName=WAFWorkshopSampleWebApp&templateURL=https://solution-builders-us-east-1.s3.us-east-1.amazonaws.com/aws-waf-workshop/latest/main.template)|
32+
|**US East (Ohio)** (us-east-2) | [![Deploy WAF Workshop Sample Web App](docs/deploy-to-aws.png)](https://console.aws.amazon.com/cloudformation/home?region=us-east-2#/stacks/new?stackName=WAFWorkshopSampleWebApp&templateURL=https://solution-builders-us-east-2.s3.us-east-2.amazonaws.com/aws-waf-workshop/latest/main.template)|
33+
|**US West (Oregon)** (us-west-2) | [![Deploy WAF Workshop Sample Web App](docs/deploy-to-aws.png)](https://console.aws.amazon.com/cloudformation/home?region=us-west-2#/stacks/new?stackName=WAFWorkshopSampleWebApp&templateURL=https://solution-builders-us-west-2.s3.us-west-2.amazonaws.com/aws-waf-workshop/latest/main.template)|
34+
|**EU (Ireland)** (eu-west-1) | [![Deploy WAF Workshop Sample Web App](docs/deploy-to-aws.png)](https://console.aws.amazon.com/cloudformation/home?region=eu-west-1#/stacks/new?stackName=WAFWorkshopSampleWebApp&templateURL=https://solution-builders-eu-west-1.s3.eu-west-1.amazonaws.com/aws-waf-workshop/latest/main.template)|
35+
|**EU (London)** (eu-west-2) | [![Deploy WAF Workshop Sample Web App](docs/deploy-to-aws.png)](https://console.aws.amazon.com/cloudformation/home?region=eu-west-2#/stacks/new?stackName=WAFWorkshopSampleWebApp&templateURL=https://solution-builders-eu-west-2.s3.eu-west-2.amazonaws.com/aws-waf-workshop/latest/main.template)|
36+
37+
Step by step instructions:
38+
* Provide your stack with a unique name. *Note: Be careful not to exceed the 64-character stack name limit*
39+
* Continue through the remaining pages using the default values.
40+
* On the final page, check the box at the bottom allowing AWS CloudFormation to create IAM resources with custom names.
41+
* Click the orange "Create stack" button at the bottom-right of the page to deploy the stack into your account.
42+
43+
# [Next step](step-2.md)

docs/step-1.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Step 1 - Getting Started with AWS WAF Security Automations Solution
2+
3+
# [Next step](step-2.md)

docs/step-2.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Step 2 - Customising and extending AWS WAF Security Automations Solution
2+
3+
# [Next step](step-3.md)

docs/step-3.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Step 3 - Optional Challenge - Integrate AWS WAF datapoints to AWS Security Hub
2+
3+
* [Enable AWS Security hub](https://console.aws.amazon.com/securityhub/home?region=us-east-1#/onboard)
4+
* Create an automation ([like this one](https://www.imperva.com/blog/imperva-integration-with-aws-security-hub-expanding-customer-security-visibility/)) to ingest AWS WAF Alert to AWS Security Hub. More info about AWS Security Hub custom providers [here](https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-custom-providers.html)

templates/main.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
AWSTemplateFormatVersion: '2010-09-09'
22
Description: Workshop about AWS WAF and WAF Security Automations Solution (uksb-1q1gt3g5d)
33
Metadata:
4-
Version: '0.1'
4+
Version: '0.2'
55
AWS::CloudFormation::Interface:
66
ParameterGroups:
77
- Label:

0 commit comments

Comments
 (0)