Skip to content

AWS WAF

Collect AWS WAF metrics. This integration uses the WAFv2 API and script ID integration_aws_wafv2.

Configuration

Install Func

We recommend enabling hosted Func under Integration - Extensions in TrueWatch. All prerequisites are installed automatically; continue with the script installation.

If deploying Func manually, refer to Manual Deployment of Func

Install Script

Note: Please prepare the required Amazon AK in advance (for simplicity, you can grant global read-only permissions ReadOnlyAccess)

Activate Scripts in Hosted Func

  1. Log in to the TrueWatch console
  2. Click the 【Integration】 menu and select 【Cloud Account Management】
  3. Click 【Add Cloud Account】, select 【AWS】, and fill in the required information on the interface. If you have already configured the cloud account information before, ignore this step
  4. Click 【Test】, and if the test is successful, click 【Save】. If the test fails, please check if the relevant configuration information is correct and test again
  5. Click 【Cloud Account Management】, and you can see the added cloud account in the list. Click the corresponding cloud account to enter the details page
  6. Click 【Integration】 on the cloud account details page, find AWS WAF in the Not Installed list and click 【Install】 to open the installation form.

Manual Activation Script

  1. Log in to the Func console, click 【Script Market】, open the TrueWatch script market and search for integration_aws_wafv2.

  2. Click 【Install】, then enter the corresponding parameters: AWS AK ID, AK Secret, and account name.

  3. Click 【Deploy Startup Script】 to create the Startup script set and configure the corresponding startup scripts automatically.

  4. After enabling the script, open 【Management / Automatic Trigger Configuration】 to view its automatic trigger configuration. Click 【Execute】 to run it immediately without waiting for the scheduled time. After a short wait, review the task records and logs.

Verification

  1. Under 【Management / Automatic Trigger Configuration】, confirm that the task has an automatic trigger configuration. Review its task records and logs for errors.
  2. In TrueWatch, check 【Infrastructure - Resource Catalog】 for asset information.
  3. In TrueWatch, check 【Metrics】 for the corresponding monitoring data.

Metrics

AWS WAF Metrics are under the aws_AWS/WAFV2 Measurement. Below are descriptions of some metrics along with their units and statistical data.

Metric Description Unit
AllowedRequests Number of allowed web requests count
BlockedRequests Number of blocked web requests count
RequestsWithValidChallengeToken Number of web requests with a valid challenge token count
SampleBlockedRequest Number of sampled requests that executed a Block operation count
CaptchaRequests Number of web requests with CAPTCHA controls applied count
PassedRequests Number of passed requests. This is only used for requests that pass the rule group evaluation but do not match any rule group rules count
RequestsWithValidChallengeToken Number of web requests with a valid challenge token count
SampleAllowedRequest Number of sampled requests that executed an Allow operation count
SampleCaptchaRequest Number of sampled requests that executed a CAPTCHA operation count
SampleChallengeRequest Number of sampled requests that executed a Challenge operation count
SampleCountRequest Number of sampled requests that executed a Count operation count

Object

The collected AWS WAF object data structure can be viewed in "Infrastructure - Resource Catalog".

{
  "measurement": "aws_wafv2",
  "tags": {
    "Id"                        : "91d10100-xxxxxxxxx-89fb90d1f566",
    "ARN"                       : "arn:aws:wafv2:us-east-1:87626xxxxx4:regional/webacl/test-123/446cc7d0-d87e-xxxxxxxxxx",
    "Capacity"                  : "CN",
    "LabelNamespace"            : "awswaf:87626xxxxx4:webacl:test-us-east-1:xxxxx",
    "ManagedByFirewallManager"  : "False",
    "RegionId"                  : "ap-southeast-1"
  },
  "fields": {
    "LockToken"                              : "6fe50442-fdfe-4dd5-ba54-5xxxxxxxxxxx",
    "Description"                            : "test-123",
    "AssociationConfig"                      : "{xxxxxxx}",
    "CaptchaConfig"                          : "{xxxxxxx}",
    "ChallengeConfig"                        : "{xxxxxxx}",
    "CustomResponseBodies"                   : "xxxxxxx",
    "DefaultAction"                          : "{"Allow": {}}",
    "PostProcessFirewallManagerRuleGroups"   : "Success",
    "PreProcessFirewallManagerRuleGroups"    : "{xxxxxxxx}",
    "Rules"                                  : "{Rules}",
    "TokenDomains"                           : "xxxxxxxx",
    "VisibilityConfig"                       : "{xxxxxxx}"
  }
}

Note: The fields in tags and fields may change with subsequent updates