Security basics and system administration tasks
This domain, Security basics and system administration tasks, tests day-to-day hardening and operations: least privilege, access control beyond mode bits, firewalling, patching, logging, and routine maintenance.
Hardening fundamentals
- Least privilege: run services as dedicated users, grant specific commands through
sudo, and disable direct root SSH login. - Mandatory access control: SELinux is checked with
getenforceandsestatus, with modes enforcing, permissive, and disabled; contexts appear inls -Zand are repaired withrestoreconorsemanage fcontext. AppArmor profiles are summarized byaa-status. - Firewalls:
firewall-cmd --add-service=https --permanentfollowed byfirewall-cmd --reload,ufw allow 22/tcp, or nativenftablesrules. Default to denying inbound traffic. - Patching:
dnf updateinfo list securityorapt list --upgradable; reboot after kernel updates unless live patching is in use.
Operations
- Logs:
journalctl -p err -b,/var/log/secureor/var/log/auth.log,last,lastb, andwho. - Auditing:
ausearch -m avc -ts recentfor SELinux denials andauditctlfor custom rules. - Scheduled work: cron through
crontab -eand/etc/crontab, systemd timers withOnCalendar=, andlogrotatefor retention. - Capacity checks:
df -h,du -sh *,free -h,vmstat, andiostat.
Worked example
After moving a web root to /srv/www, Apache returns 403 and ausearch -m avc -ts recent shows a denial for httpd_t on the new path. Reasoning: the files carry the wrong SELinux type. Run semanage fcontext -a -t httpd_sys_content_t '/srv/www(/.*)?' and then restorecon -Rv /srv/www. Do not switch the system to permissive, which disables protection globally and hides the misconfiguration instead of fixing it.
Traps
- Using
chmod 777as a permissions fix. - Disabling SELinux or AppArmor instead of relabeling files.
- Adding firewall rules without
--permanentor reloading the service. - Leaving password authentication enabled on internet-facing SSH.