FortiGate Firewall Logs
Send FortiGate firewall logs (traffic, UTM, VPN, system events) to KubeSense over syslog, privately through a site-to-site VPN to an internal load balancer.
FortiGate firewalls record every allowed and denied session, security (UTM) detection, VPN event and administrator action. With FortiGate's built-in remote syslog, these logs are pushed to KubeSense as they happen. They are stored with your other logs, so you can search them on the Logs page, build dashboards and alert on denied traffic or attacks.
FortiGate sends straight to KubeSense. You don't need to run any log collector, relay server or agent.
How it flows
The recommended setup keeps everything private. Logs leave the FortiGate through an encrypted IPsec site-to-site VPN and reach an internal load balancer that has no public IP address.
FortiGate firewall(s) (your data center / branches)
│ syslog over TCP (reliable mode), key=value format
│ source IP from <ONPREM_CIDR>
▼
IPsec site-to-site VPN (encrypted over the internet)
▼
Cloud VPN gateway (AWS Virtual Private Gateway / Transit Gateway)
▼
Internal load balancer <KUBESENSE_SYSLOG_IP>:<SYSLOG_PORT> (private IP only)
▼
KubeSense
│ parses every FortiGate field into a log
▼
Logs page- Transport: TCP syslog in FortiGate reliable mode, so logs are not lost silently the way they can be with UDP.
- Format: FortiGate's default
key=valueformat. KubeSense parses every field. - Privacy: the IPsec tunnel encrypts the traffic over the internet, and the load balancer is reachable only from your network ranges.
Logs usually show up in KubeSense a few seconds after the FortiGate writes them.
Before you start
You need:
- FortiOS 7.0 or later on each FortiGate.
- An administrator account on the FortiGate with write access to Log & Report.
- A private network path from the FortiGate to the cloud network where KubeSense runs: an IPsec site-to-site VPN or a dedicated connection such as AWS Direct Connect. See Network setup.
- Two values from KubeSense. Ask your KubeSense contact for them. KubeSense sets up the endpoint on its side.
| Value | Example |
|---|---|
| Syslog endpoint IP | <KUBESENSE_SYSLOG_IP>, the private IP of the internal load balancer |
| Syslog port | <SYSLOG_PORT> |
Also share with your KubeSense contact:
| Value | Why |
|---|---|
Your network ranges (CIDR), for example <ONPREM_CIDR> | Only these ranges are allowed to connect to the load balancer |
| Number of FortiGates and how they connect (one HQ hub, or each site separately) | Decides how many VPN tunnels are needed |
info: Your network ranges and the cloud network range (<CLOUD_VPC_CIDR>) must not overlap. Agree on both ranges before you build the VPN.
1. Network setup
The FortiGate must be able to reach <KUBESENSE_SYSLOG_IP>:<SYSLOG_PORT> over a private path.
AWS side (your AWS team)
- Customer gateway. In the VPC console, go to Customer Gateways → Create. Enter the FortiGate's public WAN IP (
<FORTIGATE_PUBLIC_IP>). Choose BGP with a private ASN (for example<ONPREM_ASN>), or static routing. - VPN gateway. Attach a Virtual Private Gateway to the KubeSense VPC. With many sites or several VPCs, use a Transit Gateway instead.
- Site-to-site VPN connection. Connect the customer gateway to the VPN gateway. AWS creates two tunnels for redundancy.
- Download the configuration. Choose Download configuration, vendor Fortinet, and your FortiOS version. AWS generates a FortiGate configuration with the keys and tunnel addresses filled in.
- Return routes. In the route tables of the KubeSense private subnets, turn on route propagation from the VPN gateway (or add a Transit Gateway route) for
<ONPREM_CIDR>.
FortiGate side (your network team)
- Apply the configuration file downloaded from AWS. It creates both IPsec tunnels and their routes.
- With static routing, add a route for
<CLOUD_VPC_CIDR>through each tunnel. Give the second tunnel a higher distance so it is used only as a backup. - Confirm that both tunnels are up:
diagnose vpn tunnel listIn the AWS console, both tunnels should show UP.
info: Many FortiGates? If your branches already connect to an HQ FortiGate over VPN or SD-WAN, only the HQ needs a tunnel to AWS. Branch logs reach KubeSense through the HQ. If every site has its own internet connection, each one needs its own VPN connection. Use a Transit Gateway in that case.
2. Send logs from the FortiGate
FortiGate GUI
- Go to Log & Report → Log Settings, tab Global Settings.
- Under Log Settings:
| Setting | Value |
|---|---|
| Event logging | All |
| Local traffic logging | Specify, with Log local-out traffic on. Turn on Log local-in traffic to also record connections to the FortiGate itself, such as admin logins and blocked inbound traffic |
| Syslog logging | Enable |
| IP address/FQDN | <KUBESENSE_SYSLOG_IP> |
- Click Apply.
The GUI sets only the server address. Set the port, the TCP transport and the source IP in the CLI, as described next.
FortiGate CLI
Open Edit in CLI from the same page, or connect over SSH, and run:
config log syslogd setting
set status enable
set server "<KUBESENSE_SYSLOG_IP>"
set port <SYSLOG_PORT>
set mode reliable
set format default
set source-ip <FORTIGATE_LAN_IP>
end| Setting | Why |
|---|---|
mode reliable | Sends syslog over TCP, so a log is not lost silently if the network drops a packet |
format default | FortiGate's key=value format, which KubeSense parses field by field |
source-ip | An IP from <ONPREM_CIDR>, usually the FortiGate's LAN interface IP. It makes the logs travel through the VPN tunnel instead of the internet |
If the port is not 514, FortiGate asks you to confirm the different port. Answer y.
Choose which logs to send
config log syslogd filter
set severity information
set forward-traffic enable
set local-traffic enable
set multicast-traffic disable
set sniffer-traffic disable
set anomaly enable
endinfo: Traffic through the firewall (forward traffic) is logged per firewall policy. In each policy you want to see in KubeSense, go to Policy & Objects → Firewall Policy, edit the policy and set Log Allowed Traffic to All Sessions. Denied traffic is logged when Log Violation Traffic is on.
Check that logs arrive
- Test the connection from the FortiGate:
execute telnet <KUBESENSE_SYSLOG_IP> <SYSLOG_PORT>It should print Connected. Press Ctrl+C to close it.
- Send a batch of sample logs (traffic, IPS, antivirus, web filter, VPN and more):
diagnose log test- Within a minute, the logs show up on the KubeSense Logs page with Source =
fortigate.
3. Where the logs show up
FortiGate logs appear on the Logs page next to your other logs. Filter on Source = fortigate to see only them.
| Logs page field | Comes from |
|---|---|
| Timestamp | The event time on the FortiGate (eventtime), not the time it arrived |
| Source | Always fortigate |
| Format | Always fortigate |
| Workload | The FortiGate device name (devname) |
| Host | The FortiGate device name (devname) |
| Cluster | <KUBESENSE_CLUSTER_NAME>, set by KubeSense |
| Level | Set from the FortiGate level and action, see Levels |
| Body | A short summary, for example traffic/forward action=deny 10.1.1.5:51234 -> 8.8.8.8:443 |
Kubernetes-only fields such as Namespace, Node, Container and Pod are empty for FortiGate logs.
Attributes
Every field FortiGate sends becomes an attribute, so you can filter, group and alert on any of them. The most useful ones:
| Attribute | Example |
|---|---|
type | traffic, utm, event |
subtype | forward, local, ips, virus, webfilter, system, vpn |
action | accept, deny, close, blocked |
srcip, srcport, srcintf, srccountry | 10.1.1.5, 51234, port1, India |
dstip, dstport, dstintf, dstcountry | 8.8.8.8, 443, wan1, United States |
service, proto, app | HTTPS, 6, Google |
policyid | 12 |
sentbyte, rcvdbyte | 1200, 5168 |
user, group | admin, vpn-users |
devname, devid, vd | <FORTIGATE_NAME>, FG100F..., root |
logid, eventtype, msg | 0000000013, spam, SpamEmail |
fg_level | The original FortiGate level, for example notice |
peer_ip | The IP the log was received from |
Levels
| FortiGate level | Logs page level |
|---|---|
emergency, alert, critical | FATAL |
error | ERROR |
warning | WARN |
notification, notice, information | INFO |
debug | DEBUG |
A log at INFO whose action is deny, blocked, block, dropped or reset is raised to WARN, so blocked traffic stands out.
4. Useful searches
| Goal | Filter |
|---|---|
| All blocked traffic | source = fortigate and action in deny, blocked |
| IPS and antivirus detections | type = utm and subtype in ips, virus |
| VPN logins | type = event and subtype = vpn |
| Admin logins | type = event and subtype = system and action = login |
| Top talkers | Group by srcip, sum sentbyte |
| Traffic hitting one policy | policyid = <POLICY_ID> |
Good first alerts:
- A spike in denied traffic from one
srcip. - Any
utmlog withsubtype = ipsorvirus. - Failed admin logins (
subtype = system,action = login,status = failed).
Troubleshooting
| Symptom | Check |
|---|---|
execute telnet does not connect | Both VPN tunnels are up (diagnose vpn tunnel list). A route to <CLOUD_VPC_CIDR> points into the tunnel. source-ip is set to an IP inside <ONPREM_CIDR>. Ask KubeSense to confirm <ONPREM_CIDR> is allowed on the load balancer |
| Connected, but no logs in KubeSense | mode is reliable and format is default (get log syslogd setting). set status enable is on |
| Logs leave through the WAN instead of the tunnel | Run diagnose sniffer packet any 'port <SYSLOG_PORT>' 4. Packets must leave on the tunnel interface. If not, set source-ip and check the route |
| Only some traffic is logged | Forward traffic is logged per policy. Set Log Allowed Traffic to All Sessions on the policies you want |
| Too many logs | Raise severity in config log syslogd filter, or turn off local traffic logging |
Check the current settings at any time:
get log syslogd setting
get log syslogd filter