Description | This article describes how to forward FortiGate logs from FortiAnalyzer to rsyslog server over TLS. OpenSSL will be used to generate the CA and Server certificate. | ||||||
Scope | FortiAnalyzer, rsyslog server. | ||||||
Solution |
Generate CA and local/server certificate using OpenSSL:
Linux # openssl genrsa -out rootCA.key 4096
Linux # openssl req -x509 -new -nodes -key rootCA.key -sha512 -days 3650 -out rootCA.pem
Linux # openssl genrsa -out syslog.key 2048
Linux # openssl req -new -key syslog.key -out syslog.csr Linux # openssl x509 -req -in syslog.csr -CA rootCA.pem -CAkey rootCA.key -out syslog.crt -days 365 -CAcreateserial
Linux # openssl x509 -test -noout -in syslog.crt
Update the rsyslog config file:
Linux # vi /etc/rsyslog.con # set certificate files # load TCP listener # start up listener at port 6514
Import the CA & local/server certificate to FortiAnalyzer:
Configure FortiAnalyzer log forwarding settings:
FAZ # config system log-forward edit 1 set mode forwarding set fwd-max-delay realtime set server-name "rsyslog-server" set server-addr "thi-centos.fortilab.com" set server-port 6514 set fwd-server-type syslog set fwd-server-type syslog set fwd-reliable enable set peer-cert-cn "thi-centos.fortilab.com" next
Before configuring 'certificate oftp', perform the following in FortiGate to ensure FortiAnalyzer receives the FortiGate log successfully:
Configure 'certificate oftp' in FortiAnalyzer:
FAZ # config system certificate oftp set mode local set local syslog end
Linux # sudo journalctl -f -u rsyslog
Restart oftpd and logfwd daemon in FortiAnalyzer:
FAZ # diagnose test application oftpd 99 FAZ # diagnose test application logfwd 99
Verify the connections:
FAZ # diagnose test application oftpd 3 FGT # exec log fortianalyzer test-connectivity
FAZ # diagnose test application logfwd 4
Related articles: Troubleshooting Tip: FortiGate to FortiAnalyzer connectivity Technical Tip: How to configure and troubleshoot Log Forwarding on FortiAnalyzer |
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.