Appearance
Protect from findings Since v0.2
From an issue to a protection that works while the code is fixed. Nothing applies by itself. You preview, the product tries it on normal traffic (the preflight), and you apply it as one audited policy version, which you can roll back.
Before you begin
- Role: global administrator.
- An issue on a scan target that is linked to one of this product's applications. Without a link, use Create an application from the target (below).
What is proposed
The proposal table is data in rules/mappings/protect.yaml. waap assess recommend -id ID shows the proposal for one issue and why.
| Issue | Proposal |
|---|---|
| The attack was seen and would have been refused, but the application (or its signatures) is in detect mode | Switch to block. No patch: it would be redundant. |
| An attack the product missed, in one of nine payload classes (SQL injection, XSS, path traversal, remote file inclusion, command injection, code injection, template injection, XXE, open redirect) | A virtual patch for that path, method and parameter. |
| An exposed file | An access rule refusing that path, placed first. |
| Missing frame protection, cookie flags, CSRF protection, unsafe CORS, version banners, error pages | The matching module setting (headers, cookies, CSRF, CORS). |
| Card numbers or national IDs in answers | Data leak prevention in masking mode. |
| Weak login (brute force) | A rate limit on that path: 10 requests per client per minute, a starting point. |
| Unsafe upload | File protection with upload rules for that path (executables and scripts refused). |
| Business logic flaws, object authorization (CWE 284, 285, 639, 862, 863, 840, 841) and anything else without a safe match | No automatic protection, said plainly. If the application has an API description that is not yet enforced, enforcing it is offered as a second proposal. |
A proposal says when it is broader than the one place found (a path with an identifier becomes a prefix), when the application is in detect mode (the protection then only reports), and what decides whether it blocks. Word-based matches (banners, error pages, data leaks) use the scanner's name for the issue, which is a heuristic.
A virtual patch from an issue blocks in detect mode
It is set to enforce: block: it refuses what it matches even while the application and the signatures module are in detect, and every other rule keeps its mode. For details, see Virtual patches.
Apply a protection
text
1. Open the issue, Protect now tab.
2. Read the proposal: title, why, notes, enforcement, and what else is proposed.
3. Select Preview the protection. It is tried on normal requests, and shows
the changes and any refusal.
4. Select Apply the protection. A conflict or refusal asks for a reason
to apply anyway.sh
waap assess recommend -id ISSUE
waap assess apply -dry-run -id ISSUE
waap assess apply -m "protect login" -id ISSUEWithout -dry-run, apply applies what it showed. The version it was read from must still be active. The protection is recorded on the issue with its policy version, who applied it and the preflight, also after a rollback. Applying the same proposal twice is refused, and a rollback frees it again. An apply does not change the issue's state: only a pass moves it (see The proof loop).
Preflight
Before a patch is applied, it is tried alone (the rest of the signatures are not asked) on the scan's normal browsing traffic (what the crawler and spider requested) and on a set of normal values for the patched field per class (O'Brien, a/b, https://<the application's host>/, and more in protect.yaml). A deny rule is checked against the paths normal browsing reached.
A conflict refuses the apply. You can still apply with an override reason (up to 500 characters, kept with the protection and in the audit log); the preview shows each conflict first. A node that cannot try a patch refuses it. Other proposals are validated as policy when previewed.
sh
waap assess apply -m "protect login" -override "reviewed the conflict: crawler hits /export" -id ISSUERoll a protection back
text
1. On the issue's Protect now tab, find the applied protection.
2. Select Preview the rollback to see how it will be taken out.
3. Select Roll the protection back.sh
waap assess unapply -m "no longer needed" -id ISSUE -protection PIDThe protection comes out as a new version. When nothing else changed since, the version before it comes back. Otherwise only the patches and rules it added are removed, and later changes stay.
Module settings cannot be taken out once other versions follow
A protection that changed module settings cannot be removed this way once other versions came after it. Restore it from the versions page or change the settings by hand.
Create an application from a target
If the target has no application, the issue page answers "no route through this product" and offers Create an application from the target.
text
1. Select Create an application from the target.
2. Review the preview of the changes. With several listeners, give a listener name.
3. Confirm.sh
waap assess create-app -m "from target" -target shop-uat -listener main -name shopIt makes the server pool (the target's connect address, or its URL's host and port; TLS when the URL is https) and an application for the URL's host, in detect mode, and links the target to it, as one version. A target that is already linked is refused. Review the events, then switch to block.
Sort refused normal requests into exclusions
A normal request that the product refused is either a correct refusal of a sensitive file (a repository folder, an environment file, a backup, the CRS restricted-file rule) or a candidate for an exclusion. An exclusion never skips inspection, and a sensitive file never gets one.
text
1. Under a pass through this product, select Review the refused requests.
Candidates are ticked by default.
2. If an exception overlaps an open issue, enter a reason (up to 500 characters).
3. Select Add the exceptions. The ticked ones apply as one configuration version.sh
waap assess exclude -assessment ID
waap assess exclude -apply -m "normal pages" -assessment ID
waap assess exclude -events REQ1,REQ2exclude takes the normal requests that the assessment's pass through this product refused (or would have, in detect), as recorded with their request IDs, at most 50 at a time. For each candidate it proposes the narrowest exclusion: the rules that fired, on that path and method, in the fields they fired in. Each proposal is cross-checked against the open attack and exposure issues of the scan targets linked to the application. An exclusion for the same place as an open issue shows the conflict and needs an override reason. Without a linked scan target, the cross-check is skipped, and the answer says so. For more on exclusions, see Rule exclusions.
API
All routes need the global administrator role.
| Route | Purpose |
|---|---|
GET /v1/assess/issues/{id}/recommend | The proposal. |
POST /v1/assess/issues/{id}/protect | Preview or apply (dry_run, base_version, override). |
POST /v1/assess/issues/{id}/protect/{protection}/rollback | Roll back. |
POST /v1/assess/targets/{name}/application | Create an application from a target. |
POST /v1/assess/exclusions | Exclusions (assessment or event_ids). |
Limits
| Limit | Value |
|---|---|
| Override reason | up to 500 characters |
| Refused requests sorted at a time | 50 |