Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
technical:remote_syslog_setup [2025/06/06 03:19] – Adding the syslog configs and tweaks super_stunder | technical:remote_syslog_setup [2025/06/11 04:45] (current) – [Going against the Linux Gods] super_stunder | ||
---|---|---|---|
Line 88: | Line 88: | ||
apt install rsyslog | apt install rsyslog | ||
</ | </ | ||
+ | |||
+ | Here is a my / | ||
+ | < | ||
+ | # / | ||
+ | # | ||
+ | # For more information install rsyslog-doc and see | ||
+ | # / | ||
+ | |||
+ | |||
+ | ################# | ||
+ | #### MODULES #### | ||
+ | ################# | ||
+ | |||
+ | module(load=" | ||
+ | module(load=" | ||
+ | # | ||
+ | |||
+ | # provides UDP syslog reception | ||
+ | # | ||
+ | # | ||
+ | |||
+ | # provides TCP syslog reception | ||
+ | # | ||
+ | # | ||
+ | |||
+ | |||
+ | ########################### | ||
+ | #### GLOBAL DIRECTIVES #### | ||
+ | ########################### | ||
+ | |||
+ | # | ||
+ | # Set the default permissions for all log files. | ||
+ | # | ||
+ | $FileOwner root | ||
+ | $FileGroup adm | ||
+ | $FileCreateMode 0640 | ||
+ | $DirCreateMode 0755 | ||
+ | $Umask 0022 | ||
+ | |||
+ | # | ||
+ | # Where to place spool and state files | ||
+ | # | ||
+ | $WorkDirectory / | ||
+ | |||
+ | # | ||
+ | # Include all config files in / | ||
+ | # | ||
+ | $IncludeConfig / | ||
+ | |||
+ | |||
+ | ############### | ||
+ | #### RULES #### | ||
+ | ############### | ||
+ | |||
+ | # Forward messages with " | ||
+ | :msg, contains, " | ||
+ | |||
+ | # This will forward all of the Firewall Logs to the syslog01 server from /etc/hosts over UDP 514 | ||
+ | :msg, contains, " | ||
+ | |||
+ | # Discard messages with the " | ||
+ | :msg, contains, " | ||
+ | |||
+ | # Send all other messages to the journald socket - not sure this is needed I am doing it all in syslog now might remove later. | ||
+ | *.* action(type=" | ||
+ | |||
+ | # | ||
+ | # Log anything besides private authentication messages to a single log file | ||
+ | # | ||
+ | *.*; | ||
+ | |||
+ | # | ||
+ | # Log commonly used facilities to their own log file | ||
+ | # | ||
+ | auth, | ||
+ | cron.* -/ | ||
+ | kern.* -/ | ||
+ | mail.* -/ | ||
+ | user.* -/ | ||
+ | |||
+ | # | ||
+ | # Emergencies are sent to everybody logged in. | ||
+ | # | ||
+ | *.emerg : | ||
+ | </ | ||
+ | |||
Then edit / | Then edit / | ||
Line 95: | Line 181: | ||
</ | </ | ||
- | < | + | < |
# Use ' | # Use ' | ||
# | # | ||
Line 132: | Line 218: | ||
#Audit=no | #Audit=no | ||
</ | </ | ||
+ | |||
+ | Once you have rsyslog configured and logging disabled going to journald you need to restart both logging services. | ||
+ | |||
+ | <cli> | ||
+ | systemctl restart systemd-journald.service | ||
+ | systemctl restart rsyslog.service | ||
+ | </ | ||
+ | |||
+ | |||
Alright I have the basics running now but need to address a couple of things. | Alright I have the basics running now but need to address a couple of things. | ||
+ | |||
+ | === The Syslog Server - syslog01 === | ||
+ | FIXME | ||
+ | |||
+ | Now you should see both servers " | ||
+ | < | ||
+ | 2025-06-11T04: | ||
+ | 2025-06-11T04: | ||
+ | </ | ||
- < | - < | ||
- Even though I have loaded RSYSLOG all logs are still going to the systemd logs. I want to keep the system logs pointed to systemd (let it do its thing) and have all of the firewalls logs sent to /var/log for text based processing. :!: I thought this was going to be an option, turns out log flexibility has gone away now that the world of Linux has push to systemd | - Even though I have loaded RSYSLOG all logs are still going to the systemd logs. I want to keep the system logs pointed to systemd (let it do its thing) and have all of the firewalls logs sent to /var/log for text based processing. :!: I thought this was going to be an option, turns out log flexibility has gone away now that the world of Linux has push to systemd | ||
- | |||
FIXME | FIXME | ||
Line 149: | Line 252: | ||
By implementing this iptables policy, a firewall that allows SSH on port 22, denies all other inbound traffic, and logs both accepted and denied packets with the desired prefix can be created. | By implementing this iptables policy, a firewall that allows SSH on port 22, denies all other inbound traffic, and logs both accepted and denied packets with the desired prefix can be created. | ||
- | + | [[: | |