Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - EmanueleP

#1
Salve a tutti,

sto cercando di trasmettere log da OPNsense verso un server syslog esterno (basato su syslog-ng) separando i flussi per Firewall, Suricata e System, ciascuno su porta dedicata. Il server è perfettamente configurato per ricevere via UDP/TCP, e ho testato tutte le combinazioni possibili. Tuttavia, non ricevo **nessun messaggio log**, nonostante la connessione venga stabilita.

## ⚙️ Sistema
- OPNsense version: 25.1.11-amd64
- Server di destinazione: syslog-ng su Linux Debian/Ubuntu
- Log ricevuti: **nessuno**, file `.log` vuoti su tutte le destinazioni

## 🔧 Configurazione su OPNsense (via GUI)
- Logging → Targets
  - 3 targets separati: Firewall, Suricata, System
  - Protocollo: TCP (testato anche UDP)
  - Porte: 10154 (Firewall), 10155 (Suricata), 10156 (System)
  - Livelli abilitati: info, notice, warn, error, alert
  - Facilities: local0 / local1 / local2
  - Targets abilitati e applicati

## 📡 Comportamento osservato

Nel log locale di OPNsense, vedo chiaramente:
syslog-ng: Syslog connection established; server='AF_INET(x.x.x.x:10154)' syslog-ng: Syslog connection closed; time_reopen='60'


...che si ripete ogni minuto circa. Quindi la connessione **si apre**, ma i file `.log` sul server restano vuoti.

Ho testato anche:

- TLS tramite stunnel → connessioni OK, ma log sempre assenti
- Porta 514 in UDP: solo Suricata funziona via Filebeat interno (non estendibile da GUI)
- TCP diretto → syslog-ng in ascolto su `0.0.0.0:10154`, `10155`, `10156` → connessioni attive ma nessun payload

## 📁 Configurazione syslog-ng lato server (semplificata)

```conf
source s_opnsense_firewall { tcp(ip(0.0.0.0) port(10154)); };
destination d_opnsense_firewall { file("/var/log/opnsense/firewall.log"); };
log {
    source(s_opnsense_firewall);
    destination(d_opnsense_firewall);
};

Ripetuto identicamente per Suricata e System.

Considerazioni
Sembra che syslog-ng su OPNsense apra la connessione ma non abbia messaggi da inviare

Anche le destinazioni definite e abilitate via GUI non generano traffico

Non posso accedere via shell → quindi non posso verificare manualmente /usr/local/etc/syslog-ng.conf.d/syslog-ng-destinations.conf

Il flusso funziona solo per Suricata → probabilmente gestito da Filebeat e non da syslog-ng

Domanda alla community
Qualcuno è riuscito a far funzionare davvero il logging remoto via TCP/UDP?

C'è un bug noto in pluginctl o nella GUI che impedisce la generazione della configurazione interna?

È possibile che syslog-ng su OPNsense sia inattivo o ignori i target definiti?

Ringrazio anticipatamente chiunque voglia dare supporto o condividere un caso simile.

Emanuele


#2
I am writing this post to see if the same thing has happened to others. I have tried at least twenty times without being able to update from version 24.7.3_1 to version 24.7.4 and losing the firewall configuration every single time without being able to restore it from the backups. Every time I try to update it runs everything perfectly to the point that it also displays the new version in system information, then it restarts and starts again with the old version (24.7.3_1). At this point I have to reconfigure all the firewall rules and the wan port because even though I have made the backup and reloaded it perfectly it does not recover the settings. Has this happened to others?