I have an evolution of an Earlier Question.
Main Question: What are the meaningful differences between running a program as root, vs. via service account with a sudoers file entry?
I have to deploy a 3rd party software agent into my security-conscious customer's RHEL environment. The default installation results in the agent's files and folders being owned by root, and it is scheduled to run on startup, or shutdown, or via the crontab file; but either way it runs as a root process which no one in the security team seems to like.
The vendor have suggested that a more secure alternative is to execute the agent via a service account with a sudoers file entry: e.g.:
agent-user ALL=NOPASSWD: /opt/agent/agent-executable
But is this actually better from a security viewpoint? Or what is best practice in this situation?
The way I see it, the agent will get privileged access to the server either way. And the service account is a customisation that (while supported by the vendor) seems like an opportunity to make mistakes.
Is NOPASSWD:
a security weakness, and would stipulating a shell of /sbin/nologin
improve security?