Request shield: the switches
The switches sit at the top of the dashboard (Setup > Request shield). They are shown to users with the policy
requestshield/manage; everyone else with requestshield/read sees the dashboard without them.
Contents
- The switches at a glance
- Pause and Switch on
- Enforce, Monitor and Off
- When a switch is refused
- Who switched what
The switches at a glance
| Switch | What it changes | Takes effect |
|---|---|---|
| Pause | creates var/request-shield/PAUSED | on the next request, on every server |
| Switch on | removes var/request-shield/PAUSED | on the next request, on every server |
| Enforce, Monitor, Off | rewrites the set mode line of the site's main rule file | within the rules' recheck seconds (10 by default) |
Each switch is a button in a form posted with the form token, and ends back on the dashboard with a message that says what was done.
Pause and Switch on
Pause is the quickest way to take the shield out of the way: while var/request-shield/PAUSED exists, the
shield decides nothing and every request reaches the site as if it were not installed. Nothing in the rules changes.
Use it when you suspect the shield of something and want to know at once.
Switch on removes the file. The same works from a shell: create or remove var/request-shield/PAUSED.
Enforce, Monitor and Off
The mode buttons change the mode of the rules:
- Enforce: the decisions are carried out. This is how the shield is installed.
- Monitor: every decision is only logged, nobody is refused. See Monitor and enforce.
- Off: nothing is decided.
A mode switch:
- uses the site's main rule file (
settings/request-shield/request-shield.rules, or the fileconfig.phpnames). While the extension's default file is in use, the first switch makes the site's own file from it and copies the threeexponential*.rulesnext to it; from then on the site's file is used; - keeps the previous file in
var/request-shield/backup/(its name, the date and a short hash); - compiles the new rules; when they do not compile, it puts the previous file back and says why.
The strict mode is not on a button: it stays a decision written in the rule file.
When a switch is refused
A switch is refused, with the reason, when the web server cannot write the rule file or its directory (for a mode),
or var/request-shield/ (for a pause). The buttons are then disabled. Ask whoever looks after the server to make the
files writable by the user the site's PHP runs as, or to make the change on the server.
Who switched what
Every switch is written to var/log/requestshield.log with the user's login and id and the outcome. You can read it
in Setup > Log files.