AWS WAFv2 is the current version of AWS Web Application Firewall, used to inspect HTTP and HTTPS traffic and apply access control rules. It helps teams protect applications and APIs by filtering requests, enforcing policy, and collecting telemetry for review. In Terraform workflows, it can be managed as reusable infrastructure code.
Expanded Definition
AWS WAFv2 is a layer-seven control plane for HTTP and HTTPS traffic, letting security teams define rules that allow, block, count, or rate-limit requests before they reach applications and APIs. In NHI security, its real value is not just perimeter filtering but policy enforcement around access patterns that often originate from service accounts, automation pipelines, and agentic workloads. Definitions vary across vendors on how broadly a web application firewall should be used for API protection, but in practice WAFv2 is strongest when paired with identity-aware controls, telemetry review, and rule governance aligned to NIST Cybersecurity Framework 2.0.
Because WAFv2 can be managed as infrastructure code, it also becomes part of change control for NHI-related defenses: rules can be versioned, reviewed, and rolled out consistently across environments. That matters when the protected surface includes AI endpoints, internal APIs, and ephemeral workloads that do not fit traditional user-centric security models. The most common misapplication is treating WAFv2 as a substitute for authentication or secret protection, which occurs when teams assume request filtering alone can stop abuse after credentials or tokens have already been compromised.
Examples and Use Cases
Implementing AWS WAFv2 rigorously often introduces rule-maintenance overhead, requiring organisations to weigh tighter abuse prevention against the operational cost of tuning false positives and keeping policies current.
- Blocking credential stuffing and scripted login abuse against customer portals while preserving legitimate application traffic during normal peaks.
- Rate-limiting API requests from a compromised service account after suspicious burst patterns appear, especially when those requests mirror activity seen in the AI LLM hijack breach.
- Using WAFv2 managed rules to reduce injection attempts against publicly exposed workloads that also depend on automated AWS access, a pattern frequently discussed in 230M AWS environment compromise research.
- Deploying custom allowlists for internal APIs so only approved traffic paths reach downstream systems, then pairing that with secret rotation and NHI monitoring.
- Counting suspicious requests before enforcement to validate rule impact in staging, then promoting the same policy through Terraform for repeatable deployment.
For deeper technical context, practitioners often cross-check WAF behaviour against the NIST Cybersecurity Framework 2.0 and AWS-specific attack reporting, because the control is only as effective as the identity signals and exception handling behind it.
Why It Matters in NHI Security
AWS WAFv2 matters in NHI security because many compromise paths begin with exposed or abused machine credentials, not with classic browser attacks. NHI Mgmt Group research shows that 80% of identity breaches involved compromised non-human identities such as service accounts and API keys, and attackers can begin using exposed AWS credentials within an average of 17 minutes. That makes traffic filtering a useful containment layer, but only when it is integrated with detection, revocation, and least-privilege design. Research on the Ultimate Guide to NHIs also shows how common weak hygiene remains, with 97% of NHIs carrying excessive privileges and only 5.7% of organisations having full visibility into service accounts.
For practitioners, the core governance question is whether WAFv2 rules are being used to reduce blast radius or to compensate for weak identity controls. It should support NHI defense-in-depth by slowing abusive requests, buying time for rotation, and preserving telemetry for investigation, not by masking poor secret handling. The most common operational lesson arrives after an exposure event, when request volume spikes, automated abuse begins, and WAFv2 becomes one of the few controls still able to contain the damage. Organisations typically encounter this pressure only after exposed credentials are being actively used, at which point WAFv2 becomes operationally unavoidable to address.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Non-Human Identity Top 10 and OWASP Agentic AI Top 10 address the attack and risk surface, while NIST CSF 2.0, NIST Zero Trust (SP 800-207) and NIST AI RMF set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-01 | Web request abuse often follows NHI credential compromise and policy gaps. |
| NIST CSF 2.0 | PR.AC-4 | Access enforcement and least privilege map to WAF policy decisions. |
| NIST Zero Trust (SP 800-207) | PE | Zero Trust requires continuous policy enforcement at request boundaries. |
| NIST AI RMF | AI systems need risk controls for exposed endpoints and abuse paths. | |
| OWASP Agentic AI Top 10 | Agentic systems expand attack surface through tool-accessible HTTP APIs. |
Use WAFv2 to reduce prompt and API abuse exposure while monitoring AI service traffic for anomalies.
Related resources from NHI Mgmt Group
- How should security teams reduce standing privilege in AWS environments?
- How should security teams reduce AWS data security risk without slowing cloud operations?
- Why do plaintext secrets create such a large AWS security problem?
- What is the difference between encryption and access control in AWS data protection?