Skip to content
Guides & References

FortiOS logging

Worked examples for the FortiOS logging template: remote syslog on UDP port 514, and a syslog filter severity of information or notice.

Policy LibraryUpdated
Platform
fortinet-fortios
Minimum version
rConfig 8.3.0
Editions
Pro, Vector, Enterprise
On this page

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.

Definition
// 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 udp
passPassing config: Hardened FortiGate 60F sample (FortiOS 7.4.4, synthetic)
config log syslogd setting
set status enable
set server "192.0.2.50"
set mode udp
set port 514
set source-ip 192.0.2.6
end

Why: Syslog is on, with a server, on UDP 514.

failFailing config: FortiGate 100F sample (FortiOS 7.4.4, synthetic)
config log syslogd setting
set status enable
set server "192.0.2.50"
set mode reliable
set source-ip 192.0.2.2
end

Why: 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:

ConfigRule resultOverall result
Passing configpassPASS
Failing configfailFAIL

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.

Definition
// 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 notice
passPassing config: Hardened FortiGate 60F sample (FortiOS 7.4.4, synthetic)
config log syslogd filter
set severity information
end

Why: The severity is information.

failFailing config: Hardened FortiGate 60F sample (FortiOS 7.4.4, synthetic), changed: severity debug instead of information
config log syslogd filter
set severity debug
end

Why: debug is not information or notice.

Expected result in rConfig, with this rule as the only rule in a definition:

ConfigRule resultOverall result
Passing configpassPASS
Failing configfailFAIL

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.


Type to search.