[ aws . waf-regional ]




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 XssMatchTuple objects (filters) in an XssMatchSet . For each XssMatchTuple object, you specify the following values:

  • Action : Whether to insert the object into or delete the object from the array. To change an XssMatchTuple , you delete the existing object and add a new one.

  • FieldToMatch : The part of web requests that you want AWS WAF to inspect and, if you want AWS WAF to inspect a header or custom query parameter, the name of the header or parameter.

  • TextTransformation : Which text transformation, if any, to perform on the web request before inspecting the request for cross-site scripting attacks. You can only specify a single type of TextTransformation.

You use XssMatchSet objects to specify which CloudFront requests that you want to allow, block, or count. For example, if you’re receiving requests that contain cross-site scripting attacks in the request body and you want to block the requests, you can create an XssMatchSet with the applicable settings, and then configure AWS WAF to block the requests.

To create and configure an XssMatchSet , perform the following steps:

  • Submit a CreateXssMatchSet request.

  • Use GetChangeToken to get the change token that you provide in the ChangeToken parameter of an UpdateIPSet request.

  • Submit an UpdateXssMatchSet request to specify the parts of web requests that you want AWS WAF to inspect for cross-site scripting attacks.

For more information about how to use the AWS WAF API to allow or block HTTP requests, see the AWS WAF Developer Guide .

See also: AWS API Documentation

See ‘aws help’ for descriptions of global parameters.


--xss-match-set-id <value>
--change-token <value>
--updates <value>
[--cli-input-json | --cli-input-yaml]
[--generate-cli-skeleton <value>]
[--cli-auto-prompt <value>]


--xss-match-set-id (string)

The XssMatchSetId of the XssMatchSet that you want to update. XssMatchSetId is returned by CreateXssMatchSet and by ListXssMatchSets .

--change-token (string)

The value returned by the most recent call to GetChangeToken .

--updates (list)

An array of XssMatchSetUpdate objects that you want to insert into or delete from an XssMatchSet . For more information, see the applicable data types:

  • XssMatchSetUpdate : Contains Action and XssMatchTuple

  • XssMatchTuple : Contains FieldToMatch and TextTransformation

  • FieldToMatch : Contains Data and Type

Shorthand Syntax:

Action=string,XssMatchTuple={FieldToMatch={Type=string,Data=string},TextTransformation=string} ...

JSON Syntax:

    "Action": "INSERT"|"DELETE",
    "XssMatchTuple": {
      "FieldToMatch": {
        "Data": "string"

--cli-input-json | --cli-input-yaml (string) Reads arguments from the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, those values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally. This may not be specified along with --cli-input-yaml.

--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. Similarly, if provided yaml-input it will print a sample input YAML that can be used with --cli-input-yaml. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command.

--cli-auto-prompt (boolean) Automatically prompt for CLI input parameters.

See ‘aws help’ for descriptions of global parameters.


To update an XSSMatchSet

The following update-xss-match-set command deletes an XssMatchTuple object (filters) in an XssMatchSet. Because the updates value contains embedded double quotes, you must surround the entire value with single quotes.

aws waf-regional update-xss-match-set \
    --xss-match-set-id a123fae4-b567-8e90-1234-5ab67ac8ca90 \
    --change-token 12cs345-67cd-890b-1cd2-c3a4567d89f1 \
    --updates 'Action="DELETE",XssMatchTuple={FieldToMatch={Type="QUERY_STRING"},TextTransformation="URL_DECODE"}'

For more information, see Working with Cross-site Scripting Match Conditions in the AWS WAF Developer Guide .


ChangeToken -> (string)

The ChangeToken that you used to submit the UpdateXssMatchSet request. You can also use this value to query the status of the request. For more information, see GetChangeTokenStatus .