A cloud WAF protects an application only when every request has to pass through it, and an origin server that still answers direct traffic lets an attacker step around the whole service. This guide covers the customer-side configuration of Imperva Cloud WAF: locking the origin to Imperva, encrypting and authenticating the Imperva-to-origin leg, setting WAF rule actions and exceptions, using account-level policies, enabling API Security, and controlling the API credentials and console users that manage it all. It is for application security and platform engineers onboarding sites or reviewing an existing account. Setting names follow Imperva's Terraform provider documentation, which mirrors the Cloud Security Console and API; some features depend on your plan.
This is an independent guide from NHI Mgmt Group, based on Imperva's public documentation as of November 2026. It is not sponsored or reviewed by Imperva. Product features change, so confirm settings against Imperva's current documentation.
Key takeaways
- Lock the origin first. Imperva's own best-practice guidance is to accept origin traffic only from Imperva's network, and to change the origin IP after onboarding so historic DNS records stop pointing at it.
- Authenticate the back leg. Imperva-to-origin mutual TLS gives the origin cryptographic proof that a request came through Imperva; a shared origin secret header is weaker and does not stop network-level access.
- Know each rule's action. Review the action for SQL injection, cross-site scripting, remote file inclusion, backdoor, bot and DDoS rules on every site rather than assuming the defaults suit you.
- Keep exceptions narrow. Allowlisted IPs are not inspected, so every allowlist entry and rule exception needs an owner, a reason and a review date.
- Treat API IDs and keys as privileged. They can change WAF policy across sites: give them expiry dates, store them in a secrets manager and restrict console users by approved IPs.
How Imperva Cloud WAF sits in front of the application
Sites are onboarded by pointing DNS (typically a CNAME to an Imperva-provided hostname) at Imperva's network of points of presence (PoPs). Imperva inspects requests and forwards allowed traffic to your origin. Imperva notes that for HTTPS sites both legs, client to PoP and PoP to origin, must be encrypted. For the general model and what a WAF can and cannot stop, see the Web Application Firewall Guide.
| Layer | Where it is configured | What it controls |
|---|---|---|
| Site security rules | Per site (WAF settings; provider resource incapsula_waf_security_rule) | Actions for built-in threat rules, bot access control and DDoS behaviour |
| Account policies | Parent account (incapsula_policy), assigned to sub-accounts and sites | Reusable ACL, allowlist (WHITELIST), file upload and WAF rules policies |
| Rule exceptions | Per site and rule (incapsula_security_rule_exception) | Exclusions by IP, URL, country, continent, client application, user agent or parameter |
| Custom rules | Per site (incapsula_incap_rule) | Filter expressions with actions such as alert, block request, block user, block IP and header rewrite or delete |
| API Security | Per site and per API (incapsula_api_security_site_config, incapsula_api_security_api_config) | Positive security model from uploaded OpenAPI specifications |
| Certificates and TLS | Per site and account | Inbound TLS versions and ciphers, HSTS, and mutual TLS to the origin |
Origin lockdown: closing the bypass
Imperva's community best-practice post is direct: there is no reason for the origin to accept traffic from anywhere but Imperva's network. It also explains how origin addresses leak: through DNS settings, through TLS certificates that scanners index, and through DNS history services that record the address used before onboarding. An Imperva staff reply in March 2026 adds that an origin secret header is acceptable only if the risk is understood, because it does not stop network-level access, and that Imperva-to-origin mTLS is the option for high-security needs.
| Control | What it proves | Strength | Operational cost |
|---|---|---|---|
| Network allowlist of Imperva IP ranges at the origin firewall, security group or load balancer | The connection came from Imperva's network | Strong against direct access; does not distinguish your account from other Imperva customers | Ranges must be kept current |
| Imperva-to-origin mutual TLS | The client presenting the certificate holds your uploaded key | Strongest; ties traffic to your configuration | Certificate lifecycle and origin TLS configuration |
| Origin secret header (added by a header rewrite rule, checked at the origin) | The request carries a shared value | Weaker; leaks if logged and does not stop network access | Low; rotate the value |
| New origin IP after onboarding | Old DNS history no longer points at the live origin | Removes a common discovery path | One-off change; no need to change hosting provider |
- Find exposure: check whether the origin answers on its public IP for the site hostname, review the certificate on the origin for names that reveal it, and check what DNS history shows for the domain.
- Move the origin: after the site is onboarded, assign a new origin IP that has never been published in DNS.
- Allowlist Imperva only: at the origin firewall or cloud security group, allow HTTP and HTTPS only from Imperva's published IP ranges, and track changes to that list.
- Add mTLS to the origin: upload a client certificate and key as an Imperva-to-origin mTLS certificate (supported formats include PEM, DER, PFX and P12), associate it with the site, and configure the origin to require a client certificate from your CA.
- Test and roll back: confirm direct requests to the origin fail and requests through Imperva succeed. If the site breaks, roll back the origin firewall rule first, then the mTLS requirement, in that order.
For the origin certificate side, see the mTLS Guide; for CDN-fronted origins in general, see the CDN Security Guide.
WAF security rules and actions
The site security rules documented in Imperva's provider cover SQL injection, cross-site scripting, remote file inclusion, backdoor, bot access control and DDoS. Account-level WAF rules policies cover remote file inclusion, illegal resource access, cross-site scripting and SQL injection, with response data leak available on plans that include it.
| Rule | Documented options | Configuration notes |
|---|---|---|
| SQL injection, cross-site scripting, remote file inclusion, illegal resource access | Policy actions BLOCK, ALLOW, ALERT, BLOCK_USER, BLOCK_IP, IGNORE | Imperva's 2019 best-practice post says rules block by default except cross-site scripting, which starts as alert only. Check the current action on each site and move XSS to a blocking action once tuned. |
| Backdoor | Quarantine URL (documented default), alert, disabled | Keep quarantine on; investigate any hit as a possible compromise of the origin. |
| Bot access control | Block bad bots (default true), challenge suspected bots (default true) | Allow good bots you rely on; Imperva notes Cloud WAF sees requests before its separate bot protection module. See the Bot Management Guide. |
| DDoS | Activation mode off, auto, on, adaptive; threshold 10 to 5,000 requests per second; unknown client challenge none, cookies (default), JavaScript, CAPTCHA | The best-practice post recommends automatic mode and a threshold that matches real traffic; adaptive mode adjusts thresholds daily. See the DDoS Protection Guide. |
- Block user versus block IP: Imperva tracks blocked users with a per-user cookie, and blocks cookieless sessions by IP for 10 minutes. Prefer block user where many clients share an IP (corporate proxies, mobile carriers).
- Custom rules: use filter expressions for application-specific controls, for example blocking admin paths from outside approved ranges, and start new rules with the alert action.
- Response data leak: where your plan includes it, add it to the WAF rules policy to catch sensitive data in responses.
Exceptions, allowlists and account policies
Exceptions are the most common way a well-configured WAF is weakened over time. Imperva states that allowlisted IPs are not inspected and recommends regular allowlist reviews.
- Prefer narrow exceptions: an exception scoped to one rule, one URL and one parameter is far safer than an IP allowlist entry that skips inspection entirely.
- Use account policies for consistency: policies are created at the parent account and assigned to sub-accounts and sites, so a single ACL or WAF rules policy can set a baseline everywhere. Policy exceptions can be scoped by geography, IP, URL, client ID or site ID.
- Record ownership: put the owner, ticket and expiry in the policy or exception description, and review monthly.
- Scanner traffic: if authorised scanners need to bypass the WAF, scope the exception to the scanner's addresses and the test window, and remove it afterwards.
API Security: positive security for documented APIs
API Security lets you upload an OpenAPI specification (OAS2 or OAS3) and enforce it. Requests are checked for invalid URLs, invalid methods, missing parameters and invalid parameter values, each with its own action: ALERT_ONLY, BLOCK_REQUEST, BLOCK_USER, BLOCK_IP or IGNORE. At site level the documented default for these violation actions is ALERT_ONLY.
- Upload specifications per API: set the base path where it differs from the specification, and add a description that identifies the owning team.
- Run in alert first: keep ALERT_ONLY while you compare violations with real traffic; specifications are often out of date.
- Enforce by violation type: move invalid URL and invalid method to blocking actions first (they rarely hit legitimate clients), then missing parameters, then invalid values.
- Consider API-only mode carefully: setting a site as API-only applies the positive model to all its traffic, and Imperva warns this may cause undesired blocking. It then requires an action for non-API traffic.
- Note documented limits: the provider documentation states the invalid parameter name action is not currently supported, so do not depend on it.
Positive security catches requests outside the contract but not authorisation flaws inside it. See the OWASP API Top 10 API1 Broken Object Level Authorization Guide.
Where identity fits: API clients and console users
Every automation that manages Imperva, including Terraform pipelines, authenticates with an API ID and API key. Those credentials can change WAF actions, exceptions and origin settings across sites, so they deserve the controls of any privileged machine identity.
- Consent gate: an account administrator must enable API Client Creation Consent before API clients can be created this way; keep it limited to the team that manages automation.
- Expiry and rotation: API clients take an expiration date, and changing it regenerates the key secret. Set expiries that match your rotation standard and rotate through the pipeline, not by hand.
- Disabled until needed: the documented default for a new API client's enabled flag is false; enable only when the consumer is ready.
- Secret handling: the provider reads credentials from
INCAPSULA_API_IDandINCAPSULA_API_KEY; inject them from a secrets manager at run time, never commit them, and remember Terraform state can hold sensitive values. See How to find secrets in Terraform state. - Least privilege for people: create custom account roles from the permission list rather than giving everyone administrator rights, and set approved IPs so users can reach the Cloud Security Console UI and API only from known networks.
- Audit trail: send the AUDIT producer (AUDIT_TRAIL dataset) to your SIEM so policy, exception and user changes are reviewable.
For the wider discipline, see the API Key Management Guide.
Rollout and change sequence
- Inventory: list sites, origins, current rule actions, policies, exceptions, API clients and console users.
- Secure management access: custom roles, approved IPs, expiring API clients stored in a secrets manager.
- Onboard in alert where unsure: new sites start with blocking for well-understood rules and alert for rules you need to tune.
- Lock the origin: new origin IP, Imperva-only allowlist, then mTLS.
- Tune and enforce: review Security Events, add narrow exceptions, then switch tuned rules to blocking actions.
- Add API Security: upload specifications in alert mode, then enforce by violation type.
- Manage as code: keep policies and rule actions in version control so every change is reviewed and can be reverted by re-applying the previous version.
Decision guidance
- IP allowlist versus mTLS: do both where you can. If the origin cannot hold a firewall allowlist (some managed platforms), mTLS becomes the main control; an origin secret header alone is a documented, accepted-risk fallback.
- Block user versus block IP: consumer apps behind shared IPs suit block user; APIs called by a known set of servers can use block IP.
- Small estates: configure per site, focus on origin lockdown and rule actions, and use one or two account policies.
- Large or multi-account estates: build baseline account policies, manage everything through Terraform with peer review, and report exception counts per site.
Detection and measurement
- Logs: Imperva states it does not keep access logs for customers, so a SIEM log subscription is needed to pull or push logs into your own repository. Configure security event and audit trail feeds.
- Origin monitoring: watch origin access logs for any request whose source is not an Imperva range, which indicates a bypass path.
Metrics:
- Percentage of sites whose origin rejects non-Imperva traffic (tested, not assumed).
- Percentage of sites using Imperva-to-origin mTLS.
- Number of rules in alert-only mode per site, and their age.
- Count of IP allowlist entries and exceptions without an owner or past their review date.
- Percentage of API endpoints covered by an enforced specification.
- API clients without an expiration date or unused for 90 days.
Framework mapping
| Imperva control | NIST CSF 2.0 | NIST SP 800-53 Rev. 5 | Threats addressed |
|---|---|---|---|
| WAF rules and API Security | PR.IR-01 | SC-7 Boundary Protection; SI-10 Information Input Validation | ATT&CK T1190 Exploit Public-Facing Application; CAPEC-66 SQL Injection; CAPEC-63 Cross-Site Scripting |
| DDoS settings | PR.IR-01 | SC-5 Denial-of-service Protection | T1498 Network Denial of Service; T1499 Endpoint Denial of Service |
| Origin lockdown and mTLS | PR.DS-02 | SC-7; SC-8 Transmission Confidentiality and Integrity | T1596 Search Open Technical Databases (origin discovery via certificate and DNS records) |
| Roles, approved IPs, expiring API clients | PR.AA-05 | AC-6 Least Privilege; IA-5 Authenticator Management | T1078.004 Cloud Accounts |
| Policy as code, SIEM and audit trail | PR.PS-01; DE.AE-02 | CM-6 Configuration Settings; AU-6 Audit Record Review | Unreviewed configuration drift |
Common failure patterns
- Reachable origin: the WAF is live but the origin still answers on its old, publicly recorded IP.
- Origin secret as the only control: a shared header that appears in logs and leaves the network path open.
- Alert mode forever: rules left in alert after onboarding because tuning never finished.
- Broad allowlists: partner or office IP ranges allowlisted so their traffic is never inspected.
- Specification drift: API Security enforced on an old OpenAPI file, causing blocks that lead teams to switch it off.
- Long-lived automation keys: API clients with no expiry, held in pipeline variables or Terraform state without protection.
Practitioner checklist
- Test every site's origin for direct reachability and move origins to unpublished IPs.
- Restrict origin ingress to Imperva ranges and keep the list current.
- Enable Imperva-to-origin mTLS on sensitive sites and require client certificates at the origin.
- Review every site's rule actions, including XSS, backdoor, bot and DDoS settings.
- Replace broad IP allowlists with narrow rule exceptions that have an owner and expiry.
- Upload OpenAPI specifications and move API Security from alert to enforcement by violation type.
- Give API clients expiry dates, store them in a secrets manager and rotate through the pipeline.
- Use custom roles and approved IPs for console users.
- Stream security events and the audit trail to your SIEM.
Standards and references
- Imperva: Terraform provider for Imperva Cloud (resource documentation)
- Imperva: Incapsula provider documentation on the Terraform Registry
- Imperva Community: Best Practices for Cloud WAF Settings
- Imperva Community: Origin protection using an origin secret
- Imperva Community: Cloud WAF Fundamentals questions and answers
- OWASP: API Security Top 10 2023
- MITRE ATT&CK: Exploit Public-Facing Application
Related NHI Mgmt Group resources: Web Application Firewall Guide · Securing the web application firewall (WAF) itself · Web application firewall (WAF) health check · mTLS Guide