Skip to content
Guides & References

FortiOS operational standards

Worked examples for FortiOS operational standards: your NTP, syslog and DNS servers, a pre-login banner, interface descriptions, hostnames and SNMP location.

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

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.

Definition
// 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"
passPassing config: Operational standards sample (FortiOS 7.4.4, synthetic)
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.2
end

Why: Both standard servers are there.

failFailing config: Hardened FortiGate 60F sample (FortiOS 7.4.4, synthetic)
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.6
end

Why: These are NTP servers, but not the standard ones.

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
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.

Definition
// 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'
passPassing config: Operational standards sample (FortiOS 7.4.4, synthetic)
config log syslogd setting
set status enable
set server "192.0.2.20"
set mode udp
set port 514
end
config log syslogd2 setting
set status enable
set server "192.0.2.21"
set mode udp
set port 514
end

Why: Both standard servers are set and on.

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

ConfigRule resultOverall result
Passing configpassPASS
Failing configfailFAIL

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.

Definition
// 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.31
passPassing config: Operational standards sample (FortiOS 7.4.4, synthetic)
config system dns
set primary 192.0.2.30
set secondary 192.0.2.31
set domain "example.com"
end

Why: Both standard servers are set.

failFailing config: Hardened FortiGate 60F sample (FortiOS 7.4.4, synthetic)
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"
end

Why: These are DNS servers, but not the standard ones.

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
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.

Definition
// 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 enable
passPassing config: Operational standards sample (FortiOS 7.4.4, synthetic)
config system global
set admintimeout 10
set hostname "dub-fw01"
set pre-login-banner enable
set strong-crypto enable
end

Why: The pre-login banner is on.

failFailing config: FortiGate 100F sample (FortiOS 7.4.4, synthetic)
config system global
set admintimeout 15
set hostname "office-fw01"
set strong-crypto enable
end

Why: There is no set pre-login-banner enable 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
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.

Definition
// 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'
passPassing config: Operational standards sample (FortiOS 7.4.4, synthetic)
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
next
end

Why: wan1 has a description. wan2 is set to status down.

failFailing config: Hardened FortiGate 60F sample (FortiOS 7.4.4, synthetic)
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
next
end

Why: wan1 is up and has an alias, but no description.

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
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.

Definition
// 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'
passPassing config: Operational standards sample (FortiOS 7.4.4, synthetic)
config system global
set admintimeout 10
set hostname "dub-fw01"
set pre-login-banner enable
end

Why: dub, fw, 01: it fits the pattern.

failFailing config: Hardened FortiGate 60F sample (FortiOS 7.4.4, synthetic)
config system global
set admintimeout 10
set hostname "branch-fw01"
set pre-login-banner enable
end

Why: branch has six letters, not three.

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
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.

Definition
// 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'
passPassing config: Operational standards sample (FortiOS 7.4.4, synthetic)
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"
end

Why: A location is set.

failFailing config: Operational standards sample (FortiOS 7.4.4, synthetic), changed: location line removed
config system snmp sysinfo
set status enable
set description "Example perimeter firewall"
set contact-info "noc@example.com"
end

Why: There is no set location 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
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.


Type to search.