Pensure
Plan a test
← News and insights
WAF · Technical Guide

Testing Past the WAF: How to Reach the App Safely

A practical technical guide to giving an authorised penetration test a narrow, temporary path through Vercel, Cloudflare, Akamai or AWS WAF without dropping the rest of your security controls.

Your WAF blocks the first test payload. Good. That tells us the edge control saw the request and did its job.

It does not tell us whether the application behind it is secure.

If every assessment request stops at the edge, the engagement can quietly turn into an expensive test of Akamai, Cloudflare, AWS WAF or Vercel. Your application, APIs, authentication and business logic remain largely unanswered questions.

The better approach is dual-path testing: test the service through its normal protections, then use a narrow, temporary and monitored exception to assess the application behind them.

Two paths answer two different questions

The protected path keeps your normal WAF, CDN, bot-management and rate controls in place. It shows what those controls recognise and stop today.

The controlled path lets authorised Pensure traffic pass only the edge controls that prevent the assessment. Application authentication, authorisation, logging, monitoring, network boundaries and every out-of-scope control stay on.

Together, those paths answer:

  1. Can an attacker reach the weakness through the service as it is exposed now?
  2. Does the weakness still exist behind the edge if a rule is bypassed, misconfigured, applied inconsistently or changed later?

That distinction matters. A blocked injection payload may show that a managed rule worked. It does not prove the vulnerable code is absent. At the same time, broken access control, tenant-isolation failures and business-logic abuse often look like perfectly ordinary requests and can sail straight through a WAF.

Build the narrowest exception your platform supports

The preferred rule matches all available conditions:

  • a fixed Pensure source IP or IP set;
  • the exact approved hostname and, where practical, path or API;
  • a unique, high-entropy engagement header where the platform supports it;
  • the approved environment; and
  • a short activation window tied to the assessment.

The logic should look like this:

IF source IP is in Pensure_Test_IPs
AND request host is in Approved_Test_Hosts
AND engagement header exactly matches the agreed value
THEN skip only the controls blocking authorised testing
ELSE apply the normal security policy

Use AND, not OR. A rule that accepts either the IP address or the header is much broader than it first appears.

The engagement header must be unique to the test and exchanged through the agreed secure channel. Do not reuse a production credential, API key or session token. Keep the value out of ordinary email, tickets, screenshots, source code and long-lived documentation. Redact it from logs where your platform supports that, then revoke it when testing finishes.

Keep the controls that still matter switched on

A controlled WAF exception should not flatten the rest of your security architecture. Keep these controls active unless the rules of engagement explicitly say otherwise:

  • TLS and certificate validation;
  • application login, MFA and session controls;
  • role, tenant and object-level authorisation;
  • application, infrastructure, WAF and security-event logging;
  • SIEM, SOC and endpoint monitoring;
  • network segmentation and origin restrictions;
  • protections for every out-of-scope host, path and environment; and
  • the normal incident, change and emergency-stop process.

Only skip the managed WAF rule, bot challenge, CAPTCHA, reputation control or rate policy that prevents the agreed test profile. Avoid exposing the origin directly to the internet. That creates a new risk instead of a controlled test route.

Prove the rule before active testing

Start with the platform’s preview, staging, count or log mode where one exists. Capture a protected-path baseline, then test the rule from both sides.

Confirm that:

  • a normal request still follows the existing security policy;
  • the right IP without the engagement header does not bypass;
  • the header from an unapproved source does not bypass;
  • a valid request to the wrong host or path does not bypass;
  • a fully authorised request skips only the intended edge controls;
  • application authentication and authorisation still apply; and
  • matches are visible without logging the header value.

Do this before the assessment window. Debugging an over-broad rule while a penetration test is running is nobody’s idea of a relaxed afternoon.

Mistakes worth catching in the change review

Most unsafe exceptions come from ordinary configuration mistakes rather than exotic attacks. Check for these before approval:

  • OR logic between source IP and the engagement header;
  • wildcards covering every hostname or path;
  • a broad Allow action that stops all later rules from running;
  • a bypass placed after an earlier terminating Block or Challenge rule;
  • assumptions that a WAF exception also covers bot management, rate limits or platform DDoS controls;
  • a proxy changing the client IP that the WAF actually sees;
  • the active header value appearing in logs or support records; and
  • no named owner or scheduled action to remove the rule.

Close the path and prove it is closed

When testing finishes, disable or delete the exception, revoke the engagement header and remove temporary IP objects where appropriate. Repeat a representative request and confirm that it follows the normal protected path again.

Keep the change record, validation evidence and relevant request identifiers. Do not keep the active secret.

If your platform cannot express a sufficiently narrow exception, stop before switching controls off globally. A production-equivalent staging service, dedicated test hostname, customer-managed VPN, mTLS gateway or temporary reverse proxy may provide a safer route.

The goal is simple: test the perimeter and the application, without confusing one for the other.

Ready for a clearer next step?

Turn uncertainty into a defined testing plan.

Plan a test