|
| 1 | +# aws-wafwebacl-alb module |
| 2 | +<!--BEGIN STABILITY BANNER--> |
| 3 | + |
| 4 | +--- |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | +> All classes are under active development and subject to non-backward compatible changes or removal in any |
| 9 | +> future version. These are not subject to the [Semantic Versioning](https://semver.org/) model. |
| 10 | +> This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package. |
| 11 | +
|
| 12 | +--- |
| 13 | +<!--END STABILITY BANNER--> |
| 14 | + |
| 15 | +| **Reference Documentation**:| <span style="font-weight: normal">https://docs.aws.amazon.com/solutions/latest/constructs/</span>| |
| 16 | +|:-------------|:-------------| |
| 17 | +<div style="height:8px"></div> |
| 18 | + |
| 19 | + |
| 20 | +| **Language** | **Package** | |
| 21 | +|:-------------|-----------------| |
| 22 | +| Python|`aws_solutions_constructs.aws_wafwebacl_alb`| |
| 23 | +| Typescript|`@aws-solutions-constructs/aws-wafwebacl-alb`| |
| 24 | +| Java|`software.amazon.awsconstructs.services.wafwebaclalb`| |
| 25 | + |
| 26 | +## Overview |
| 27 | +This AWS Solutions Construct implements an AWS WAF web ACL connected to an Application Load Balancer. |
| 28 | + |
| 29 | +Here is a minimal deployable pattern definition in Typescript: |
| 30 | + |
| 31 | +``` typescript |
| 32 | +import { Route53ToAlb } from '@aws-solutions-constructs/aws-route53-alb'; |
| 33 | +import { WafwebaclToAlbProps, WafwebaclToAlb } from "@aws-solutions-constructs/aws-wafwebacl-alb"; |
| 34 | + |
| 35 | +// A constructed ALB is required to be attached to the WAF Web ACL. |
| 36 | +// In this case, we are using this construct to create one. |
| 37 | +const r53ToAlb = new Route53ToAlb(this, 'Route53ToAlbPattern', { |
| 38 | + privateHostedZoneProps: { |
| 39 | + zoneName: 'www.example.com', |
| 40 | + }, |
| 41 | + publicApi: false, |
| 42 | + logAccessLogs: false |
| 43 | +}); |
| 44 | + |
| 45 | +// This construct can only be attached to a configured Application Load Balancer. |
| 46 | +new WafwebaclToAlb(this, 'test-wafwebacl-alb', { |
| 47 | + existingLoadBalancerObj: r53ToAlb.loadBalancer |
| 48 | +}); |
| 49 | +``` |
| 50 | + |
| 51 | +## Initializer |
| 52 | + |
| 53 | +``` text |
| 54 | +new WafwebaclToAlb(scope: Construct, id: string, props: WafwebaclToAlbProps); |
| 55 | +``` |
| 56 | + |
| 57 | +_Parameters_ |
| 58 | + |
| 59 | +* scope [`Construct`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_core.Construct.html) |
| 60 | +* id `string` |
| 61 | +* props [`WafwebaclToAlbProps`](#pattern-construct-props) |
| 62 | + |
| 63 | +## Pattern Construct Props |
| 64 | + |
| 65 | +| **Name** | **Type** | **Description** | |
| 66 | +|:-------------|:----------------|-----------------| |
| 67 | +|existingLoadBalancerObj|[`elbv2.ApplicationLoadBalancer`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-elasticloadbalancingv2.ApplicationLoadBalancer.html)|The existing Application Load Balancer Object that will be protected with the WAF web ACL. *Note that a WAF web ACL can only be added to a configured Application Load Balancer, so this construct only accepts an existing ApplicationLoadBalancer and does not accept applicationLoadBalancerProps.*| |
| 68 | +|existingWebaclObj?|[`waf.CfnWebACL`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-waf.CfnWebACL.html)|Existing instance of a WAF web ACL, an error will occur if this and props is set.| |
| 69 | +|webaclProps?|[`waf.CfnWebACLProps`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-waf.CfnWebACLProps.html)|Optional user-provided props to override the default props for the AWS WAF web ACL. To use a different collection of managed rule sets, specify a new rules property. Use our [`wrapManagedRuleSet(managedGroupName: string, vendorName: string, priority: number)`](../core/lib/waf-defaults.ts) function from core to create an array entry from each desired managed rule set.| |
| 70 | + |
| 71 | +## Pattern Properties |
| 72 | + |
| 73 | +| **Name** | **Type** | **Description** | |
| 74 | +|:-------------|:----------------|-----------------| |
| 75 | +|webacl|[`waf.CfnWebACL`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-waf.CfnWebACL.html)|Returns an instance of the waf.CfnWebACL created by the construct.| |
| 76 | +|loadBalancer|[`elbv2.ApplicationLoadBalancer`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-elasticloadbalancingv2.ApplicationLoadBalancer.html)|Returns an instance of the Application Load Balancer Object created by the pattern. | |
| 77 | + |
| 78 | +## Default settings |
| 79 | + |
| 80 | +Out of the box implementation of the Construct without any override will set the following defaults: |
| 81 | + |
| 82 | +### AWS WAF |
| 83 | +* Deploy a WAF web ACL with 7 [AWS managed rule groups](https://docs.aws.amazon.com/waf/latest/developerguide/aws-managed-rule-groups-list.html). |
| 84 | + * AWSManagedRulesBotControlRuleSet |
| 85 | + * AWSManagedRulesKnownBadInputsRuleSet |
| 86 | + * AWSManagedRulesCommonRuleSet |
| 87 | + * AWSManagedRulesAnonymousIpList |
| 88 | + * AWSManagedRulesAmazonIpReputationList |
| 89 | + * AWSManagedRulesAdminProtectionRuleSet |
| 90 | + * AWSManagedRulesSQLiRuleSet |
| 91 | + |
| 92 | + *Note that the default rules can be replaced by specifying the rules property of CfnWebACLProps* |
| 93 | +* Send metrics to Amazon CloudWatch |
| 94 | + |
| 95 | +### Application Load Balancer |
| 96 | +* User provided Application Load Balancer object is used as-is |
| 97 | + |
| 98 | +## Architecture |
| 99 | + |
| 100 | + |
| 101 | +*** |
| 102 | +© Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
0 commit comments