waf-pro
Deploy and operate web application firewalls — policy tuning, bot management, and virtual patching done right.
- License 许可
- MIT
- 最近更新
- 2026-11-07
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- name
- waf-pro
- category
- security
- description
- Deploy and operate web application firewalls — policy tuning, bot management, and virtual patching done right.
03 SKILL.md 正文
Overview
A WAF sits in front of web applications filtering malicious HTTP traffic: injection attempts, protocol abuse, and automated attacks. It is a valuable compensating control — especially for virtual patching when code fixes take time — but it is not a substitute for secure code. Professional WAF practice is tuning: a well-tuned WAF blocks real attacks with minimal false positives; a default WAF mostly generates tickets.
This skill covers WAF deployment modes, rule tuning, bot management, and the honest accounting of what a WAF can and cannot do.
A WAF is a compensating control with an expiration date on every rule — it buys time for real fixes and filters the internet's background radiation of automated attacks. Respect both halves of that: it genuinely reduces noise and buys patching windows, and it genuinely cannot fix your application's broken authorization. Report its value honestly and retire its rules deliberately.
When to use
- Protecting internet-facing web apps and APIs, especially legacy apps that are hard to patch.
- Virtual patching: blocking exploitation of a known vulnerability while the code fix is developed.
- Reducing automated abuse: credential stuffing, scraping, vulnerability scanning.
- Meeting compliance expectations for application-layer protection.
Core concepts
-
Deployment modes: reverse-proxy/inline (sees and can block everything; adds latency/failure domain), CDN/cloud WAF (easy, scales, less control), host-based/agent (close to the app). Choose by architecture and risk.
-
Positive vs negative security models: negative (blocklist known-bad) is the default and needs constant updates; positive (allowlist expected behavior) is stronger but harder to maintain — best for stable, well-understood APIs.
-
Virtual patching: writing a WAF rule to block a specific CVE's exploitation pattern buys time for the real fix. It is a bandage with an expiry date: track it and remove when patched.
-
Tuning lifecycle: log/monitor mode → analyze false positives → tune → enforce → continuous review. Enforcing an untuned ruleset breaks legitimate users.
-
Bot management: distinguishing good bots (search, monitoring) from bad (stuffing, scraping, scalping) via behavioral signals and challenge layers — separate from but adjacent to WAF.
-
What a WAF cannot do: fix broken access control, business-logic flaws, or insecure design. It sees HTTP, not application semantics. Pair with secure code and testing.
-
API schema enforcement. For well-defined APIs, positive-security validation against the OpenAPI schema blocks malformed and unexpected requests more reliably than generic attack signatures.
-
Layered rate limiting. WAF-level, application-level, and account-level rate limits together handle volumetric abuse, targeted stuffing, and business-logic abuse respectively.
-
Geographic and reputation policy. Geo-blocking and IP-reputation feeds are blunt instruments — use them as risk signals in layered policy, not as sole controls.
Practical workflow
- Inventory and prioritize: which apps/APIs get WAF protection first (internet-facing, sensitive data, known-vulnerable). Define success: block rate on attack traffic, FP rate near zero on legitimate traffic.
- Deploy in monitor mode: full ruleset logging, no blocking, for 1–2 weeks of real traffic. Baseline legitimate patterns, especially for APIs (unusual but valid clients break naive rules).
- Tune: disable rules that fire on legitimate traffic (document why); tighten rules for your actual threat profile; build custom rules for app-specific abuse patterns.
- Enforce gradually: switch to block mode per application, watching error rates and support tickets like a hawk for the first 48 hours. Keep a fast rollback/disable path.
- Operate: virtual-patch critical CVEs with tracked expiry; review blocked-traffic samples weekly for new attack patterns; tune quarterly or after app changes.
- Measure honestly: report blocked attacks and false-positive rate and coverage gaps (what the WAF cannot see). Feed bypass patterns back to developers as code-fix tickets.
WAF checklist
- [ ] Deployment mode chosen; failure/latency impact assessed
- [ ] Monitor-mode baseline completed before enforcement
- [ ] Rules tuned to app traffic; FP rate measured and acceptable
- [ ] Fast disable/rollback path tested
- [ ] Virtual patches tracked with expiry tied to code-fix dates
- [ ] Bot policy defined (allowlist good bots, challenge bad)
- [ ] Logging to SIEM; blocked-traffic review cadence set
Sustaining the practice
- Review blocked-traffic samples weekly for emerging attack patterns
- Re-tune after every application release that changes request shapes
- Track virtual-patch age; escalate code fixes past their committed dates
- Benchmark false-positive rate per application monthly
Metrics that prove it works
- Block rate on confirmed malicious traffic samples
- False-positive rate on legitimate traffic (per application)
- Age of oldest virtual patch without a code fix (should shrink)
- Bypass reports received and converted to code fixes
Common pitfalls
- Enforcing on day one. Untuned blocking breaks legitimate traffic and gets the WAF blamed and bypassed. Monitor first.
- Treating WAF as the fix. Virtual patches without code-fix tickets are permanent bandages. Every virtual patch needs a real fix date.
- Ignoring APIs. API traffic patterns differ from browser traffic; generic rulesets cause false positives on valid API clients. Tune per API.
- Set-and-forget. Apps change, attacks change. Untended WAFs drift into irrelevance or false-positive hell.
- No rollback plan. When the WAF breaks checkout on Black Friday, you need a tested 60-second disable path, not a change ticket.
- Overclaiming. "WAF protected" does not mean "secure." Be honest about the control's limits in risk reporting.
- WAF in front of the CDN but not the origin. Attackers who discover the origin IP bypass the WAF entirely. Restrict origin access to the WAF/CDN only.
- Rate limiting left to the WAF alone. Credential stuffing and scraping need layered controls — rate limiting, bot management, and account-level defenses together.
- WAF logs nobody reads. Block events are threat intelligence about who is probing you and how. Feed them to the SOC and review trends.
- SSL/TLS termination gaps. If the WAF cannot see decrypted traffic properly, it is filtering blind. Ensure correct certificate deployment and cipher support.
04 同仓库更多 Skills
web-scrape
Turn web pages into LLM-ready markdown via the Firecrawl API (renders JS, anti-bot handling). Use when browser_open/fetch fails on JS-heavy pages, or when you need clean markdown/structured extraction from a site. Requires FIRECRAWL_API_KEY.
design-taste-frontend
tasteskill v2, the anti-slop frontend skill. Art direction for websites, distilled from a study of 247 curated gallery sites (One Page Love, Awwwards Sites of the Day). Deals researched directions (idea, composition, type, palette, photographs, section blueprints) from a library, enforces a strict no-slop house style with a real-browser inspector, and runs a look-and-fix loop on screenshots. Use this whenever you build, design, redesign, restyle, polish or review a landing page, marketing site, portfolio, product page, one-pager, hero or any public-facing web page, in any stack (HTML/CSS, React, Next.js, Vue, Svelte, Astro, Tailwind) — also when the user says a page looks generic, templated, "AI-made", sloppy, or asks to make it look designed, premium, award-level or less like every other site. Not for dashboards or app screens.
test-driven-development
Use when implementing any feature or bugfix, before writing implementation code
systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
requesting-code-review
Use when completing tasks, implementing major features, or before merging to verify work meets requirements
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).