Created on
03-02-2025
11:59 PM
Edited on
03-03-2025
12:42 AM
By
Jean-Philippe_P
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
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 # diag test application oftpd 99 FAZ # diag test application logfwd 99
Verify the connections:
FAZ # diag test application oftpd 3 FGT # exec log fortianalyzer test-connectivity
FAZ # diag test application logfwd 4
Related articles: Troubleshooting Tip: FortiGate to FortiAnalyzer connectivity Technical Tip: How to configure and troubleshoot Log Forwarding on FortiAnalyzer |