Copyright | (c) 2013-2021 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
This is AWS WAF Classic documentation. For more information, see AWS WAF Classic in the developer guide.
For the latest version of AWS WAF, use the AWS WAFV2 API and see the AWS WAF Developer Guide. With the latest version, AWS WAF has a single set of endpoints for regional and global use.
Inserts or deletes ActivatedRule objects in a WebACL
. Each Rule
identifies web requests that you want to allow, block, or count. When
you update a WebACL
, you specify the following values:
- A default action for the
WebACL
, eitherALLOW
orBLOCK
. AWS WAF performs the default action if a request doesn't match the criteria in any of theRules
in aWebACL
. - The
Rules
that you want to add or delete. If you want to replace oneRule
with another, you delete the existingRule
and add the new one. - For each
Rule
, whether you want AWS WAF to allow requests, block requests, or count requests that match the conditions in theRule
. - The order in which you want AWS WAF to evaluate the
Rules
in aWebACL
. If you add more than oneRule
to aWebACL
, AWS WAF evaluates each request against theRules
in order based on the value ofPriority
. (TheRule
that has the lowest value forPriority
is evaluated first.) When a web request matches all the predicates (such asByteMatchSets
andIPSets
) in aRule
, AWS WAF immediately takes the corresponding action, allow or block, and doesn't evaluate the request against the remainingRules
in theWebACL
, if any.
To create and configure a WebACL
, perform the following steps:
- Create and update the predicates that you want to include in
Rules
. For more information, see CreateByteMatchSet, UpdateByteMatchSet, CreateIPSet, UpdateIPSet, CreateSqlInjectionMatchSet, and UpdateSqlInjectionMatchSet. - Create and update the
Rules
that you want to include in theWebACL
. For more information, see CreateRule and UpdateRule. - Create a
WebACL
. See CreateWebACL. - Use
GetChangeToken
to get the change token that you provide in theChangeToken
parameter of an UpdateWebACL request. Submit an
UpdateWebACL
request to specify theRules
that you want to include in theWebACL
, to specify the default action, and to associate theWebACL
with a CloudFront distribution.The
ActivatedRule
can be a rule group. If you specify a rule group as yourActivatedRule
, you can exclude specific rules from that rule group.If you already have a rule group associated with a web ACL and want to submit an
UpdateWebACL
request to exclude certain rules from that rule group, you must first remove the rule group from the web ACL, the re-insert it again, specifying the excluded rules. For details, see ActivatedRule$ExcludedRules .
Be aware that if you try to add a RATE_BASED rule to a web ACL without setting the rule type when first creating the rule, the UpdateWebACL request will fail because the request tries to add a REGULAR rule (the default rule type) with the specified ID, which does not exist.
For more information about how to use the AWS WAF API to allow or block HTTP requests, see the AWS WAF Developer Guide.
Synopsis
- data UpdateWebACL = UpdateWebACL' {
- updates :: Maybe [WebACLUpdate]
- defaultAction :: Maybe WafAction
- webACLId :: Text
- changeToken :: Text
- newUpdateWebACL :: Text -> Text -> UpdateWebACL
- updateWebACL_updates :: Lens' UpdateWebACL (Maybe [WebACLUpdate])
- updateWebACL_defaultAction :: Lens' UpdateWebACL (Maybe WafAction)
- updateWebACL_webACLId :: Lens' UpdateWebACL Text
- updateWebACL_changeToken :: Lens' UpdateWebACL Text
- data UpdateWebACLResponse = UpdateWebACLResponse' {
- changeToken :: Maybe Text
- httpStatus :: Int
- newUpdateWebACLResponse :: Int -> UpdateWebACLResponse
- updateWebACLResponse_changeToken :: Lens' UpdateWebACLResponse (Maybe Text)
- updateWebACLResponse_httpStatus :: Lens' UpdateWebACLResponse Int
Creating a Request
data UpdateWebACL Source #
See: newUpdateWebACL
smart constructor.
UpdateWebACL' | |
|
Instances
Create a value of UpdateWebACL
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:updates:UpdateWebACL'
, updateWebACL_updates
- An array of updates to make to the WebACL.
An array of WebACLUpdate
objects that you want to insert into or
delete from a WebACL. For more information, see the applicable data
types:
- WebACLUpdate: Contains
Action
andActivatedRule
- ActivatedRule: Contains
Action
,OverrideAction
,Priority
,RuleId
, andType
.ActivatedRule|OverrideAction
applies only when updating or adding aRuleGroup
to aWebACL
. In this case, you do not useActivatedRule|Action
. For all other update requests,ActivatedRule|Action
is used instead ofActivatedRule|OverrideAction
. - WafAction: Contains
Type
$sel:defaultAction:UpdateWebACL'
, updateWebACL_defaultAction
- A default action for the web ACL, either ALLOW or BLOCK. AWS WAF
performs the default action if a request doesn't match the criteria in
any of the rules in a web ACL.
$sel:webACLId:UpdateWebACL'
, updateWebACL_webACLId
- The WebACLId
of the WebACL that you want to update. WebACLId
is
returned by CreateWebACL and by ListWebACLs.
$sel:changeToken:UpdateWebACL'
, updateWebACL_changeToken
- The value returned by the most recent call to GetChangeToken.
Request Lenses
updateWebACL_updates :: Lens' UpdateWebACL (Maybe [WebACLUpdate]) Source #
An array of updates to make to the WebACL.
An array of WebACLUpdate
objects that you want to insert into or
delete from a WebACL. For more information, see the applicable data
types:
- WebACLUpdate: Contains
Action
andActivatedRule
- ActivatedRule: Contains
Action
,OverrideAction
,Priority
,RuleId
, andType
.ActivatedRule|OverrideAction
applies only when updating or adding aRuleGroup
to aWebACL
. In this case, you do not useActivatedRule|Action
. For all other update requests,ActivatedRule|Action
is used instead ofActivatedRule|OverrideAction
. - WafAction: Contains
Type
updateWebACL_defaultAction :: Lens' UpdateWebACL (Maybe WafAction) Source #
A default action for the web ACL, either ALLOW or BLOCK. AWS WAF performs the default action if a request doesn't match the criteria in any of the rules in a web ACL.
updateWebACL_webACLId :: Lens' UpdateWebACL Text Source #
The WebACLId
of the WebACL that you want to update. WebACLId
is
returned by CreateWebACL and by ListWebACLs.
updateWebACL_changeToken :: Lens' UpdateWebACL Text Source #
The value returned by the most recent call to GetChangeToken.
Destructuring the Response
data UpdateWebACLResponse Source #
See: newUpdateWebACLResponse
smart constructor.
UpdateWebACLResponse' | |
|
Instances
newUpdateWebACLResponse Source #
Create a value of UpdateWebACLResponse
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:changeToken:UpdateWebACL'
, updateWebACLResponse_changeToken
- The ChangeToken
that you used to submit the UpdateWebACL
request.
You can also use this value to query the status of the request. For more
information, see GetChangeTokenStatus.
$sel:httpStatus:UpdateWebACLResponse'
, updateWebACLResponse_httpStatus
- The response's http status code.
Response Lenses
updateWebACLResponse_changeToken :: Lens' UpdateWebACLResponse (Maybe Text) Source #
The ChangeToken
that you used to submit the UpdateWebACL
request.
You can also use this value to query the status of the request. For more
information, see GetChangeTokenStatus.
updateWebACLResponse_httpStatus :: Lens' UpdateWebACLResponse Int Source #
The response's http status code.