System Resources Flashcards

(30 cards)

1
Q

FortiOS Architecture

A

Configuration Layer contains: CLI, GUI, API, and FortiManager

User Space: Application Processes

Kernel

Device Drivers

Hardware

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

FortiOS memory is

A

64 bit.

Kernel does not need to use memory paging to access the whole memory. Instead, it is all directly accessible.

diagnose hardware sysinfo memory:

MemTotal = Total amount of memory

MemFree = Total amount of free memory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

FGT memory is used for:

A

System I/O Cache
Kernel Memory Slabs
Buffers
Process Memory
Shared Memory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

System I/O Cache

A

There are no direct reads or writes made to HDD or flash disks. Each access is done through a cache held in memory.

Used to speed up hard disk and flash dis writing and reading operations:
Logging, WAN optimization, Explicit Proxy

Made of pages (4K size) of disk block (1K Size)

Two types of pages:
Active - Recently Accessed.

Inactive - Not used after some time. Might be reclaimed by the Kernel in case of Shortage.

Can use the diagnose memory command here to check usage for these.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Slabs

A

Collections of objects with a common purpose. Used by the Kernel.

Examples are:
tcp_session
ip_session
ip_dst_cache
buffer_head
inode_cache
dentry_cache
arp_cache

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Command to check Slab memory

A

diagnose hardware sysinfo slab

Three colums in the output:
Active Objects, Available Objects, Object Size

Total Slab size = available times size

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Command to see processes that are using the most CPU or Memory

A

diagnose sys top

To sort by CPU usage, press c

To sort by RAM, press m

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Process Name: fgfmd

A

For FortiManager connections

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Process Name: forticron

A

For Scheduling

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Most Common Processes

A

cmdbsrv - applies config changes
miglogd - Logs collection and automation stitches
httpsd - GUI access
sslvpnd - SSL VPN
updated - FortiGuard updates
wad - WAN optimization, explicit proxy, proxy-based inspection for HTTP and HTTPS, and FTP
scanunitd - File Scanning
iked - IPsec
hatalk, hasync - HA protocol and sync
urlfilter - FortiGuard web filtering
authd - User authentication
fssod - FSSO
proxyworker - Proxy-based inspection for IMAP, POP, SMTP

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Process States

A

S = Sleeping
R = Running
D = Do Not Disturb
Z = Zombie

S,R, and D(short periods) are normal.

Abnormal are Z and D(longer periods)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Shared Memory (SHM)

A

Allocated Dynamically
Allows the sharing of information among multiple processes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

System information Command

A

get system status

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Resource Use Command

A

get system performance status

also shows info on UTM such as number of viruses caught and number of attacks blocked by IPS.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Conserve Mode

A

Triggered based on Memory use. Prevents using so much memory that FGT becomes unresponsive.

Thresholds:
Extreme - FGT starts dropping new sessions. 95% is default
Red - Enters conserve Mode. 88
Green - Exits conserve mode. 82

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Logs in Conserve Mode

A

When in conserve mode, the GUI can be unresponsive. Use commands below.

execute log filter category 1
execute log display

diagnose debug crashlog read

17
Q

Command to check if FGT is in Conserve mode

A

diagnose hardware sysinfo conserve

18
Q

During Conserve mode, FortiOS activates certain protection measures:

A

System Config cannot be changed (because it might increase memory usage)

FGT skips quarantine actions (including FortiSandbox analysis)

19
Q

For proxy-based inspected traffic during conserve mode:

A

av-failopen settings defines the action that is applied when not exceeding the extreme threshold:

config system global
set av-failopen [off | pass | one-shot]
end

off: all new sessions with content scanning enabled are not passed
pass (default) : All new sessions pass without traffic inspection
one-shot: Similar to pass in that traffic is not inspected. However, it will keep bypassing the AV proxy even after leaving conserve mode. Admins must either change this setting or restart the device in order for AV to start scanning again.

this setting also applies to flow-based AV inspection.

