WAFV2 / Client / describe_managed_rule_group

describe_managed_rule_group#

WAFV2.Client.describe_managed_rule_group(**kwargs)#

Provides high-level information for a managed rule group, including descriptions of the rules.

See also: AWS API Documentation

Request Syntax

response = client.describe_managed_rule_group(
    VendorName='string',
    Name='string',
    Scope='CLOUDFRONT'|'REGIONAL',
    VersionName='string'
)
Parameters:
  • VendorName (string) –

    [REQUIRED]

    The name of the managed rule group vendor. You use this, along with the rule group name, to identify a rule group.

  • Name (string) –

    [REQUIRED]

    The name of the managed rule group. You use this, along with the vendor name, to identify the rule group.

  • Scope (string) –

    [REQUIRED]

    Specifies whether this is for an Amazon CloudFront distribution or for a regional application. A regional application can be an Application Load Balancer (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, an Amazon Cognito user pool, an App Runner service, or an Amazon Web Services Verified Access instance.

    To work with CloudFront, you must also specify the Region US East (N. Virginia) as follows:

    • CLI - Specify the Region when you use the CloudFront scope: --scope=CLOUDFRONT --region=us-east-1.

    • API and SDKs - For all calls, use the Region endpoint us-east-1.

  • VersionName (string) – The version of the rule group. You can only use a version that is not scheduled for expiration. If you don’t provide this, WAF uses the vendor’s default version.

Return type:

dict

Returns:

Response Syntax

{
    'VersionName': 'string',
    'SnsTopicArn': 'string',
    'Capacity': 123,
    'Rules': [
        {
            'Name': 'string',
            'Action': {
                'Block': {
                    'CustomResponse': {
                        'ResponseCode': 123,
                        'CustomResponseBodyKey': 'string',
                        'ResponseHeaders': [
                            {
                                'Name': 'string',
                                'Value': 'string'
                            },
                        ]
                    }
                },
                'Allow': {
                    'CustomRequestHandling': {
                        'InsertHeaders': [
                            {
                                'Name': 'string',
                                'Value': 'string'
                            },
                        ]
                    }
                },
                'Count': {
                    'CustomRequestHandling': {
                        'InsertHeaders': [
                            {
                                'Name': 'string',
                                'Value': 'string'
                            },
                        ]
                    }
                },
                'Captcha': {
                    'CustomRequestHandling': {
                        'InsertHeaders': [
                            {
                                'Name': 'string',
                                'Value': 'string'
                            },
                        ]
                    }
                },
                'Challenge': {
                    'CustomRequestHandling': {
                        'InsertHeaders': [
                            {
                                'Name': 'string',
                                'Value': 'string'
                            },
                        ]
                    }
                }
            }
        },
    ],
    'LabelNamespace': 'string',
    'AvailableLabels': [
        {
            'Name': 'string'
        },
    ],
    'ConsumedLabels': [
        {
            'Name': 'string'
        },
    ]
}

Response Structure

  • (dict) –

    • VersionName (string) –

      The managed rule group’s version.

    • SnsTopicArn (string) –

      The Amazon resource name (ARN) of the Amazon Simple Notification Service SNS topic that’s used to provide notification of changes to the managed rule group. You can subscribe to the SNS topic to receive notifications when the managed rule group is modified, such as for new versions and for version expiration. For more information, see the Amazon Simple Notification Service Developer Guide.

    • Capacity (integer) –

      The web ACL capacity units (WCUs) required for this rule group.

      WAF uses WCUs to calculate and control the operating resources that are used to run your rules, rule groups, and web ACLs. WAF calculates capacity differently for each rule type, to reflect the relative cost of each rule. Simple rules that cost little to run use fewer WCUs than more complex rules that use more processing power. Rule group capacity is fixed at creation, which helps users plan their web ACL WCU usage when they use a rule group. For more information, see WAF web ACL capacity units (WCU) in the WAF Developer Guide.

    • Rules (list) –

      • (dict) –

        High-level information about a Rule, returned by operations like DescribeManagedRuleGroup. This provides information like the ID, that you can use to retrieve and manage a RuleGroup, and the ARN, that you provide to the RuleGroupReferenceStatement to use the rule group in a Rule.

        • Name (string) –

          The name of the rule.

        • Action (dict) –

          The action that WAF should take on a web request when it matches a rule’s statement. Settings at the web ACL level can override the rule action setting.

          • Block (dict) –

            Instructs WAF to block the web request.

            • CustomResponse (dict) –

              Defines a custom response for the web request.

              For information about customizing web requests and responses, see Customizing web requests and responses in WAF in the WAF Developer Guide.

              • ResponseCode (integer) –

                The HTTP status code to return to the client.

                For a list of status codes that you can use in your custom responses, see Supported status codes for custom response in the WAF Developer Guide.

              • CustomResponseBodyKey (string) –

                References the response body that you want WAF to return to the web request client. You can define a custom response for a rule action or a default web ACL action that is set to block. To do this, you first define the response body key and value in the CustomResponseBodies setting for the WebACL or RuleGroup where you want to use it. Then, in the rule action or web ACL default action BlockAction setting, you reference the response body using this key.

              • ResponseHeaders (list) –

                The HTTP headers to use in the response. You can specify any header name except for content-type. Duplicate header names are not allowed.

                For information about the limits on count and size for custom request and response settings, see WAF quotas in the WAF Developer Guide.

                • (dict) –

                  A custom header for custom request and response handling. This is used in CustomResponse and CustomRequestHandling.

                  • Name (string) –

                    The name of the custom header.

                    For custom request header insertion, when WAF inserts the header into the request, it prefixes this name x-amzn-waf-, to avoid confusion with the headers that are already in the request. For example, for the header name sample, WAF inserts the header x-amzn-waf-sample.

                  • Value (string) –

                    The value of the custom header.

          • Allow (dict) –

            Instructs WAF to allow the web request.

            • CustomRequestHandling (dict) –

              Defines custom handling for the web request.

              For information about customizing web requests and responses, see Customizing web requests and responses in WAF in the WAF Developer Guide.

              • InsertHeaders (list) –

                The HTTP headers to insert into the request. Duplicate header names are not allowed.

                For information about the limits on count and size for custom request and response settings, see WAF quotas in the WAF Developer Guide.

                • (dict) –

                  A custom header for custom request and response handling. This is used in CustomResponse and CustomRequestHandling.

                  • Name (string) –

                    The name of the custom header.

                    For custom request header insertion, when WAF inserts the header into the request, it prefixes this name x-amzn-waf-, to avoid confusion with the headers that are already in the request. For example, for the header name sample, WAF inserts the header x-amzn-waf-sample.

                  • Value (string) –

                    The value of the custom header.

          • Count (dict) –

            Instructs WAF to count the web request and then continue evaluating the request using the remaining rules in the web ACL.

            • CustomRequestHandling (dict) –

              Defines custom handling for the web request.

              For information about customizing web requests and responses, see Customizing web requests and responses in WAF in the WAF Developer Guide.

              • InsertHeaders (list) –

                The HTTP headers to insert into the request. Duplicate header names are not allowed.

                For information about the limits on count and size for custom request and response settings, see WAF quotas in the WAF Developer Guide.

                • (dict) –

                  A custom header for custom request and response handling. This is used in CustomResponse and CustomRequestHandling.

                  • Name (string) –

                    The name of the custom header.

                    For custom request header insertion, when WAF inserts the header into the request, it prefixes this name x-amzn-waf-, to avoid confusion with the headers that are already in the request. For example, for the header name sample, WAF inserts the header x-amzn-waf-sample.

                  • Value (string) –

                    The value of the custom header.

          • Captcha (dict) –

            Instructs WAF to run a CAPTCHA check against the web request.

            • CustomRequestHandling (dict) –

              Defines custom handling for the web request, used when the CAPTCHA inspection determines that the request’s token is valid and unexpired.

              For information about customizing web requests and responses, see Customizing web requests and responses in WAF in the WAF Developer Guide.

              • InsertHeaders (list) –

                The HTTP headers to insert into the request. Duplicate header names are not allowed.

                For information about the limits on count and size for custom request and response settings, see WAF quotas in the WAF Developer Guide.

                • (dict) –

                  A custom header for custom request and response handling. This is used in CustomResponse and CustomRequestHandling.

                  • Name (string) –

                    The name of the custom header.

                    For custom request header insertion, when WAF inserts the header into the request, it prefixes this name x-amzn-waf-, to avoid confusion with the headers that are already in the request. For example, for the header name sample, WAF inserts the header x-amzn-waf-sample.

                  • Value (string) –

                    The value of the custom header.

          • Challenge (dict) –

            Instructs WAF to run a Challenge check against the web request.

            • CustomRequestHandling (dict) –

              Defines custom handling for the web request, used when the challenge inspection determines that the request’s token is valid and unexpired.

              For information about customizing web requests and responses, see Customizing web requests and responses in WAF in the WAF Developer Guide.

              • InsertHeaders (list) –

                The HTTP headers to insert into the request. Duplicate header names are not allowed.

                For information about the limits on count and size for custom request and response settings, see WAF quotas in the WAF Developer Guide.

                • (dict) –

                  A custom header for custom request and response handling. This is used in CustomResponse and CustomRequestHandling.

                  • Name (string) –

                    The name of the custom header.

                    For custom request header insertion, when WAF inserts the header into the request, it prefixes this name x-amzn-waf-, to avoid confusion with the headers that are already in the request. For example, for the header name sample, WAF inserts the header x-amzn-waf-sample.

                  • Value (string) –

                    The value of the custom header.

    • LabelNamespace (string) –

      The label namespace prefix for this rule group. All labels added by rules in this rule group have this prefix.

      • The syntax for the label namespace prefix for a managed rule group is the following: awswaf:managed:<vendor>:<rule group name>:

      • When a rule with a label matches a web request, WAF adds the fully qualified label to the request. A fully qualified label is made up of the label namespace from the rule group or web ACL where the rule is defined and the label from the rule, separated by a colon: <label namespace>:<label from rule>

    • AvailableLabels (list) –

      The labels that one or more rules in this rule group add to matching web requests. These labels are defined in the RuleLabels for a Rule.

      • (dict) –

        List of labels used by one or more of the rules of a RuleGroup. This summary object is used for the following rule group lists:

        • AvailableLabels - Labels that rules add to matching requests. These labels are defined in the RuleLabels for a Rule.

        • ConsumedLabels - Labels that rules match against. These labels are defined in a LabelMatchStatement specification, in the Statement definition of a rule.

        • Name (string) –

          An individual label specification.

    • ConsumedLabels (list) –

      The labels that one or more rules in this rule group match against in label match statements. These labels are defined in a LabelMatchStatement specification, in the Statement definition of a rule.

      • (dict) –

        List of labels used by one or more of the rules of a RuleGroup. This summary object is used for the following rule group lists:

        • AvailableLabels - Labels that rules add to matching requests. These labels are defined in the RuleLabels for a Rule.

        • ConsumedLabels - Labels that rules match against. These labels are defined in a LabelMatchStatement specification, in the Statement definition of a rule.

        • Name (string) –

          An individual label specification.

Exceptions