Protecting a server running web applications
You can use a web application firewall profile to protect a server that is running a web application, such as webmail.
Web application firewall profiles are created with a variety of options called signatures and constraints. Once these options are enabled, the action can be set to allow, monitor, or block. The severity can be set to high, medium, or low.
In the following example, the default profile will be targeted to block SQL injection attempts and generic attacks.
The web application firewall feature is only available when the policy inspection mode is proxy-based. |
To protect a server running web applications:
- Enable the web application firewall:
- Go to System > Feature Visibility.
- Under Security Features, enable Web Application Firewall.
- Click Apply.
- Edit the default web application firewall profile (Trojans and Known Exploits are blocked by default):
- Go to Security Profiles > Web Application Firewall and edit the default profile signature.
- Select SQL Injection (Extended) and edit it so that it is enabled, the Action is set to Block, and the Severity is set to High.
- Click OK.
- Enable Generic Attacks (Extended) and edit it so that it is enabled, the Action is set to Block, and the Severity is set to High.
- Click OK.
- Click OK.
- Apply the profile to a security policy:
- Go to Policy & Objects > Firewall Policy and edit the policy that allows access to the web server.
- For Firewall / Network Options, select the appropriate Protocol Option.
- For Security Profiles, enable Web Application Firewall and set it to use the default profile.
- Set the SSL Inspection to use the deep-inspection profile.
- Configure the other settings as needed.
- Click OK.
- Verify that the web application firewall blocks traffic:
- Use the following URL to simulate an attack on your web server and substitute the IP address of your server:
http://<server IP>/index.php?username=1'%20or%20'1'%20=%20'1&password=1'%20or%20'1'%20=%20'1
An error message appears, stating that the web application firewall has blocked the traffic:
- Use the following URL to simulate an attack on your web server and substitute the IP address of your server:
Offloading to a FortiWeb
If you have a FortiWeb, you may be able to offload the functions of the web application control to your FortiWeb. To find out if this option is available, refer to the FortiOS or FortiWeb Release Notes for information about device compatibility.
To offload to a FortiWeb:
- Go to Security Fabric > Fabric Connectors.
- Click Create New, and click Fabric Device.
- Enter the following for the device:
- Name (
FortiWeb
) - FortiWeb IP address
- HTTPS service port
- Name (
- Click Generate.
- Enter your credentials to generate the access token.
- Click OK.