Actions, resources, and condition keys for AWS WAF
AWS WAF (service prefix: waf
) provides the following service-specific resources, actions, and condition context keys for use in IAM permission policies.
References:
-
Learn how to configure this service.
-
View a list of the API operations available for this service.
-
Learn how to secure this service and its resources by using IAM permission policies.
Actions defined by AWS WAF
You can specify the following actions in the Action
element of an IAM policy statement. Use policies to grant permissions to perform an operation in AWS. When you use an action in a policy, you usually allow or deny access to the API operation or CLI command with the same name. However, in some cases, a single action controls access to more than one operation. Alternatively, some operations require several different actions.
The Resource types column of the Actions table indicates whether each action supports resource-level permissions. If there is no value for this column, you must specify all resources ("*") to which the policy applies in the Resource
element of your policy statement. If the column includes a resource type, then you can specify an ARN of that type in a statement with that action. If the action has one or more required resources, the caller must have permission to use the action with those resources. Required resources are indicated in the table with an asterisk (*). If you limit resource access with the Resource
element in an IAM policy, you must include an ARN or pattern for each required resource type. Some actions support multiple resource types. If the resource type is optional (not indicated as required), then you can choose to use one of the optional resource types.
The Condition keys column of the Actions table includes keys that you can specify in a policy statement's Condition
element. For more information on the condition keys that are associated with resources for the service, see the Condition keys column of the Resource types table.
Note
Resource condition keys are listed in the Resource types table. You can find a link to the resource type that applies to an action in the Resource types (*required) column of the Actions table. The resource type in the Resource types table includes the Condition keys column, which are the resource condition keys that apply to an action in the Actions table.
For details about the columns in the following table, see Actions table.
Actions | Description | Access level | Resource types (*required) | Condition keys | Dependent actions |
---|---|---|---|---|---|
CreateByteMatchSet | Grants permission to create a ByteMatchSet | Write | |||
CreateGeoMatchSet | Grants permission to create a GeoMatchSet | Write | |||
CreateIPSet | Grants permission to create an IPSet | Write | |||
CreateRateBasedRule | Grants permission to create a RateBasedRule for limiting the volume of requests from a single IP address | Write | |||
CreateRegexMatchSet | Grants permission to create a RegexMatchSet | Write | |||
CreateRegexPatternSet | Grants permission to create a RegexPatternSet | Write | |||
CreateRule | Grants permission to create a Rule for filtering web requests | Write | |||
CreateRuleGroup | Grants permission to create a RuleGroup, which is a collection of predefined rules that you can use in a WebACL | Write | |||
CreateSizeConstraintSet | Grants permission to create a SizeConstraintSet | Write | |||
CreateSqlInjectionMatchSet | Grants permission to create an SqlInjectionMatchSet | Write | |||
CreateWebACL | Grants permission to create a WebACL, which contains rules for filtering web requests | Permissions management | |||
CreateWebACLMigrationStack | Grants permission to create a CloudFormation web ACL template in an S3 bucket for the purposes of migrating the web ACL from AWS WAF Classic to AWS WAF v2 | Write |
s3:PutObject |
||
CreateXssMatchSet | Grants permission to create an XssMatchSet, which you use to detect requests that contain cross-site scripting attacks | Write | |||
DeleteByteMatchSet | Grants permission to delete a ByteMatchSet | Write | |||
DeleteGeoMatchSet | Grants permission to delete a GeoMatchSet | Write | |||
DeleteIPSet | Grants permission to delete an IPSet | Write | |||
DeleteLoggingConfiguration | Grants permission to delete the LoggingConfiguration from a web ACL | Write | |||
DeletePermissionPolicy | Grants permission to delete an IAM policy from a rule group | Permissions management | |||
DeleteRateBasedRule | Grants permission to delete a RateBasedRule | Write | |||
DeleteRegexMatchSet | Grants permission to delete a RegexMatchSet | Write | |||
DeleteRegexPatternSet | Grants permission to delete a RegexPatternSet | Write | |||
DeleteRule | Grants permission to delete a Rule | Write | |||
DeleteRuleGroup | Grants permission to delete a RuleGroup | Write | |||
DeleteSizeConstraintSet | Grants permission to delete a SizeConstraintSet | Write | |||
DeleteSqlInjectionMatchSet | Grants permission to delete an SqlInjectionMatchSet | Write | |||
DeleteWebACL | Grants permission to delete a WebACL | Permissions management | |||
DeleteXssMatchSet | Grants permission to delete an XssMatchSet | Write | |||
GetByteMatchSet | Grants permission to retrieve a ByteMatchSet | Read | |||
GetChangeToken | Grants permission to retrieve a change token to use in create, update, and delete requests | Read | |||
GetChangeTokenStatus | Grants permission to retrieve the status of a change token | Read | |||
GetGeoMatchSet | Grants permission to retrieve a GeoMatchSet | Read | |||
GetIPSet | Grants permission to retrieve an IPSet | Read | |||
GetLoggingConfiguration | Grants permission to retrieve a LoggingConfiguration for a web ACL | Read | |||
GetPermissionPolicy | Grants permission to retrieve an IAM policy for a rule group | Read | |||
GetRateBasedRule | Grants permission to retrieve a RateBasedRule | Read | |||
GetRateBasedRuleManagedKeys | Grants permission to retrieve the array of IP addresses that are currently being blocked by a RateBasedRule | Read | |||
GetRegexMatchSet | Grants permission to retrieve a RegexMatchSet | Read | |||
GetRegexPatternSet | Grants permission to retrieve a RegexPatternSet | Read | |||
GetRule | Grants permission to retrieve a Rule | Read | |||
GetRuleGroup | Grants permission to retrieve a RuleGroup | Read | |||
GetSampledRequests | Grants permission to retrieve detailed information about a sample set of web requests | Read | |||
GetSizeConstraintSet | Grants permission to retrieve a SizeConstraintSet | Read | |||
GetSqlInjectionMatchSet | Grants permission to retrieve an SqlInjectionMatchSet | Read | |||
GetWebACL | Grants permission to retrieve a WebACL | Read | |||
GetXssMatchSet | Grants permission to retrieve an XssMatchSet | Read | |||
ListActivatedRulesInRuleGroup | Grants permission to retrieve an array of ActivatedRule objects | List | |||
ListByteMatchSets | Grants permission to retrieve an array of ByteMatchSetSummary objects | List | |||
ListGeoMatchSets | Grants permission to retrieve an array of GeoMatchSetSummary objects | List | |||
ListIPSets | Grants permission to retrieve an array of IPSetSummary objects | List | |||
ListLoggingConfigurations | Grants permission to retrieve an array of LoggingConfiguration objects | List | |||
ListRateBasedRules | Grants permission to retrieve an array of RuleSummary objects | List | |||
ListRegexMatchSets | Grants permission to retrieve an array of RegexMatchSetSummary objects | List | |||
ListRegexPatternSets | Grants permission to retrieve an array of RegexPatternSetSummary objects | List | |||
ListRuleGroups | Grants permission to retrieve an array of RuleGroup objects | List | |||
ListRules | Grants permission to retrieve an array of RuleSummary objects | List | |||
ListSizeConstraintSets | Grants permission to retrieve an array of SizeConstraintSetSummary objects | List | |||
ListSqlInjectionMatchSets | Grants permission to retrieve an array of SqlInjectionMatchSet objects | List | |||
ListSubscribedRuleGroups | Grants permission to retrieve an array of RuleGroup objects that you are subscribed to | List | |||
ListTagsForResource | Grants permission to retrieve the tags for a resource | Read | |||
ListWebACLs | Grants permission to retrieve an array of WebACLSummary objects | List | |||
ListXssMatchSets | Grants permission to retrieve an array of XssMatchSet objects | List | |||
PutLoggingConfiguration | Grants permission to associate a LoggingConfiguration with a specified web ACL | Write |
iam:CreateServiceLinkedRole |
||
PutPermissionPolicy | Grants permission to attach an IAM policy to a rule group, to share the rule group between accounts | Permissions management | |||
TagResource | Grants permission to add a Tag to a resource | Tagging | |||
UntagResource | Grants permission to remove a Tag from a resource | Tagging | |||
UpdateByteMatchSet | Grants permission to insert or delete ByteMatchTuple objects in a ByteMatchSet | Write | |||
UpdateGeoMatchSet | Grants permission to insert or delete GeoMatchConstraint objects in a GeoMatchSet | Write | |||
UpdateIPSet | Grants permission to insert or delete IPSetDescriptor objects in an IPSet | Write | |||
UpdateRateBasedRule | Grants permission to modify a rate based rule | Write | |||
UpdateRegexMatchSet | Grants permission to insert or delete RegexMatchTuple objects in a RegexMatchSet | Write | |||
UpdateRegexPatternSet | Grants permission to insert or delete RegexPatternStrings in a RegexPatternSet | Write | |||
UpdateRule | Grants permission to modify a Rule | Write | |||
UpdateRuleGroup | Grants permission to insert or delete ActivatedRule objects in a RuleGroup | Write | |||
UpdateSizeConstraintSet | Grants permission to insert or delete SizeConstraint objects in a SizeConstraintSet | Write | |||
UpdateSqlInjectionMatchSet | Grants permission to insert or delete SqlInjectionMatchTuple objects in an SqlInjectionMatchSet | Write | |||
UpdateWebACL | Grants permission to insert or delete ActivatedRule objects in a WebACL | Permissions management | |||
UpdateXssMatchSet | Grants permission to insert or delete XssMatchTuple objects in an XssMatchSet | Write |
Resource types defined by AWS WAF
The following resource types are defined by this service and can be used in the Resource
element of IAM permission policy statements. Each action in the Actions table identifies the resource types that can be specified with that action. A resource type can also define which condition keys you can include in a policy. These keys are displayed in the last column of the Resource types table. For details about the columns in the following table, see Resource types table.
Resource types | ARN | Condition keys |
---|---|---|
bytematchset |
arn:${Partition}:waf::${Account}:bytematchset/${Id}
|
|
ipset |
arn:${Partition}:waf::${Account}:ipset/${Id}
|
|
ratebasedrule |
arn:${Partition}:waf::${Account}:ratebasedrule/${Id}
|
|
rule |
arn:${Partition}:waf::${Account}:rule/${Id}
|
|
sizeconstraintset |
arn:${Partition}:waf::${Account}:sizeconstraintset/${Id}
|
|
sqlinjectionmatchset |
arn:${Partition}:waf::${Account}:sqlinjectionset/${Id}
|
|
webacl |
arn:${Partition}:waf::${Account}:webacl/${Id}
|
|
xssmatchset |
arn:${Partition}:waf::${Account}:xssmatchset/${Id}
|
|
regexmatchset |
arn:${Partition}:waf::${Account}:regexmatch/${Id}
|
|
regexpatternset |
arn:${Partition}:waf::${Account}:regexpatternset/${Id}
|
|
geomatchset |
arn:${Partition}:waf::${Account}:geomatchset/${Id}
|
|
rulegroup |
arn:${Partition}:waf::${Account}:rulegroup/${Id}
|
Condition keys for AWS WAF
AWS WAF defines the following condition keys that can be used in the Condition
element of an IAM policy. You can use these keys to further refine the conditions under which the policy statement applies. For details about the columns in the following table, see Condition keys table.
To view the global condition keys that are available to all services, see Available global condition keys.
Condition keys | Description | Type |
---|---|---|
aws:RequestTag/${TagKey} | Filters actions based on the allowed set of values for each of the tags | String |
aws:ResourceTag/${TagKey} | Filters actions based on tag-value associated with the resource | String |
aws:TagKeys | Filters actions based on the presence of mandatory tags in the request | ArrayOfString |