An auditor asks you to prove which ports are open on a server and why. How do you produce that?
BeginnerScenarioSecurity, hardening and incident response
Answer
Situation read → Show listening sockets and map them to services and firewall rules.
What I'd do →
sudo ss -tulpn
sudo firewall-cmd --list-all # or: sudo nft list ruleset / sudo ufw status verbose
nmap -sT -p- server01 # from another host, what's actually reachable
Document each port with its owning service and business reason; close anything without one.
Why → ss shows what listens; the external nmap shows what is exposed after firewalls.
Interview tip → Distinguish "listening on 127.0.0.1" from "listening on 0.0.0.0".
More on Security, hardening and incident response
Monitoring shows a web server making outbound connections to an unknown IP on port 4444 at 2 AM. You suspect it is compromised. What do you do?AdvancedAfter the compromise you need to find how the attacker got in. Where do you look?AdvancedYour CISO asks you to harden a fresh Linux server baseline. What's on your list?IntermediateA developer says "SELinux keeps breaking my app, can we just disable it?" How do you respond and what do you do?IntermediateYou need to know when anyone modifies `/etc/sudoers`, `/etc/passwd` or SSH config. How?IntermediateA critical OpenSSL CVE is announced. How do you find and patch affected servers quickly?Intermediate