system web-service
Use this command to configure web services on FortiMail, such as:
-
webmail or personal quarantines
-
Microsoft 365 or Google cloud connector API
-
administrative GUI
-
REST API
including redirects, enabling the REST API, and rate limits to prevent abuse.
|
|
If HTTPS or HTTP requests occur through a proxy or load balancer, for accurate logging, rate limits, and repeat offender control, consider |
|
|
Valid value ranges for certain commands vary by FortiMail model. See FortiMail Maximum Values. |
Syntax
config system web-service
set https-redirect-status {enable | disable}
set https-redirect-host <fortimail_fqdn>
set webmail-session-ttl <seconds_int>
set rest-api-status {enable | disable}
set client-ip-x-header-status {enable | disable}
set client-ip-x-header-name <key_str>
set max-concurrent-request-all <limit_int>
set max-concurrent-request-per-ip <limit_int
set max-concurrent-request-admin <limit_int>
set max-concurrent-request-webmail <limit_int>
set max-concurrent-request-ms365 <limit_int>
set max-concurrent-request-restful <limit_int>
config exempt-list
edit <list_index>
next
end
set max-active-session-admin <limit_int>
set max-active-session-restful <limit_int>
set max-request-rate-admin <limit_int>
set max-request-rate-webmail <limit_int>
set max-request-rate-ms365 <limit_int>
set max-request-rate-restful <limit_int>
set repeat-offender-status {enable | disable}
set repeat-offender-count <limit_int>
set repeat-offender-period <minutes_int>
config repeat-offender-exempt-list
edit <list_index>
next
end
end
|
Variable |
Description |
Default |
||||
|
Enter an IP address and netmask that you want to exempt from concurrent request rate limits. |
|
|||||
|
Enter a number to identify the entry in the table. |
|
|||||
|
Enter the name of the HTTP X-header. Do not include the colon ( This setting is used if |
X-Real-IP |
|||||
|
Enable to identify the IP addresses of clients behind a proxy or load balancer by using an HTTP X-header. Also configure In a network topology where web service clients connect through a proxy, load balancer, or web application firewall (for example, a FortiWeb that is not transparent), the source IP address in the IP packet header is changed to be the proxy itself instead of the original client. Therefore if any attacker or misconfigured agent exceeds the limits, then FortiMail would block the proxy — and therefore all innocent clients that connect through the proxy — not only the bad client. Log messages would also indicate that the problem is the proxy, instead of the real endpoint. To solve this:
|
disable |
|||||
| https-redirect-host <fortimail_fqdn> |
Enter the fully qualified domain name (FQDN) to use to use in HTTPS redirects for the FortiMail system. |
|
||||
| https-redirect-status {enable | disable} |
Enable to redirect insecure HTTP requests to secure access using HTTPS. This setting affects all FortiMail URLs: REST APIs, administrator GUI, FortiMail webmail, and personal quarantines. For this setting to take effect, you must also enable both HTTP and HTTPS access protocols on the network interface(s) that receive these connections. FortiMail cannot redirect HTTP if it is not listening for it. See allowaccess {ping http https snmp ssh telnet}.
|
disable |
||||
|
Enter an IP address that you want to exempt from the repeat offender list. This setting is used if |
|
|||||
|
Enter the maximum number of active administrator sessions. |
100 |
|||||
|
Enter the maximum number of active REST API sessions. |
50 |
|||||
|
Enter the maximum number of concurrent administrative GUI requests. |
50 |
|||||
|
Enter the maximum number of concurrent HTTP requests from all clients. |
0 |
|||||
|
Enter the maximum number of concurrent Microsoft 365 or Google API requests permitted. |
50 |
|||||
|
Enter the maximum number of concurrent HTTP requests for a single IP address. |
50 |
|||||
|
Enter the maximum number of concurrent REST API requests. |
50 |
|||||
|
Enter the maximum number of concurrent webmail or personal quarantine requests. Valid ranges and default setting varies by platform. For details, see FortiMail Maximum Values. |
100 |
|||||
|
Enter the maximum request rate per second for administrators. |
0 |
|||||
|
Enter the maximum request rate (per second) for Microsoft 365 or Google cloud APIs. |
50 |
|||||
|
Enter the maximum request rate per second to the REST API. |
50 |
|||||
|
Enter the maximum request rate per second for webmail or personal quarantines. |
0 |
|||||
|
Enter the threshold for how many bad requests within the time period will trigger repeat offender control. Valid range is 1 to 50. This setting is used if |
5 |
|||||
|
Enter the range of time in minutes during which to count the number of bad requests. Valid range is 1 to 120. This setting is used if |
5 |
|||||
|
Enable to block the IP addresses that repeatedly send HTTP requests to FortiMail that result in HTTP 404 or 405 errors. Also configure For example, if FortiMail receives 3 bad requests during a 5 minute interval, that IP address will be blocked for the remaining of the 5 minute interval. After the interval expires, the client IP address will be able to send requests again and the counter will restart for the next interval. |
disable |
|||||
| rest-api-status {enable | disable} |
Enable or disable access to the FortiMail REST API. For this setting to take effect, you must also enable HTTPS access protocols on the network interface(s) that receive these connections. FortiMail cannot respond to an API requestif it is not listening for it. See allowaccess {ping http https snmp ssh telnet}. |
disable | ||||
|
Enter the amount of time, in seconds, that an inactive FortiMail webmail session is still valid. Valid range is 0 to 600 seconds (10 minutes). To disable the session keepalive, enter While a webmail user is logged in, their browser periodically sends a request to FortiMail. This GUI heartbeat keeps the session alive — even if the user is idle (they do not open any email, etc.). Heartbeats are not sent if the
FortiMail waits for the heartbeat to reconnect. If it does not (the session time to live (TTL) elapses), then the session expires and the user is automatically logged out. Otherwise an idle session can continue until the idle timeout occurs (
|
180 |