Fortinet white logo
Fortinet white logo

CLI Reference

config ssh-filter profile

config ssh-filter profile

Note

This command is available for model(s): FortiGate 1000D, FortiGate 1000F, FortiGate 1001F, FortiGate 100F, FortiGate 101F, FortiGate 1100E, FortiGate 1101E, FortiGate 120G, FortiGate 121G, FortiGate 1800F, FortiGate 1801F, FortiGate 2000E, FortiGate 200E, FortiGate 200F, FortiGate 201E, FortiGate 201F, FortiGate 2200E, FortiGate 2201E, FortiGate 2500E, FortiGate 2600F, FortiGate 2601F, FortiGate 3000D, FortiGate 3000F, FortiGate 3001F, FortiGate 300E, FortiGate 301E, FortiGate 3100D, FortiGate 3200D, FortiGate 3200F, FortiGate 3201F, FortiGate 3300E, FortiGate 3301E, FortiGate 3400E, FortiGate 3401E, FortiGate 3500F, FortiGate 3501F, FortiGate 3600E, FortiGate 3601E, FortiGate 3700D, FortiGate 3700F, FortiGate 3701F, FortiGate 3960E, FortiGate 3980E, FortiGate 400E Bypass, FortiGate 400E, FortiGate 400F, FortiGate 401E, FortiGate 401F, FortiGate 4200F, FortiGate 4201F, FortiGate 4400F, FortiGate 4401F, FortiGate 5001E1, FortiGate 5001E, FortiGate 500E, FortiGate 501E, FortiGate 600E, FortiGate 600F, FortiGate 601E, FortiGate 601F, FortiGate 70F, FortiGate 71F, FortiGate 800D, FortiGate 80F Bypass, FortiGate 80F DSL, FortiGate 80F-POE, FortiGate 80F, FortiGate 81F, FortiGate 900D, FortiGate 900G, FortiGate 901G, FortiGate 90G, FortiGate 91G, FortiGate VM ARM64 for Azure, FortiGate VM ARM64 for GCP BYOL, FortiGate VM ARM64 for OCI BYOL, FortiGate VM for Aliyun PAYG, FortiGate VM for AWS PAYG, FortiGate VM for Azure BYOL, FortiGate VM for Azure PAYG, FortiGate VM for GCP BYOL, FortiGate VM for OPC BYOL, FortiGate VM64, FortiGateRugged 70F 3G4G, FortiGateRugged 70F, FortiWiFi 80F 2R 3G4G DSL, FortiWiFi 80F 2R, FortiWiFi 81F 2R 3G4G DSL, FortiWiFi 81F 2R 3G4G-POE, FortiWiFi 81F 2R-POE, FortiWiFi 81F 2R.

It is not available for: FortiGate 40F 3G4G, FortiGate 40F, FortiGate 60F, FortiGate 61F, FortiGateRugged 60F 3G4G, FortiGateRugged 60F, FortiWiFi 40F 3G4G, FortiWiFi 40F, FortiWiFi 60F, FortiWiFi 61F.

Configure SSH filter profile.

config ssh-filter profile
    Description: Configure SSH filter profile.
    edit <name>
        set block {option1}, {option2}, ...
        set default-command-log [enable|disable]
        set log {option1}, {option2}, ...
        config shell-commands
            Description: SSH command filter.
            edit <id>
                set action [block|allow]
                set alert [enable|disable]
                set log [enable|disable]
                set pattern {string}
                set severity [low|medium|...]
                set type [simple|regex]
            next
        end
    next
end

config ssh-filter profile

Parameter

Description

Type

Size

Default

block

SSH blocking options.

option

-

Option

Description

x11

X server forwarding.

shell

SSH shell.

exec

SSH execution.

port-forward

Port forwarding.

tun-forward

Tunnel forwarding.

sftp

SFTP.

scp

SCP.

unknown

Unknown channel.

default-command-log

Enable/disable logging unmatched shell commands.

option

-

disable

Option

Description

enable

Enable log unmatched shell commands.

disable

Disable log unmatched shell commands.

log

SSH logging options.

option

-

Option

Description

x11

X server forwarding.

shell

SSH shell.

exec

SSH execution.

port-forward

Port forwarding.

tun-forward

Tunnel forwarding.

sftp

SFTP.

scp

SCP.

unknown

Unknown channel.

name

SSH filter profile name.

string

Maximum length: 47

config shell-commands

Parameter

Description

Type

Size

Default

action

Action to take for SSH shell command matches.

option

-

block

Option

Description

block

Block the SSH shell command.

allow

Allow the SSH shell command.

alert

Enable/disable alert.

option

-

disable

Option

Description

enable

Enable alert.

disable

Disable alert.

id

Id.

integer

Minimum value: 0 Maximum value: 4294967295

0

log

Enable/disable logging.

option

-

disable

Option

Description

enable

Enable logging.

disable

Disable logging.

pattern

SSH shell command pattern.

string

Maximum length: 128

severity

Log severity.

option

-

medium

Option

Description

low

Severity low.

medium

Severity medium.

high

Severity high.

critical

Severity critical.

type

Matching type.

option

-

simple

Option

Description

simple

Match single command.

