顯示具有 fortiget 標籤的文章。 顯示所有文章
顯示具有 fortiget 標籤的文章。 顯示所有文章

2026/02/04

每個星期都有forti的消息
早上要登入
竟然出現
看起來很大條



2025/12/09

昨天有個user拿來一台 macbook
問題是裝好fortivpn client後
config無法匯入 會有錯誤訊息
今天試了一下
有個地方必須打開








































打關後再進行匯入config就可以了

2024/03/13

fortiet 如何在命令列踢掉 vpn user

首先列出目前所有連線 找出相對應的 index id

FG60F # execute vpn sslvpn list 
SSL-VPN Login Users:
 Index User Group Auth Type Timeout Auth-Timeout From HTTP in/out HTTPS in/out Two-factor Auth
 1  a1234  sslvpn-group-full-tunnel 16(1) 295 28501 192.168.12.12 0/0 0/0 0

SSL-VPN sessions:
 Index User Group Source IP Duration I/O Bytes Tunnel/Dest IP 
 1  a1234  sslvpn-group-full-tunnel 192.168.12.12  299 324697/1609215 172.17.0.51


執行以下指令刪除要踢掉的 id

FG60F # execute vpn sslvpn del-tunnel 1

2020/07/01

fortiget 5.4 之後多了 quarantine 的功能

可以即時block ip 而不用再 create object 後再加到 policy

指令如下

FG # diagnose user quarantine
list      List user quarantine entries.
add       Add user quarantine entry.
delete    Delete user quarantine entry.
clear     Clear all user quarantine entries.
stat      stat

不過有個重點
重開後資料會全部清空
要重下進去

2019/10/18

proxmox mail gateway 今年 opensource
因為之前都是用fortiget來處理spam的問題
所以也沒想要換
不過因為保固到期 新的合約沒有買到spam這個授權
而且最近也把mail server 換到centos 8
所以就想說來試看看
如果本來就是用 proxmox ve
那就可以直接使用LXC的template
我就是直接用template
安裝很快 裝完template也就可以砍了
再來說明一下裝完後有那些要改
首先是登入的root密碼
接下來使用iptables去管制能夠連到管理介面的來源ip

mail filter

一直以來我們的處理方式都是在主旨加上tag 而不是去隔離信
所以這裡要改
至於要不要通知管理者 就自行決定了
如果需要黑白名單 也是在這裡加














configuration

管理者的mail要記得改
















mail proxy

relaying
relay domains
transports
請依自己的環境修改
如果使用greylist 白名單是加在這裡 要注意 不是在mail filter














options

紅框是我覺得一定要改的
信件大小是跟著gmail的規則
網路上看到都說不要開greylist 可是我認為要開 可以少掉很多spam
SMTPD banner 如果不改 會顯示proxmox
站在安全的角度 我不想讓人知道我用什麼產品
其他就視需要自行決定了


















未加greylist



















加上greylist



















spam跟virus的更新系統會自動做
至於其他就自己看看

文件上的這張圖怪怪的


















實体上不是直接放在mail server 前面
而是要在DNS設定MX
外面進來的信先進到PMG
處理完後再轉到mail server
所以我目前的做法是在mail server上用iptable管制特定ip才能連到25
而且出去的信我也是從mail servre直接出去
不再經過PMG
到目前大約運作十多天
看起來效果還不錯

https://www.proxmox.com/en/proxmox-mail-gateway
https://pmg.proxmox.com/pmg-docs/pmg-admin-guide.html

2018/11/13

fortiOS 5.2的REST有問題 不要用


最近有個朋友問我有沒有用過fortiget rest的功能 5.2之後提供
其實之前就有再找
只是後來程式都直接用 ssh或telnet去下指令
既然有人問了
就再來找找

一閞始找到的這二個資料
可以查 可以刪 但不能新增 也不能update
所以不要再浪費時間了


直到後來找到這個 完全沒問題啊 而且也不用自己去寫jason格式 而且反應速度相當快

https://github.com/DavidChayla/FortigateApi/blob/master/README.md

記錄一下用法

首先要下載回來後要先 import

import sys
sys.path.append('PATH TO FortigateApi.py')

再來依照文件說明

import FortigateApi

fg = FortigateApi.Fortigate('10.20.30.40', 'root', 'admin', 'mypasswd')

fg.AddFwAddress('srv-A','10.1.1.1/32')

200

fg.GetFwAddress('srv-A')

