Security
A company runs a custom web application as a systemd service on a Linux server. The unit file currently contains User=root, although the application only binds to port 443 and reads files under /srv/app. Which change BEST reduces risk under least privilege?
Show the answer
Correct answerC. Create a dedicated unprivileged service account, run the service as it, and grant only the CAP_NET_BIND_SERVICE capability for the port binding
A dedicated unprivileged account with only the capability needed to bind port 443 limits what a compromised process can do. Changing file permissions or the port while still running as root leaves the process with full root privileges.