頁面目錄
前言:
FortiGate Banned-IP 功能可以阻擋有問題的IP Address連線,可以透過以下方式觸發Ban IP。
- FortiView Source
- Command line interface (CLI)
- Security profiles
- Automation IP ban
- DOS Policy
環境說明:
FortiOS版本:After 7.0
FortiGate Banned-IP 設定:
FortiView Source
Command line interface
FortiOS 7.2版本以前請用quarantine
diagnose user quarantine {list | add | delete | clear | stat}
FortiOS 7.2版本以後請用banned-ip
diagnose user banned-ip {list | add | delete | clear | stat}
指令參數說明:
選項 | 描述 |
---|---|
list | 列出Banned IP Address清單 |
add | 增加Banned IP Address |
delete | 刪除Banned IP Address |
clear | 清除Banned IP Address清單 |
stat | 列出Banned IP Address清單數量 |
指令範例:
新增隔離IP
diagnose user banned-ip add src4 <src-ipv4> <expiry> <ban-source>
<src-ipv4>:來源IP
<expiry>:阻擋時間,以秒為單位
<ban-source>:ban來源,有以下選項(admin/dlp/ips/av/dos/app)
永久隔離IP請用以下指令
FortiOS 7.2版本以前
diagnose user quarantine add src4 10.10.10.1 indefinite admin
FortiOS 7.2版本以後
diagnose user banned-ip add src4 10.10.10.1 indefinite admin
刪除隔離IP
diagnose user banned-ip delete src4 <src-ipv4>
<src-ipv4>:來源IP
列出隔離IP清單
列出隔離IP數量
Security profiles
Antivirus:
config antivirus profile
edit <name>
config nac-quar
set infected quar-src-ip
set expiry 1d /數值單位(minimum 0d0h1m)
set log enable /啟用Ban IP log記錄
end
確認Ban IP生效結果
# diagnose user banned-ip list
src-ip-addr created expires cause
10.10.10.1 Wed Jan 17 13:06:05 2024 Wed Jan 17 13:08:05 2024 AV
IPS:
config ips sensor
edit <name>
config entries
edit 1
set quarantine attacker
set quarantine-expiry 1d /數值單位(minimum 0d0h1m)
set quarantine-log enable /啟用Ban IP log記錄
end
end
確認Ban IP生效結果
# diagnose user banned-ip list
src-ip-addr created expires cause
10.10.10.2 Wed Jan 17 14:06:05 2024 Wed Jan 17 14:08:05 2024 IPS
確認Ban IP log
Automation IP Ban
自動Ban IP的設定方式可參考站內文章
DOS Policy
config firewall DoS-policy
edit 1
config anomaly
edit udp_src_session /選擇DOS防護類型
set quarantine attacker
set quarantine-expiry 1d /數值單位(minimum 0d0h1m)
set quarantine-log enable /啟用Ban IP log記錄
end
end
FortiGate Banned-IP 保留 :
預設 FortiGate Banned-IP 清單存放在記體中重開機後不會保留,可以透過指令設定重開機後保留如下說明:
config firewall global
set banned-ip-persistency (disabled | permanent-only | all)
end
選項 | 描述 |
---|---|
permanent-only | 只保留永久隔離的IP |
all | 保留所有隔離IP |
1 則留言