Can I enable or disable WAF on several vServices at once?
Short answer
Yes. In WAF-Protected vService List, Enable is clicked, the desired number of vServices are selected in the HTTP vServices to WAF field and WAF is enabled on them in a single operation with Add; to disable, the checkboxes of the rows in the list are checked and Disable is clicked. Disable does not ask for confirmation, and the bulk selection box in the column heading selects all the filtered rows. In WEB-CLI, with lb service update-many target selected, the vService IDs are written to the --ids.N fields and --waf true or --waf false is given (bulk update). Enabling requires a WAF - WAAP license, disabling does not. The Enable and Disable in the Load Balancer vService List, on the other hand, change the running state of the vService, not WAF.
Problem: WAF Is to Be Enabled and Disabled on Many vServices
WAF needs to be enabled or disabled on several vServices in a single operation, without opening the form of each one individually. Since WAF is enabled per vService (what enabling WAF means), the bulk operation changes the WAF switch of every selected vService at the same time; the settings and the modes remain separate per vService.
Solution: Two Methods
| Your situation | Suitable method |
|---|---|
| From the interface | Method 1: WAF-Protected vService List |
| From the command line or with a script | Method 2: WEB-CLI |
Method 1: WAF-Protected vService List Recommended
- How it worksEnable enables WAF on all the selected HTTP vServices, and Disable disables it on all the rows selected with the checkboxes. There is no upper limit on the number of vServices that can be selected; the operation is applied at once.
- Where it is opened Configuration Menu → WAF → WAF-Protected vService List
- Requirement Modify permission in the WAF area; a WAF - WAAP license for enabling
- vService type HTTP
Step-by-Step Configuration
The Configuration Menu is opened with the TR7 logo at the bottom left and WAF → WAF-Protected vService List is selected (how to access).
Enable on the toolbar is clicked; a tab titled Add opens next to the list.
In the HTTP vServices to WAF field, the vServices are selected. The field lists only the HTTP vServices with WAF off; the stopped vServices are also in the list.
Add is clicked; the tab closes and the selected vServices appear in the list. Every vService enabled for the first time starts in Learning Mode; a vService that had WAF enabled before returns with its saved configuration.
In the list, the checkboxes at the beginning of the rows of the vServices to be disabled are checked. The bulk selection box in the column heading selects all the rows filtered at that moment, including those on the other pages; the number of selected rows is seen as N selected in the Page Information field.
Disable on the toolbar is clicked; no confirmation window appears and WAF is turned off immediately on all the selected vServices. In both operations, the change is applied without dropping the open connections. In a cluster setup, with the default auto-sync, the change is also sent to the peer device automatically; if Manual Sync Mode is on, it is sent to the peer device manually.
Verification
On the WAF-Protected vService List screen, the WAF mode and OWASP Protection Level columns of the enabled vServices are checked.
WAF mode: 1 Learning · OWASP protection level: Very tightMethod 2: WEB-CLI
- How it works
update-manywrites the samewafvalue to all the selected vService records at once (bulk update). - Where it is openedWEB-CLI →
lb service update-many - Requirement WEB-CLI access; a WAF - WAAP license for enabling
- vService type HTTP
Step-by-Step Configuration
The IDs are read from the list:
lb service listThe IDs from step 1 are written in place of <vService-1> and <vService-2>; a --ids.N field is added for each vService. To disable, false is written instead of true:
lb service update-many target selected --ids.0 <vService-1> --ids.1 <vService-2> --waf trueIf --ids.N is not given, a selection list opens. The command writes how many records will be affected and asks for confirmation; nothing is written without confirmation. With --onError at its default abort value, if one of the targets does not pass validation, no record is written.
Verification
The record of each vService is displayed.
Command: lb service show <vService-1>
true in the waf rowCommon Mistakes
- Using the bulk Enable and Disable in the Load Balancer vService List. That operation starts or stops the vServices (Can I enable, disable or delete multiple vServices at the same time?).
- Assuming the bulk selection box selects only the visible page. The box selects all the filtered rows, including those on the other pages; Disable also runs on all of them without asking for confirmation.
- Assuming all the vServices will start in Learning mode on bulk enabling. A vService enabled for the first time starts in Learning Mode; a vService that had WAF enabled before returns with its saved mode (If I remove WAF protection, are the learned rules and settings deleted?).
- Assuming bulk enabling also equalizes the WAF settings. Enable turns on only the WAF switch; the mode, the protection level and the other settings remain separate per vService.
How it is done in the documentation
