
AWS WAF Configuration
OfficialFreeEasily configure AWS WAF for web traffic filtering.
Free · Opens the source repo
What AWS WAF Configuration does
The AWS WAF Configuration skill provides a comprehensive solution for setting up and managing AWS WAF, the web application firewall designed to protect web applications from common threats. This skill enables users to create Web Access Control Lists (ACLs) for various AWS services including CloudFront, Application Load Balancers, API Gateway, and AppSync. It covers essential tasks such as adding AWS Managed Rules, implementing rate-based rules to mitigate HTTP floods, and configuring IP set and geographic match rules to control access based on IP addresses or regions.
With this skill, developers and security professionals can effectively manage bot traffic using Bot Control features, which include both Common and Targeted bot detection. The skill also facilitates the recovery of the real client IP behind a CDN and offers Fraud Control mechanisms to protect against account takeover and fake account creation. Each function is supported by detailed reference documents, ensuring that users can follow the appropriate procedures and understand the constraints involved in each task.
The skill operates through the AWS MCP server for secure command execution and can fall back to the AWS CLI when necessary. It emphasizes the importance of setting up logging and request sampling before tuning any rules, ensuring that users have the necessary data to make informed adjustments. Security considerations are also highlighted, including the need for least-privilege IAM policies to safeguard against misconfigurations that could weaken application defenses.
Overall, this skill is designed for users looking to enhance the security of their web applications or APIs by implementing robust WAF configurations tailored to their specific needs.
When to use it
Use this skill when you need to set up AWS WAF to filter web traffic and protect against common exploits, bots, and credential stuffing.
When not to use it
This skill is not suitable for L3/L4 DDoS protection or for configuring CloudFront and Application Load Balancers directly.
What you can build with it
Setting Up a Web ACL
Quickly create a web ACL and associate it with your CloudFront distribution to start filtering traffic.
Implementing Bot Control
Use this skill to configure Bot Control features to detect and manage bot traffic effectively.
Logging for Rule Tuning
Set up logging and request sampling before adjusting your WAF rules to ensure accurate data for tuning.
How to install AWS WAF Configuration
View source1. Install with the skills CLI
npx skills add aws/agent-toolkit-for-aws/waf --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by awsAWS 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
Frequently asked questions about AWS WAF Configuration
Similar skills
GitHub Actions Hardening
Enhance the security of your GitHub Actions workflows.
Sensitive Logging Audit
Audit and fix sensitive data exposure in Python logging.
Android App Static Analysis
Automate security assessments of Android apps with MobSF.
Integrating DAST with OWASP ZAP
Seamlessly integrate dynamic security testing into CI/CD pipelines.
Implementing Runtime Security with Tetragon
Enhance Kubernetes security with eBPF-based observability.
Implementing Mobile Application Management
Secure enterprise data on mobile devices with app-level controls.
