FortiOS operational standards
Rules that check a firewall matches your standard, not a security benchmark. They catch drift: a firewall someone set up by hand with the wrong NTP server or hostname. They come from the fortios-operational-standards policy template.
Every example on this page was checked with rConfig Pro's policy engine on Each of the 14 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-operational-standards.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 |
|---|---|---|
| NTP servers | evaluate_block |
8.3.0 |
| Syslog servers | evaluate_block |
8.3.0 |
| DNS servers | evaluate_block |
8.3.0 |
| Pre-login banner | evaluate_block |
8.3.0 |
| Interface descriptions | evaluate_block |
8.3.0 |
| Hostname pattern | evaluate_block |
8.3.0 |
| SNMP location | evaluate_block |
8.3.0 |
NTP servers
Every firewall should get its time from the same servers, or log times will not line up. This rule checks config system ntp: NTP sync on, custom servers, and both standard servers.
// NTP servers are set to your standard (replace 192.0.2.10 and 192.0.2.11)#[evaluate_block]scope: ^config system ntp$all: - equals: set ntpsync enable - equals: set type custom - equals: set server "192.0.2.10" - equals: set server "192.0.2.11"config system ntp set ntpsync enable set type custom set syncinterval 60 config ntpserver edit 1 set server "192.0.2.10" next edit 2 set server "192.0.2.11" next end set source-ip 192.0.2.2endWhy: Both standard servers are there.
config system ntp set ntpsync enable set type custom set syncinterval 60 config ntpserver edit 1 set server "192.0.2.1" next edit 2 set server "192.0.2.2" next end set source-ip 192.0.2.6endWhy: These are NTP servers, but not the standard ones.
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 |
|---|---|
| None recorded | See Compliance frameworks |
Tested with: sample excerpts from FortiOS 7.4.4 (synthetic). Minimum rConfig 8.3.0 (evaluate_block). Editions: Pro, Vector, Enterprise.
Syslog servers
FortiOS has more than one syslog slot. This rule needs the first standard server in syslogd and the second in syslogd2, and both turned on.
// Syslog servers are set to your standard (replace 192.0.2.20 in syslogd and 192.0.2.21 in syslogd2)#[evaluate_block]all: - regex: '/^config log syslogd setting\n(?:(?!end$)[^\n]*\n)*?\s*set status enable$/m' - regex: '/^config log syslogd setting\n(?:(?!end$)[^\n]*\n)*?\s*set server "192\.0\.2\.20"$/m' - regex: '/^config log syslogd2 setting\n(?:(?!end$)[^\n]*\n)*?\s*set status enable$/m' - regex: '/^config log syslogd2 setting\n(?:(?!end$)[^\n]*\n)*?\s*set server "192\.0\.2\.21"$/m'config log syslogd setting set status enable set server "192.0.2.20" set mode udp set port 514endconfig log syslogd2 setting set status enable set server "192.0.2.21" set mode udp set port 514endWhy: Both standard servers are set and on.
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.6endWhy: 192.0.2.50 is not a standard server, and there is no syslogd2 setting.
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 |
|---|---|
| None recorded | See Compliance frameworks |
Tested with: sample excerpts from FortiOS 7.4.4 (synthetic). Minimum rConfig 8.3.0 (evaluate_block). Editions: Pro, Vector, Enterprise.
DNS servers
Both standard DNS servers must be set, as primary and secondary, in config system dns.
// DNS servers are set to your standard (replace 192.0.2.30 and 192.0.2.31)#[evaluate_block]scope: ^config system dns$all: - equals: set primary 192.0.2.30 - equals: set secondary 192.0.2.31config system dns set primary 192.0.2.30 set secondary 192.0.2.31 set domain "example.com"endWhy: Both standard servers are set.
config system dns set primary 192.0.2.53 set secondary 192.0.2.54 set protocol cleartext dot set server-hostname "dns.example.net"endWhy: These are DNS servers, but not the standard ones.
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 |
|---|---|
| None recorded | See Compliance frameworks |
Tested with: sample excerpts from FortiOS 7.4.4 (synthetic). Minimum rConfig 8.3.0 (evaluate_block). Editions: Pro, Vector, Enterprise.
Pre-login banner
The same check as the management access banner rule, repeated here so this file can stand alone.
// A pre-login banner is enabled (set pre-login-banner enable; nothing to replace)#[evaluate_block]scope: ^config system global$all: - equals: set pre-login-banner enableconfig system global set admintimeout 10 set hostname "dub-fw01" set pre-login-banner enable set strong-crypto enableendWhy: The pre-login banner is on.
config system global set admintimeout 15 set hostname "office-fw01" set strong-crypto enableendWhy: There is no set pre-login-banner enable 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 |
|---|---|
| None recorded | See Compliance frameworks |
Tested with: sample excerpts from FortiOS 7.4.4 (synthetic). Minimum rConfig 8.3.0 (evaluate_block). Editions: Pro, Vector, Enterprise.
Interface descriptions
A description says what each port is for. This rule checks every interface in config system interface. Each one must have a set description line or be set to status down. An alias does not count as a description.
// Every interface that is not set to status down has a description (nothing to replace)#[evaluate_block]scope: ^config system interface$not: regex: '/^ {4}edit "[^"]+"\n(?:(?! {4}next$)(?! {8}set (?:description "[^"]|status down$))[^\n]*\n)* {4}next$/m'config system interface edit "wan1" set vdom "root" set ip 203.0.113.2 255.255.255.248 set allowaccess ping set type physical set description "WAN uplink to provider" set role wan next edit "wan2" set vdom "root" set status down set type physical set role wan nextendWhy: wan1 has a description. wan2 is set to status down.
config system interface edit "wan1" set vdom "root" set ip 203.0.113.2 255.255.255.248 set allowaccess ping set type physical set role wan set alias "Internet" next edit "wan2" set vdom "root" set status down set type physical set role wan nextendWhy: wan1 is up and has an alias, but no description.
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 |
|---|---|
| None recorded | See Compliance frameworks |
Tested with: sample excerpts from FortiOS 7.4.4 (synthetic). Minimum rConfig 8.3.0 (evaluate_block). Editions: Pro, Vector, Enterprise.
Hostname pattern
A naming pattern makes firewalls easy to find and sort. The example pattern is three letters for the site, then fw, then two digits, such as dub-fw01.
// The hostname follows your naming pattern (replace the example pattern [a-z]{3}-fw[0-9]{2}, for example dub-fw01)#[evaluate_block]scope: ^config system global$all: - regex: '/^\s*set hostname "[a-z]{3}-fw[0-9]{2}"$/m'config system global set admintimeout 10 set hostname "dub-fw01" set pre-login-banner enableendWhy: dub, fw, 01: it fits the pattern.
config system global set admintimeout 10 set hostname "branch-fw01" set pre-login-banner enableendWhy: branch has six letters, not three.
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 |
|---|---|
| None recorded | See Compliance frameworks |
Tested with: sample excerpts from FortiOS 7.4.4 (synthetic). Minimum rConfig 8.3.0 (evaluate_block). Editions: Pro, Vector, Enterprise.
SNMP location
The SNMP location tells your monitoring tools where the firewall is. This rule passes when config system snmp sysinfo has a set location line with any text.
// An SNMP location is set (set location in config system snmp sysinfo, any text; nothing to replace)#[evaluate_block]scope: ^config system snmp sysinfo$all: - regex: '/^\s*set location "[^"]/m'config system snmp sysinfo set status enable set description "Example perimeter firewall" set contact-info "noc@example.com" set location "Example data centre, rack 12"endWhy: A location is set.
config system snmp sysinfo set status enable set description "Example perimeter firewall" set contact-info "noc@example.com"endWhy: There is no set location 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 |
|---|---|
| None recorded | See Compliance frameworks |
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-operational-standards.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.