Peters School of Business · Assiniboine College · NETW-0014
2 hours · Lecture + Lab 2D · Facilities/severities, custom template, redirection, S2→S1 forwarding, logrotate
Time is reliable — now what's written to the log files?
timedatectl timesync-status on S2 — should show S1 as source, stratum 3. Fix any drift before today's lab; incorrect timestamps undermine the exercise.echo '' > /var/log/auth.log. What evidence is destroyed?" — everything local. Today's centralised-logging half of the lab is the fix.The syslog standard, rsyslog architecture, the custom template, and centralised logging
facility.severity means that level and above — *.debug means everything./etc/rsyslog.conf holds daemon properties and templates; /etc/rsyslog.d/50-default.conf holds routing rules (facility.severity /path). A leading dash means async (faster, risk of losing the last lines on crash).$template myDefault,"%timegenerated% %HOSTNAME% %syslogfacility-text%.%syslogseverity-text% %syslogtag% %msg%\n" plus $ActionFileDefaultTemplate myDefault in rsyslog.conf makes every line self-describing — essential once logs are centralised from multiple sources.imudp reception on S1 and adding a @loghost forwarding line to S2's 50-default.conf (keeping the local rule too) means a copy of S2's auth events lands on S1 in real time — surviving even if S2's local log is wiped.Lab 2D — Template and redirection on S1, then centralised logging from S2, plus rotation
Part 1 — Custom template and local redirection (30 min)
rsyslog.conf and 50-default.conf.rsyslog.conf, restart rsyslog, trigger an SSH login, confirm /var/log/auth.log now shows facility.severity in each line.auth,authpriv.* /var/log/auth.log rule (with a dated comment explaining why) and add auth,authpriv.* -/var/log/logrecord.log. Restart, trigger login events, and confirm the new file exists and is receiving entries.Part 2 — Centralised logging from S2, then rotation (45 min)
imudp module and input lines in rsyslog.conf, binding to S1's LAN1 IP specifically (address="192.168.50.1") rather than 0.0.0.0 — discuss why binding to a specific interface matters. Verify with sudo ss -ulnp | grep 514.loghost entry to /etc/hosts, then add auth,authpriv.* @loghost to 50-default.conf alongside the existing local rule (don't remove it). Restart rsyslog on S2, trigger logins, and confirm the events appear on S1's live-tailed syslog within seconds.-A udp port 514) that syslog is plaintext in transit — note the security implication./var/log/syslog: daily, missingok, rotate 5, compress, delaycompress, notifempty, sharedscripts, and a postrotate block that reloads rsyslog. Test with logrotate --debug (dry run), then add a crontab entry to run it at 2am daily.grep "Failed password" and grep "Accepted" — the practical uses a pre-seeded log file.Learning outcomes — by end of Day 4, students can…
What you need ready before class