wiki:shorewall_custom_logging
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| wiki:shorewall_custom_logging [2025/10/10 13:19] – add shorewall tag antisa | wiki:shorewall_custom_logging [2025/10/10 13:51] (current) – update rules example antisa | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| ====== Shorewall custom logging ====== | ====== Shorewall custom logging ====== | ||
| ===== Custom log file ===== | ===== Custom log file ===== | ||
| + | |||
| + | First make sure you have logging set. Example in /// | ||
| + | < | ||
| + | #SOURCE DEST POLICY | ||
| + | # LEVEL BURST MASK | ||
| + | # fw-to-all | ||
| + | $FW all ACCEPT - - | ||
| + | # net-to-all | ||
| + | net all DROP info - | ||
| + | # all-to-all | ||
| + | all all DROP info - | ||
| + | #LAST LINE -- DO NOT REMOVE | ||
| + | </ | ||
| + | |||
| + | Example from /// | ||
| + | < | ||
| + | ############################################################################################################# | ||
| + | #ACTION SOURCE | ||
| + | # | ||
| + | # | ||
| + | LOG:info all all | ||
| + | ...<rest of rules> | ||
| + | </ | ||
| To log events created by Shorewall in a custom file called “firewall.log” in /var/log directory first edit the / | To log events created by Shorewall in a custom file called “firewall.log” in /var/log directory first edit the / | ||
| Line 8: | Line 31: | ||
| LOGFILE=/ | LOGFILE=/ | ||
| + | You should also change LOGFORMAT to something like | ||
| + | LOGFORMAT=" | ||
| + | | ||
| Actual logging is managed by rsyslog daemon. Create a new file called “firewall.conf” in / | Actual logging is managed by rsyslog daemon. Create a new file called “firewall.conf” in / | ||
| ==== Debian 7 & 8 ==== | ==== Debian 7 & 8 ==== | ||
| Line 22: | Line 48: | ||
| Now restart rsyslog service and shorewall | Now restart rsyslog service and shorewall | ||
| + | |||
| + | ==== Different approach ==== | ||
| + | |||
| + | |||
| ===== Set up firewall.log rotation ===== | ===== Set up firewall.log rotation ===== | ||
wiki/shorewall_custom_logging.1760102367.txt.gz · Last modified: by antisa