u'{\n "http_method":"GET",\n "results":[\n {\n "name":"srv-A",\n "q_origin_key":"srv-A",\n "uuid":"2103d064-d520-51e6-de84-16e9ab03b8ae",\n "subnet":"10.1.1.1 255.255.255.255",\n "type":"ipmask",\n "start-ip":"10.1.1.1",\n "end-ip":"255.255.255.255",\n "fqdn":"",\n "country":"",\n "url":"",\n "cache-ttl":0,\n "wildcard":"10.1.1.1 255.255.255.255",\n "comment":"",\n "visibility":"enable",\n "associated-interface":"",\n "color":0,\n "tags":[\n ]\n }\n ],\n "vdom":"dc2",\n "path":"firewall",\n "name":"address",\n "mkey":"srv-A",\n "status":"success",\n "http_status":200,\n "serial":"FWF90D3Z13003141",\n "version":"v5.2.9",\n "build":736\n}'

fg.SetFwAddress('srv-A','10.2.2.2/32')

200

fg.DelFwAddress('srv-A')

200


2017/04/05

今天早上登入graylog時出現了通知訊息
有新版
立馬進行更新
可是更新完出現几個問題
一個是 elasticsearch 的message出現暴量
導致graylog預設的Disk Journal (1G)也爆了 所以到config先調大為5G 等消化完再看看要不要調回來

第二個問題是forti的log几乎全部不見了 
這很奇怪
之前的几次更新並沒有出現這個問題
找了一下官方的blog看到從這一版開始直接支援fortiget的log









而且在少數出現的log裡也看到欄位被辨認出來
這個不錯 雖然很吃資源


























但卻只有出現少數几條log
畫面右上的 in/out message也一直有值
用tcpdump去捉封包也沒問題
看來應該是syslog4j有bug了

只能先試一下進forti改一下丟log的方式
先把log調到之前有開的tcp port
可是並沒有出現
於是再syslog上再開另一個udp port
再改一下forti的設定
終於可以了
先醬用吧

2016/07/05

原本一直以來都是使用flow-tools來收netflow的資料

http://freecode.com/projects/flow-tools
flow-capture

但最近的工作需要收集從fortiget傳來的netflow的資料
一開始也是使用flow-capture
但一直沒有資料
用tcpdump去看
是有資料進來的
但查了一些文件才知道fortiget送過來的是netflow v9
flow-capture不支援
於是改用nfdump 支援 v5 v7 v9
資料就正常收取了
http://nfdump.sourceforge.net/
nfcapd

2016/04/17

因為ascenflow GG了
所以把認証移到forti上去
順便想看一下線上人數並記錄
但找了一下forti的mib
並沒有提供這個值
所以只好自行寫程式來撈了

使用python來撈目前online user的所有資料 並從中取出線上人數 在輸出的最後一行
直接使用shell也可以

#!/usr/bin/python

import os
import telnetlib

host="192.168.1.1"
user="admin"
passwd="password"

tn = telnetlib.Telnet(host)

tn.read_until("FG600C login: ")
tn.write(user + "\n")
tn.read_until("Password: ")
tn.write(passwd + "\n")
tn.read_until("FG600C # ")
tn.write("diagnose firewall auth filter group auth_user_group(radius_server)" + "\n")
tn.read_until("FG600C # ")
tn.write("diagnose firewall auth list" + "\n")
#tn.read_until("FG600C # ")
tn.write("exit" + "\n")

print tn.read_all()
tn.close()

取出後把值吐給cacti來畫圖

步驟如下

1. 建立data input methods 使用自行寫好的程式










2. 使用步驟1 的資料來新增data templates














3.使用步驟2 的資料來產生 graph templates













4. 在forti上新增步驟3所產生的graph template






等待一段時間後畫出的圖如下












發現有小數出現 雖然說不太會影響判讀 但感覺就是怪怪的
找了一下資料
發現把graph template的gprint type改成exact numbers就可以顯示整數了













改好後如下圖 看起來正常多了









2015/07/30

昨天下午17點多發生一台cisco不明原因的網路不通
早上去查了一下
找不到原因
只好把昨天早上的config 備份倒回去
說也奇怪 就正常了

