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 [2021/11/09 15:35] – add Tested on antisa | wiki:shorewall_custom_logging [2025/10/10 13:51] (current) – update rules example antisa | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | {{tag> | + | {{tag> |
| ====== 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 ===== | ||
| Line 40: | Line 70: | ||
| ====== Tested on ====== | ====== Tested on ====== | ||
| * Debian 9,10 | * Debian 9,10 | ||
| + | |||
| + | ====== See also ====== | ||
| + | * [[wiki: | ||
wiki/shorewall_custom_logging.1636472122.txt.gz · Last modified: by antisa
