FortiOS logging
Rules for sending logs off the firewall. A copy off the device survives a reboot, and an attacker on the device cannot delete it. They come from the fortios-logging policy template.
Every example on this page was checked with rConfig Pro's policy engine on Each of the 4 configs below was run through rConfig Pro’s evaluator with the rule above it, and gave the result shown. The configs are sanitised excerpts of the sample configs that come with the template. A card marked changed has one line edited to show a failure.
All the rules come from fortios-logging.policy in the policy templates (v1.5.0). Import the whole file with Import Templates (see importing a policy template), or copy one rule into your own definition. The Fortinet FortiOS templates page lists the file’s known limitations. Run the rules against show full-configuration.
| Rule | Method | Since |
|---|---|---|
| Remote syslog on UDP 514 | evaluate_block |
8.3.0 |
| Syslog severity | evaluate_block |
8.3.0 |
Remote syslog on UDP 514
This rule checks config log syslogd setting. Syslog must be on, have a server, and use UDP on port 514. If your syslog server uses TCP or another port, change the rule to match.
// Remote syslog is enabled with a server on UDP port 514 (config log syslogd setting)#[evaluate_block]scope: ^config log syslogd setting$all: - equals: set status enable - regex: '/^\s*set server "?[^"\s]/m' - equals: set port 514 - equals: set mode udpconfig log syslogd setting set status enable set server "192.0.2.50" set mode udp set port 514 set source-ip 192.0.2.6endWhy: Syslog is on, with a server, on UDP 514.
config log syslogd setting set status enable set server "192.0.2.50" set mode reliable set source-ip 192.0.2.2endWhy: The mode is reliable (TCP), not udp, and there is no port 514 line.
Expected result in rConfig, with this rule as the only rule in a definition:
| Config | Rule result | Overall result |
|---|---|---|
| Passing config | pass | PASS |
| Failing config | fail | FAIL |
Framework mapping. The rule provides evidence towards these controls. It does not certify anything.
| Framework | Reference |
|---|---|
| NIST SP 800-53 | AU-2, AU-12 |
| NIST CSF 1.1 | DE.CM-1 |
| HIPAA (45 CFR) | 164.312(b) |
| ISO/IEC 27001:2022 Annex A | A.8.15 |
Tested with: sample excerpts from FortiOS 7.4.4 (synthetic). Minimum rConfig 8.3.0 (evaluate_block). Editions: Pro, Vector, Enterprise.
Syslog severity
The filter decides which messages go to the syslog server. information or notice sends the useful events without flooding the server. This rule checks config log syslogd filter for one of those two.
// The syslog filter severity is information or notice (config log syslogd filter)#[evaluate_block]scope: ^config log syslogd filter$any: - equals: set severity information - equals: set severity noticeconfig log syslogd filter set severity informationendWhy: The severity is information.
config log syslogd filter set severity debugendWhy: debug is not information or notice.
Expected result in rConfig, with this rule as the only rule in a definition:
| Config | Rule result | Overall result |
|---|---|---|
| Passing config | pass | PASS |
| Failing config | fail | FAIL |
Framework mapping. The rule provides evidence towards these controls. It does not certify anything.
| Framework | Reference |
|---|---|
| NIST SP 800-53 | AU-2, AU-12 |
| HIPAA (45 CFR) | 164.312(b) |
| ISO/IEC 27001:2022 Annex A | A.8.15 |
Tested with: sample excerpts from FortiOS 7.4.4 (synthetic). Minimum rConfig 8.3.0 (evaluate_block). Editions: Pro, Vector, Enterprise.
Related reference
- Fortinet FortiOS policy templates: every rule in
fortios-logging.policy, its references and known limitations. - Policy Definitions: the definition file format and every method.
- Policy Assignments: run a definition against your devices.
- Policy Compliance Results: read the pass and fail results.