到了今天中午
宿舍的4台cisco一起出問題
查了一下log如下
Jul 30 11:10:27 GMT+8: %ACL_ERRMSG-4-UNLOADED: 1 fed:  Output IP Vlan ACL on interface Vlan206 for label 3 on asic255 could not be programmed in hardware and traffic will be dropped.
Jul 30 11:10:27 GMT+8: %ACL_ERRMSG-4-UNLOADED: 1 fed:  Output IP Vlan ACL on interface Vlan207 for label 3 on asic255 could not be programmed in hardware and traffic will be dropped.
Jul 30 11:10:27 GMT+8: %ACL_ERRMSG-4-UNLOADED: 1 fed:  Output IP Vlan ACL on interface Vlan208 for label 3 on asic255 could not be programmed in hardware and traffic will be dropped.
Jul 30 11:10:27 GMT+8: %ACL_ERRMSG-4-UNLOADED: 1 fed:  Output IP Vlan ACL on interface Vlan209 for label 3 on asic255 could not be programmed in hardware and traffic will be dropped.
Jul 30 11:10:27 GMT+8: %ACL_ERRMSG-4-UNLOADED: 1 fed:  Output IP Vlan ACL on interface Vlan210 for label 3 on asic255 could not be programmed in hardware and traffic will be dropped.

詢問廠商後得到這樣的回答

原廠對3850/3650 ACL限制的說明,

ACL TCAM (TAQ)有2塊,分別為in與out,但VACL只能使用其中1塊.限制如下:

1.VACL  => 1.5K 筆 (最多,不分in,out)

2.MAC VACL => 單向460筆(in,out分開算)

3.IPv4 VACL  => 單向690筆(in,out分開算)

4.IPv4 PACL,RACL => 單向1380筆(in,out分開算)

5.MAC PACL,RACL =>單向690筆(in,out分開算)

6.IPv6 PACL,RACL =>單向690筆(in,out分開算)



VLAN Access Control List (VACL) − A VACL is an ACL that is applied to a VLAN. It can only be applied to a VLAN and no other type of interface. The security boundary is to permit or deny traffic that moves between VLANs and permit or deny traffic within a VLAN. The VLAN ACL is supported in hardware, and has no effect on the performance.

Port Access Control List (PACL) − A PACL is an ACL applied to a Layer 2 switchport interface. The security boundary is to permit or deny traffic within a VLAN. The PACL is supported in hardware and has no effect on the performance.

Router ACL (RACL) − An RACL is an ACL that is applied to an interface that has a Layer 3 address assigned to it. It can be applied to any port that has an IP address such as routed interfaces, loopback interfaces, and VLAN interfaces. The security boundary is to permit or deny traffic that moves between subnets or n

意思就是說當acl下超過690條後 机器就會不正常了
XD
cisco吔

為什麼以前都沒發生過咧

不知是因為最近snort升到 2.9.7.5 所以 port scan變的比較敏感
還是port scan真的變多了

反正先改了一下程式
要block的ip直接下到fortiget而不先進LP了
看來也沒啥好方法可以處理了

2013/12/19

最近在進行Arcsight的POC

整理了一下search 語法

fortigate virus | top destinationAddress

fortigate Malicious | top destinationAddress

fortigate ips AND (sourceAddress IS NOT NULL) | top sourceAddress

fortigate spam | top sourceAddress

2013/12/09

參考了以下的文章
把fortiget的相關monitor加到cacti
但session那個oid有問題





在設定Data Templates時
Associated RRA's  的第一個選項 Hourly一定要取消(預設是全選的)
否則會造成圖畫不出來的問題


http://www.paulscomputerservice.net/articles/article.php?ID=211
http://kb.fortinet.com/kb/viewAttachment.do?attachID=Fortigate%20SNMP%20Graphs%20with%20Cacti.pdf&documentID=13833
http://www.netadmin.com.tw/article_content.aspx?sn=1301020001

2013/11/14

fortiget的相關指令

diag sys top  

diag sys kill 11 <ID number>

2013/11/13

fortiget自訂firewall policy的編號

FG命令可參考設定檔內容,例如Firewall Policy規則:
(依照下例貼到console就可在web ui看到)

config firewall policy
    edit 20  -->可自訂編號
        set srcintf "port17"
        set dstintf "abc"
        set srcaddr "IP-1.2.3.4"
        set dstaddr "all"
        set action accept
        set status disable
        set schedule "always"
        set service "ALL"
        set utm-status enable
        set logtraffic all
        set av-profile "default"
        set webfilter-profile "Monitor"
        set profile-protocol-options "default"
next
end  -->Save

2013/05/28

以下是如何在fortiget開啟debug並經由GUI的設定過程得到script的步驟
把script存檔
之後就可以經由修改存下來的檔案
使用ssh經由forti clinet來下指令了


































http://www.fortihelp.com/2008/06/how-to-create-quick-scripts-using-gui.html