You need to give a vendor temporary root-level access to debug an appliance VM for one day. How do you control it?
AdvancedScenarioSecurity, hardening and incident response
Answer
Situation read → Time-boxed, recorded, revocable access.
What I'd do →
- Create a user with an expiry:
useradd -e 2026-11-10 vendor1. - Grant sudo only via a dated drop-in and remove it with an
atjob:echo "rm /etc/sudoers.d/vendor1; usermod -L vendor1" | at 18:00 tomorrow. - Enable session recording (
tlog, sudolog_output, or bastion recording). - Allow their source IP only on the firewall.
- Review recordings afterwards and rotate any secrets they could see.
Why → Access that removes itself can't be forgotten.
Interview tip → Better: SSH certificates with an 8-hour validity, issued just for them.
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