20
Q

Fail-Open Session Setting

A

This setting controls how FortiOS handles a session when it exhausts available sockets to process proxy-based inspection:

config system global
set av-failopen-session [enable | disable]

enable - Sessions are allowed
disable (default) - block all new sessions that require proxy-based inspection

21
Q

Memory Tension Drops

A

Kernel deletes oldest sessions if it cannot allocate more memory pages

No direct link with conserve mode.

in output of diagnose sys session stat

memory_tension_drop=X

22
Q

Ephemeral Drops

A

Ephemeral = A TCP session is not fully established or a UDP with only a single packet received

These types of open sessions are common in DoS attacks

To protect memory use, FortiOS sets a limit on the total number of ephemeral sessions(based on FGT model)

From diagnose sys session stat output
ephemeral= current session count / max number

23
Q

Memory Optimization

A

Disable features that are not required:
Inspection of specific protocols(HTTP, FTP, SMTP, POP, IMAP)
Logging to memory
DHCP server
Some IPS signatures

Reduce maximum file size to inspect (10MB is default):
config firewall profile-protocol-options
edit (profile_name)
config (protocol)
set oversize-limit (MB)
end

24
Q

TTL Memory Use Optimization

A

FortiGuard cache TTL:
config system fortiguard
set webfilter-cache-ttl (seconds - 3600 is default)
set antispam-cache-ttl (seconds - 1800 is default)
end

Reduce session TTL: Global for TCP = config system session-ttl (seconds - 2600 is default)
For UDP = config system global
set udp-idle-timer (seconds - 180 is default)

Reduce DNS cache
config system dns
set dns-cache-ttl (seconds - 1800 is default)
end

For each service:
config system session-ttl
config port
edit (id)
set timeout (seconds)
end

For each firewall policy
config firewall policy
edit (id)
set session-ttl (seconds - 3600 is default)

For each application control
config application list
edit (name)
config entries
edit (id)
set session-ttl (seconds)
end
end

25
TCP Session Timers
Reduce these for Memory use: config system global set tcp-halfclose-timer 30 (default is 120) set tcp-halfopen-timer 8 (default is 10) set tcp-timewait-timer 1 (default is 1) end halfopen is how long ,after a SYN packet was sent, the session remains in the table without SYN/ACK response halfclose is how long a session remains after a FIN packet without out FIN/ACK response timewait-timer is how long a session remains in the table after a FIN/ACK packet was sent. This allows for any out-of-sequence packets to be received
26
Console Logging
Available on only certain models Records console CLI output in a 4 MB log file on flash memory Useful for troubleshooting unexpected restarts and unresponsive devices. Can be displayed on the CLI or downloaded from GUI diagnose debug comlog (enable | disable) disabled is default To read the console logging: diagnose debug comlog read to clear it: diagnose debug comlog clear to display logging settings: diagnose debug comlog info
27
After an Unexplained Restarts,
A crash dump is usually generated through the console Check for logs, console logs, crash log. If console logs not supported, keep a laptop connected to the console port and capture the crash dump message
28
After the FortiGate freezes,
Keep a laptop connected to console port In multi-CPU platforms, enable non-maskable interrupt (NMI) watchdog: diagnose sys nmi-watchdog enable (crashes the system if it has not scheduled any daemon in 10 minutes) There might also be a physical NMI button, but not all models have it.
29
Crash Log
Each time an application crashed, or closes, an entry is generated in the crash log. When it does, it records the name of the application, the time it crashed, and the termination signal.
30
Termination Signals
to kill a process: diagnose sys kill (term_signal) (process_id) signal numbers: 4 - Illegal Instruction 6 - Abort command from FortiOS 7 - Bus Error 9 - Unconditional Kill (this one is recommended if killing manually) 11 - Invalid memory reference 14 - Alarm Clock 15 - Graceful Kill can also be done on GUI: Profile(top right corner) > System > Process Monitor. To generate a crash log, select Kill&Trace in the Kill Process field.