Loading...

CDN.com.tr Help

WAF log-only mode: try the rules before they block

Put the WAF in log-only mode for the whole site or for the paths you choose, for 7, 14 or 30 days. The WAF rules keep inspecting every request and write the ones they would have blocked to the logs as "would have been blocked", but block none of them. When the period ends, the account goes back to blocking by itself.

WAF log-only mode: try the rules before they block

Put the WAF in log-only mode for the whole site or for the paths you choose, for 7, 14 or 30 days. The WAF rules keep inspecting every request and write the ones they would have blocked to the logs as "would have been blocked", but block none of them. When the period ends, the account goes back to blocking by itself.

Next steps

Detailed guides for reading the logs and adding exceptions.

Read WAF logs

Reference ID lookup, repeated blocks and the exception form.

Open topic

What is a WAF?

What WAF rules catch and how false positives are handled.

Read the guide

Panel path

  1. Management Panel
  2. CDN Accounts
  3. Security Events
  4. Log-only mode

Prerequisites

  • The site-wide WAF is on.
  • You are the owner or an editor on the account.

Step-by-step guide

1

Turn the mode on

Apply log-only mode to the whole site or only to the paths you want to try.

  • Find the Log-only mode card on the Security Events page.
  • Choose Log only (whole site) for everything, or Log only (these paths) and enter the paths, for example /api/ and =/login.
  • Pick the duration and press Save.

Expected result: The card shows the end date and the days left; the edge servers apply the change within 1-2 minutes.

cdnctl equivalent
# API: GET /api/accounts/$ACCOUNT_UUID/waf/mode
# API: PUT /api/accounts/$ACCOUNT_UUID/waf/mode
# {"mode":"detect","scope":"paths","paths":["/api/","=/login"],"days":14}
2

Review what would have been blocked

While the mode is on, the requests the WAF would have blocked are listed under their own filter.

  • Set the Show filter to Log only (would have been blocked) and choose a time range.
  • Look at the URI, attack type and rule ID of each row: legitimate requests that repeat on the same path and rule are exception candidates.
  • Download the report as CSV or XLSX if you need the full list.

Expected result: You see which rule would stop your real visitors on which path, without anyone being blocked.

3

Add the exceptions and go back to blocking

Exceptions are permanent: they stay in force after the mode ends.

  • Under WAF exceptions, enter the rule and path (and the field, if the rule matched a single field) and press Add exception.
  • Once the logs are clean, choose Blocking on the card and save, or let the period run out.

Expected result: In blocking mode your legitimate requests go through and attack requests are blocked.

cdnctl equivalent
# API: GET /api/accounts/$ACCOUNT_UUID/waf/exclusions
# API: PUT /api/accounts/$ACCOUNT_UUID/waf/mode
# {"mode":"block"}

Use cases

You are adding a new form, checkout step or API to your site and want to see which requests the WAF would stop before any visitor gets blocked.

Quick workflow

  1. Open Security Events in the account menu. The site-wide WAF must be on: log-only mode applies to its rules.
  2. On the Log-only mode card, choose Log only (whole site) or Log only (these paths).
  3. For paths, enter one per line (up to 20). A path such as /api/ covers itself and everything under it; to cover only that exact address, start the line with = (=/login).
  4. Pick the duration: 7, 14 or 30 days. Press Save; the change reaches the edge servers within 1-2 minutes.
  5. In the logs on the same page, set the Show filter to Log only (would have been blocked) and review the requests that would have been blocked.
  6. For legitimate requests, add a WAF exception for that rule and path (and field, if needed). When you are ready, switch back to Blocking or let the period run out.

Checks

  • Only the WAF rules switch to logging. IP, country and ASN lists, the rate limit and the JavaScript challenge keep blocking throughout.
  • With paths selected, the WAF keeps blocking everywhere else.
  • Log-only mode always ends: when the period is over, the account goes back to blocking by itself. The account owner gets an e-mail 2 days before and when it ends.
  • The card shows until when the mode runs and how many days are left. Saving log-only mode again restarts the period.
  • The path list you saved stays in the form after the account goes back to blocking, ready for the next trial.

Frequently asked questions

Is my site unprotected in log-only mode?

No. In this mode only the WAF rules stop blocking and log their matches instead. IP, country and ASN blocks, the rate limit and the JavaScript challenge keep blocking. If you apply the mode only to your new feature's paths, the rest of the site stays protected by the WAF as well.

How do I read the "would have been blocked" entries?

On the Security Events page, set the Show filter to "Log only (would have been blocked)". Each row carries the "Would have been blocked (log only)" badge and shows the time, client IP, method, URI, attack type and rule ID. You can download the report as CSV or XLSX with the same filter.

A legitimate request shows up as "would have been blocked". What now?

Note the rule ID and the path from the row and add an exception for that rule and path (with the field, if the rule matched a single field) under WAF exceptions on the same page. The exception stays in force when you go back to blocking, so the same request is not blocked when the mode ends. The detailed steps are in Read WAF logs.

Can I go back to blocking before the period ends?

Yes. Choose Blocking on the card and save; the account blocks again within 1-2 minutes.

Can I manage this from the API?

Yes. GET /api/accounts/{account}/waf/mode returns the current mode, its end date and the days left; PUT to the same address with mode (block or detect), scope (site or paths), paths and days (7, 14 or 30) changes it.