Service Management, Monitoring & Hardening from a SOC Perspective
This lab extends the Linux fundamentals from Script House. Complete these modules first for foundational skills:
After completing this lab, you will be able to:
SOC analysts must understand these services to detect attacks and misconfigurations:
Web servers - primary target for web attacks (SQLi, XSS, RCE)
Ports: 80, 443Remote access - brute force target, credential theft
Port: 22Mail servers - spam relays, phishing infrastructure
Ports: 25, 587, 465Databases - injection attacks, data exfiltration
Ports: 3306, 5432File sharing - lateral movement, ransomware spread
Ports: 139, 445, 2049Name resolution - DNS hijacking, exfiltration tunnels
Port: 530 of 4 tasks completed
Understanding how to list, start, stop, and investigate services is critical for SOC analysts.
| Command | Purpose |
|---|---|
systemctl list-units --type=service |
List all loaded services |
systemctl status <service> |
View service status and recent logs |
systemctl stop <service> |
Stop a service (incident response) |
systemctl disable <service> |
Prevent service from starting at boot |
systemctl is-enabled <service> |
Check if service starts at boot |
systemctl list-units --type=service --state=running and investigate any unfamiliar names.
Identify what services are listening on network ports - unexpected listeners may indicate compromise.
Flags: -t (TCP), -u (UDP), -l (listening), -n (numeric), -p (process)
Server logs are critical for detecting attacks. Know where to look and what to look for.
| Service | Log Location | What to Look For |
|---|---|---|
| SSH | /var/log/auth.log |
Failed logins, brute force attempts |
| Apache | /var/log/apache2/access.log |
Web attacks, SQLi, directory traversal |
| Nginx | /var/log/nginx/access.log |
Same as Apache |
| System | /var/log/syslog |
Service crashes, kernel messages |
| All (journald) | journalctl |
Unified logging for systemd services |
SOC analysts should understand hardening recommendations to advise teams on remediation.
| Category | Hardening Action | Command/Config |
|---|---|---|
| SSH | Disable root login | PermitRootLogin no in /etc/ssh/sshd_config |
| SSH | Use key-based auth only | PasswordAuthentication no |
| Firewall | Enable UFW/iptables | sudo ufw enable |
| Services | Disable unused services | systemctl disable <service> |
| Updates | Enable automatic security updates | apt install unattended-upgrades |
| Monitoring | Install fail2ban | apt install fail2ban |