regex

Match command line using regular expression.

config ssh-filter profile

config ssh-filter profile

Note

This command is available for model(s): FortiGate 1000D, FortiGate 1000F, FortiGate 1001F, FortiGate 100F, FortiGate 101F, FortiGate 1100E, FortiGate 1101E, FortiGate 120G, FortiGate 121G, FortiGate 1800F, FortiGate 1801F, FortiGate 2000E, FortiGate 200E, FortiGate 200F, FortiGate 201E, FortiGate 201F, FortiGate 2200E, FortiGate 2201E, FortiGate 2500E, FortiGate 2600F, FortiGate 2601F, FortiGate 3000D, FortiGate 3000F, FortiGate 3001F, FortiGate 300E, FortiGate 301E, FortiGate 3100D, FortiGate 3200D, FortiGate 3200F, FortiGate 3201F, FortiGate 3300E, FortiGate 3301E, FortiGate 3400E, FortiGate 3401E, FortiGate 3500F, FortiGate 3501F, FortiGate 3600E, FortiGate 3601E, FortiGate 3700D, FortiGate 3700F, FortiGate 3701F, FortiGate 3960E, FortiGate 3980E, FortiGate 400E Bypass, FortiGate 400E, FortiGate 400F, FortiGate 401E, FortiGate 401F, FortiGate 4200F, FortiGate 4201F, FortiGate 4400F, FortiGate 4401F, FortiGate 5001E1, FortiGate 5001E, FortiGate 500E, FortiGate 501E, FortiGate 600E, FortiGate 600F, FortiGate 601E, FortiGate 601F, FortiGate 70F, FortiGate 71F, FortiGate 800D, FortiGate 80F Bypass, FortiGate 80F DSL, FortiGate 80F-POE, FortiGate 80F, FortiGate 81F, FortiGate 900D, FortiGate 900G, FortiGate 901G, FortiGate 90G, FortiGate 91G, FortiGate VM ARM64 for Azure, FortiGate VM ARM64 for GCP BYOL, FortiGate VM ARM64 for OCI BYOL, FortiGate VM for Aliyun PAYG, FortiGate VM for AWS PAYG, FortiGate VM for Azure BYOL, FortiGate VM for Azure PAYG, FortiGate VM for GCP BYOL, FortiGate VM for OPC BYOL, FortiGate VM64, FortiGateRugged 70F 3G4G, FortiGateRugged 70F, FortiWiFi 80F 2R 3G4G DSL, FortiWiFi 80F 2R, FortiWiFi 81F 2R 3G4G DSL, FortiWiFi 81F 2R 3G4G-POE, FortiWiFi 81F 2R-POE, FortiWiFi 81F 2R.

It is not available for: FortiGate 40F 3G4G, FortiGate 40F, FortiGate 60F, FortiGate 61F, FortiGateRugged 60F 3G4G, FortiGateRugged 60F, FortiWiFi 40F 3G4G, FortiWiFi 40F, FortiWiFi 60F, FortiWiFi 61F.

Configure SSH filter profile.

config ssh-filter profile
    Description: Configure SSH filter profile.
    edit <name>
        set block {option1}, {option2}, ...
        set default-command-log [enable|disable]
        set log {option1}, {option2}, ...
        config shell-commands
            Description: SSH command filter.
            edit <id>
                set action [block|allow]
                set alert [enable|disable]
                set log [enable|disable]
                set pattern {string}
                set severity [low|medium|...]
                set type [simple|regex]
            next
        end
    next
end

config ssh-filter profile

Parameter

Description

Type

Size

Default

block

SSH blocking options.

option

-

Option

Description

x11

X server forwarding.

shell

SSH shell.

exec

SSH execution.

port-forward

Port forwarding.

tun-forward

Tunnel forwarding.

sftp

SFTP.

scp

SCP.

unknown

Unknown channel.

default-command-log

Enable/disable logging unmatched shell commands.

option

-

disable

Option

Description

enable

Enable log unmatched shell commands.

disable

Disable log unmatched shell commands.

log

SSH logging options.

option

-

Option

Description

x11

X server forwarding.

shell

SSH shell.

exec

SSH execution.

port-forward

Port forwarding.

tun-forward

Tunnel forwarding.

sftp

SFTP.

scp

SCP.

unknown

Unknown channel.

name

SSH filter profile name.

string

Maximum length: 47

config shell-commands

Parameter

Description

Type

Size

Default

action

Action to take for SSH shell command matches.

option

-

block

Option

Description

block

Block the SSH shell command.

allow

Allow the SSH shell command.

alert

Enable/disable alert.

option

-

disable

Option

Description

enable

Enable alert.

disable

Disable alert.

id

Id.

integer

Minimum value: 0 Maximum value: 4294967295

0

log

Enable/disable logging.

option

-

disable

Option

Description

enable

Enable logging.

disable

Disable logging.

pattern

SSH shell command pattern.

string

Maximum length: 128

severity

Log severity.

option

-

medium

Option

Description

low

Severity low.

medium

Severity medium.

high

Severity high.

critical

Severity critical.

type

Matching type.

option

-

simple

Option

Description

simple

Match single command.

regex

Match command line using regular expression.