Description | This article describes how the services and protocol are bound to the logs. |
Scope | FortiGate. |
Solution |
FortiGate has predefined services matching the protocol port numbers and types. When user traffic passes through the FortiGate allowed by the defined ipv4 policy, a log is created for the session with all the information.
For Example:
LAN PC is Doing SSH access of the External FortiGate (acting as a server) and traffic is passing through Internal FortiGate.
When SSH access is initiated in the PC and allowed by FortiGate, it will create a Forward traffic log in Internal FortiGate with service as SSH.
date=2024-12-27 time=04:20:39 eventtime=1735302038535839376 tz="-0800" logid="0000000013" type="traffic" subtype="forward" level="notice" vd="root" srcip=172.30.18.94 srcname="ERBIUM-KVM134" srcport=52132 srcintf="port4" srcintfrole="undefined" dstip=10.5.144.165 dstname="10.5.144.165" dstport=22 dstintf="port1" dstintfrole="undefined" srccountry="Reserved" dstcountry="Reserved" sessionid=10761106 proto=6 action="close" policyid=2 policytype="policy" poluuid="f1a56c7a-b57b-51ef-77b2-44d9c62a17a5" policyname="Internet policy" service="SSH" trandisp="snat" transip=10.5.144.159 transport=52132 appcat="unscanned" duration=106 sentbyte=2688 rcvdbyte=2460 sentpkt=16 rcvdpkt=15 vwlid=0 devtype="Unknown" osname="Windows" srcswversion="10 / 2016" mastersrcmac="00:65:72:62:86:01" srcmac="00:65:72:62:86:01" srcserver=0
The same logs are generated in FortiGate irrespective of the client application used to initiate SSH access (TCP port 22). Even when doing telnet to External FortiGate on TCP port 22 as well.
SSH or Telnet can be used to establish a TCP connection to the server listening port as 22. These two protocols will not share any protocol information in TCP handshake.
3133 1451.725577 172.30.18.94 10.5.144.165 TCP 66 52879 → 22 [SYN, ECE, CWR] Seq=0 Win=8192 Len=0 MSS=1460 WS=256 SACK_PERM
FortiGate logs show this communication as SSH:
date=2024-12-12 time=05:49:58 eventtime=1734011397762639476 tz="-0800" logid="0000000013" type="traffic" subtype="forward" level="notice" vd="root" srcip=172.30.18.94 srcname="172.30.18.94" srcport=52879 srcintf="port4" srcintfrole="undefined" dstip=10.5.144.165 dstname="10.5.144.165" dstport=22 dstintf="port1" dstintfrole="undefined" srccountry="Reserved" dstcountry="Reserved" sessionid=95130 proto=6 action="close" policyid=2 policytype="policy" poluuid="f1a56c7a-b57b-51ef-77b2-44d9c62a17a5" policyname="ff" service="SSH" trandisp="snat" transip=10.5.144.159 transport=52879 appid=16060 app="SSH" appcat="Network.Service" apprisk="elevated" applist="default" duration=121 sentbyte=2104 rcvdbyte=1370 sentpkt=11 rcvdpkt=9 vwlid=0 utmaction="allow" countapp=1 sentdelta=80 rcvddelta=80 durationdelta=1 sentpktdelta=2 rcvdpktdelta=2 utmref=65522-6840
This is a sample communication from client to server using putty and connection types such as Telnet and port 22.
2997 1204.255690 172.30.18.94 10.5.144.165 TCP 66 52861 → 22 [SYN, ECE, CWR] Seq=0 Win=8192 Len=0 MSS=1460 WS=256 SACK_PERM
Both the Traffic is matches the service SSH and get allowed. |
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2025 Fortinet, Inc. All Rights Reserved.