AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill acts as a central router for configuring AWS WAF to secure web applications and APIs. It provides structured procedures for creating web ACLs, managing rule sets, implementing bot and fraud control, and configuring logging. The skill emphasizes a secure-by-design approach, requiring logging to be enabled before tuning and enforcing strict header-stripping to prevent spoofing. It covers the full lifecycle of WAF management, from initial setup and association with resources like CloudFront and ALB to advanced mitigation strategies for volumetric abuse and credential stuffing.
What it does
- Creates and associates web ACLs with CloudFront, ALB, API Gateway, and AppSync.
- Configures AWS Managed Rules, rate-based rules, and custom IP or geographic match rules.
- Implements Bot Control and Fraud Control to prevent account takeover and fake-account creation.
- Provides workflows for logging, request sampling, and tuning rules in Count mode.
- Enforces security best practices like header stripping and least-privilege IAM.
- Routes users to specific, self-contained procedures for complex WAF tasks.
When to use it
- When you need to protect a web application or API from layer 7 exploits and HTTP floods.
- When implementing bot detection or fraud prevention for login and signup endpoints.
- When you need to tune managed rules to reduce false positives without blocking legitimate traffic.
- When you need to recover the real client IP or secure forwarded headers behind a CDN.
- When you need to manage AI and LLM crawler traffic.
Advantages
- Reduces risk of misconfiguration by enforcing a logical, step-by-step tuning workflow.
- Prevents accidental blocking of legitimate traffic through mandatory Count-mode tuning.
- Ensures security consistency by mandating header-stripping when forwarding signals.
- Provides clear guidance on WCU budget management and rule group selection.
- Centralizes complex WAF procedures into a single, reliable reference source.
Usage examples
- “How do I set up AWS WAF to block HTTP floods on my Application Load Balancer?”
- The agent will guide you through creating a regional web ACL, associating it with your ALB, and configuring a rate-based rule to throttle requests based on IP or session token.
- “I am seeing false positives from the Core Rule Set. How do I fix this?”
- The agent will instruct you to check your WAF logs to identify the specific rule ID triggering the block, then use the RuleActionOverrides feature to set that specific rule to Count mode.
- “How can I protect my login page from credential stuffing?”
- The agent will guide you through enabling Fraud Control (Account Takeover Prevention) and configuring the necessary logging and signal-forwarding rules.
- “I need to allow traffic only from specific countries. What is the procedure?”
- The agent will provide the steps to create a geographic match rule and configure the web ACL's default action to block traffic outside of your allowed list.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/aws/waf/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip waf.zip -d .agents/skills
Documentation by AWS
AWS WAF
Overview
Domain expertise for configuring AWS WAF, the web application firewall that filters HTTP and HTTPS traffic to CloudFront distributions, Application Load Balancers, API Gateway REST APIs, and AppSync GraphQL APIs. Covers web ACL creation and association, AWS Managed Rules, rate-based rules, match rules (IP set and geographic), Bot Control and the signal-forwarding workflows built on top of it, Fraud Control for logins and signups, AI and LLM crawler management, and the logging that every tuning workflow depends on.
This skill is a router. Each customer task maps to a procedure file under references/. Read the
matching reference in full before acting, then follow its constraints and steps. The reference
files are self-contained: each carries its own decision tables, constraints, procedure, and
troubleshooting.
Execute commands using the AWS MCP server when connected (sandboxed execution, audit logging,
observability). Fall back to the AWS CLI otherwise. A web ACL's scope is fixed at creation: a
CloudFront web ACL must be created in us-east-1 with CLOUDFRONT scope, while a regional web ACL
(Application Load Balancer, API Gateway, AppSync) is created in the resource's Region with
REGIONAL scope.
Which WAF task do you need?
Routing notes
Logging comes before tuning. Every Count-mode tuning workflow assumes logging and request sampling are on. If the customer has not set up logging, run that reference first; otherwise Count-mode tuning has nothing to read.
Web ACL scope is fixed at creation. A CloudFront web ACL is
CLOUDFRONTscope inus-east-1; a regional resource needs aREGIONALweb ACL in its own Region. Scope cannot be changed later, so the creating reference settles it before anything is built.Bot Control is a chain, not one task. Protecting against bots is the on-ramp (turn on, choose Common vs Targeted, observe). Turning labels into a confidence signal, forwarding that signal, and deciding what the application does with it are three separate references that build on it in that order. The header-stripping reference is the mandatory safety companion whenever a signal is forwarded to the origin.
Common vs Targeted is not a soft choice. Common only catches self-identifying bots and known-bad IPs. For login, checkout, or any high-value endpoint facing evasive bots, Targeted with the application integration SDK is required. The bots reference pushes Targeted for real bot threats rather than presenting it as optional.
Rate limiting vs Fraud Control. Rate-based rules blunt volumetric HTTP floods. Credential stuffing and fake-account creation are account-based abuse that rate limiting misses; those go to the Fraud Control reference (ATP and ACFP), not the rate-based reference.
Forwarded headers need the strip rule. Any time the customer forwards a signal or the client IP to the origin in
x-amzn-waf-*headers, the inbound-header-stripping reference is required to prevent spoofing. The confidence-signal, interpolation, and client-IP references all point at it.What lives in other skills. L3/L4 DDoS protection and Shield cost-protection credits are the shieldadvanced skill. Multi-account WAF rollout is the firewallmanager skill. CloudFront and Application Load Balancer configuration are their own skills. This skill builds the WAF rules; it does not configure the resources it protects.
Security Considerations
AWS WAF is itself a security control, so misconfiguration directly weakens an application's defenses. Apply these across every reference:
Least-privilege IAM. You MUST grant only the specific
wafv2:actions a task needs (for examplewafv2:CreateWebACL,wafv2:GetWebACL,wafv2:UpdateWebACL,wafv2:AssociateWebACL,wafv2:PutLoggingConfiguration) rather thanwafv2:*or theAWSWAFFullAccessmanaged policy.Ephemeral credentials. You MUST use IAM roles with temporary credentials (such as an EC2 instance profile, SSO session, or
aws sts assume-role) rather than long-lived IAM user access keys when running these WAF CLI commands.Monitor configuration changes. You SHOULD enable AWS CloudTrail on
wafv2management events and set CloudWatch alarms on critical web ACL configuration changes (such asDeleteWebACLandUpdateWebACLrule removals) and on the web ACL'sBlockedRequestsandCountedRequestsmetrics, so rule changes and sudden spikes in blocked or counted traffic are detected.Misconfiguration opens access. A web ACL that is created but never associated, or one whose default action is left at
Allowwith no enforcing rules, filters nothing. You MUST confirm the web ACL is associated and that its posture matches the intended default (block vs allow) before reporting setup complete.Protect log destinations. Logs can capture credentials and session data. You MUST redact sensitive fields (such as the
authorizationheader andcookie) and MUST enable encryption at rest on the log destination (CloudWatch Logs, Amazon S3, or Amazon Data Firehose).Header-spoofing risk. Any
x-amzn-waf-*signal forwarded to the origin can be forged inbound. You MUST add the inbound-header-stripping rule whenever a signal or client IP is forwarded (see stripping-inbound-waf-headers-before-trusting-them).
Additional Resources
Files
- ATTRIBUTION.mdAdded by AutoGineer917 B
- LICENSELicence file added by AutoGineer9.9 KiB
- NOTICELicence file added by AutoGineer67 B
- SKILL.md8.6 KiB
- references/adaptive-mitigation-playbook-for-forwarded-signals.md8.9 KiB
- references/adding-managed-rules-and-tuning-with-count-mode.md10.1 KiB
- references/adding-rate-based-rules.md10.5 KiB
- references/creating-a-web-acl-and-associating-it-with-a-resource.md9.3 KiB
- references/forwarding-signals-with-dynamic-label-interpolation.md9.5 KiB
- references/protecting-against-bots-with-bot-control.md9.9 KiB
- references/protecting-logins-and-signups-with-fraud-control.md9.2 KiB
- references/recovering-the-real-client-ip-behind-a-cdn.md9.4 KiB
- references/seeing-and-managing-ai-crawler-traffic.md7.3 KiB
- references/setting-up-logging-and-request-sampling.md9.2 KiB
- references/stripping-inbound-waf-headers-before-trusting-them.md7.5 KiB
- references/turning-bot-control-labels-into-a-confidence-signal.md11.0 KiB
- references/using-ip-sets-and-geographic-match-rules.md8.5 KiB
references/creating-a-web-acl-and-associating-it-with-a-resource.md
Creating a Web ACL and Associating It with a Resource
Overview
Domain expertise for putting AWS WAF in front of an application: creating a web access control list
(web ACL) and associating it with the resource it protects. Covers the immutable scope choice
(CLOUDFRONT in us-east-1 versus REGIONAL in the resource's Region), the fact that a web ACL
filters nothing until it is associated, the one-web-ACL-per-resource and CloudFront-only
constraints, and starting rules in Count mode.
Does not cover the rules that go inside the web ACL (managed rules, rate-based, match, bot, fraud); those are separate references. CloudFront distribution and Application Load Balancer configuration are their own skills.
Execute commands using the AWS MCP server when connected (sandboxed execution, audit logging, observability). Fall back to the AWS CLI otherwise.
Table of Contents
Overview
Workflow
Decision: scope
Least-privilege IAM
A web ACL filters nothing until associated
One web ACL per resource, CloudFront is exclusive
Start rules in Count mode
Troubleshooting
Procedure
Security Considerations
Additional Resources
Workflow
To create a web ACL and associate it end to end, follow the procedure exactly. See the Procedure section below.
The procedure covers:
Choosing the scope from the resource type
Creating the web ACL with a default action
Associating it with the resource
Confirming the association and surfacing the console link
Decision: scope
| Resource | Scope | Region |
|---|---|---|
| CloudFront distribution | CLOUDFRONT | us-east-1 (required) |
| Application Load Balancer, API Gateway REST API, AppSync GraphQL API, Cognito user pool, App Runner, Verified Access, Amplify | REGIONAL | the resource's own Region |
Constraints:
You MUST set the scope from the resource type before creating the web ACL; scope is immutable after creation
You MUST create a
CLOUDFRONTweb ACL inus-east-1regardless of where the distribution servesYou MUST create a
REGIONALweb ACL in the same Region as the resource it protects
Least-privilege IAM
The credentials that run these commands should carry only the WAF actions the task needs, not broad access.
Constraints:
You MUST grant only the specific
wafv2:actions these procedures use — for the entry-point workflow that iswafv2:CreateWebACL,wafv2:GetWebACL,wafv2:UpdateWebACL, andwafv2:AssociateWebACL— rather thanwafv2:*or theAWSWAFFullAccessmanaged policyYou SHOULD extend the same least-privilege approach to the other references (for example
wafv2:PutLoggingConfigurationfor logging,wafv2:CreateIPSet/wafv2:UpdateIPSetfor IP sets), granting only what each task requiresYou MUST use IAM roles with temporary credentials (such as an EC2 instance profile, SSO session, or
aws sts assume-role) rather than long-lived IAM user access keys when running these commands
A web ACL filters nothing until associated
A web ACL inspects no traffic until it is associated with a resource. Customers finish the web ACL and assume traffic is filtered.
Constraints:
You MUST treat the association as a required closing step, not optional
You MUST confirm the resource is associated before reporting the setup complete
One web ACL per resource, CloudFront is exclusive
Each resource can have only one web ACL, and a web ACL associated with a CloudFront distribution cannot be associated with any other resource type. Customers design around a shared web ACL that cannot exist.
Constraints:
You MUST NOT associate more than one web ACL with a single resource
You MUST NOT reuse a CloudFront-associated web ACL on a regional resource
You SHOULD explain these constraints before the customer designs a shared web ACL
Start rules in Count mode
Enabling rules straight to Block can take down legitimate traffic. The recommended path for a first web ACL is Count, then Block after review.
Constraints:
You SHOULD start new rules in Count mode and move them to Block only after the customer reviews the matches
You SHOULD confirm logging is set up first so Count-mode matches are reviewable
Troubleshooting
A CloudFront distribution does not appear in the association list
The web ACL was created in the wrong scope or Region. Recreate it as CLOUDFRONT scope in
us-east-1 (Decision: scope).
Rules are configured but traffic is not filtered
The web ACL is not associated with the resource. Associate it (A web ACL filters nothing until associated).
A web ACL cannot be reused across CloudFront and a regional resource
CloudFront web ACLs are exclusive and each resource takes one web ACL. Create separate web ACLs (One web ACL per resource, CloudFront is exclusive).
Procedure
Overview
This procedure creates a web ACL in the correct scope, associates it with the resource, and surfaces the console link to verify.
Parameters
web_acl_name (required): A name for the web ACL.
resource_arn (required): The ARN of the resource to protect.
scope (required):
CLOUDFRONTorREGIONAL, derived from the resource type.default_action (required):
AlloworBlockwhen no rule matches. Set this deliberately to match the intended posture; anAllowdefault passes any traffic not matched by a rule through unfiltered, so preferBlockas the secure default and useAllowonly when explicit blocking rules carry the enforcement.
Constraints for parameter acquisition:
You MUST ask for all required parameters upfront in a single prompt
You MUST derive the scope and Region from the resource type, not from the customer's working Region
Steps
1. Verify dependencies
Constraints:
You MUST confirm credentials with
aws sts get-caller-identityYou MUST confirm the resource exists in the expected Region
2. Create the web ACL
Constraints:
You MUST create the web ACL in the correct scope and Region:
aws wafv2 create-web-acl --name {web_acl_name} --scope {scope} \ --default-action {default_action}={} \ --visibility-config SampledRequestsEnabled=true,CloudWatchMetricsEnabled=true,MetricName={web_acl_name} \ --region {region}You MUST capture the web ACL ARN and id from the response
3. Associate the web ACL with the resource
Constraints:
You MUST associate the web ACL with the resource ARN:
aws wafv2 associate-web-acl --web-acl-arn {web_acl_arn} --resource-arn {resource_arn} --region {region}You MUST NOT consider the setup complete until the association succeeds
4. Confirm and surface the console link
Constraints:
You MUST confirm the association and present the AWS WAF console link, telling the customer to open it and confirm the web ACL and its associated resource:
https://us-east-1.console.aws.amazon.com/wafv2/homev2/web-acls?region={region}
Example
Example input
{
"web_acl_name": "example-frontend-webacl",
"resource_arn": "arn:aws:cloudfront::111122223333:distribution/EDFDVBD6EXAMPLE",
"scope": "CLOUDFRONT",
"default_action": "Block"
}(Block is the secure default — unmatched requests are denied, and Allow rules admit the
traffic you intend. Use "default_action": "Allow" only when the customer explicitly wants an
allow-by-default web ACL whose rules do the blocking.)
Example output
Created CLOUDFRONT web ACL example-frontend-webacl in us-east-1 with default action Block.
Associated it with distribution EDFDVBD6EXAMPLE.
Open the AWS WAF console and confirm the web ACL and its associated resource:
https://us-east-1.console.aws.amazon.com/wafv2/homev2/web-acls?region=us-east-1Troubleshooting
The distribution is missing from the association list
The web ACL is in the wrong scope or Region. Recreate as CLOUDFRONT in us-east-1 (Step 2).
Traffic is not being filtered
The web ACL is not associated. Associate it (Step 3).
Security Considerations
This procedure modifies a security control, so misconfiguration directly weakens the application's defenses.
Least-privilege IAM. You MUST grant only the specific
wafv2:actions a task needs (for examplewafv2:GetWebACLandwafv2:UpdateWebACL) rather thanwafv2:*or theAWSWAFFullAccessmanaged policy.Ephemeral credentials. You MUST use IAM roles with temporary credentials (such as an EC2 instance profile, SSO session, or
aws sts assume-role) rather than long-lived IAM user access keys when running these WAF CLI commands.Monitor configuration changes. You SHOULD enable AWS CloudTrail on
wafv2management events and set CloudWatch alarms on critical web ACL configuration changes (such asDeleteWebACLandUpdateWebACLrule removals) and on the web ACL'sBlockedRequestsandCountedRequestsmetrics, so rule changes and sudden spikes in blocked or counted traffic are detected.
Additional Resources
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs an MCP server
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- AWS
- Publisher
- AWS (Official)
- Source
- aws/agent-toolkit-for-aws · skills/specialized-skills/networking-and-content-delivery-skills/waf · commit 0a218f8
- Licence
- Apache License 2.0 (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- NOTICE (added by AutoGineer from NOTICE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by AWS.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download waf.zip