A developer is configuring a web application to use the principle of least privilege. Which action best aligns with this philosophy?
Least privilege requires granting only the permissions needed for a task. A dedicated service account with granular database permissions avoids shared, over-privileged credentials, limiting blast radius if compromised and satisfying the constraint that database access be scoped to exactly what the application requires.
Why this answer
Using a dedicated service account with granular permissions for database access embodies least privilege by granting only the necessary permissions to perform specific tasks. This minimizes the attack surface and limits potential damage from compromised credentials. The other options either grant excessive permissions or violate least privilege by allowing broad access.
Exam trap
CSSLP often tests the misconception that least privilege means simply using a separate account, rather than ensuring that account has only the minimal necessary permissions.
How to eliminate wrong answers
Option A is wrong because granting access to all system environment variables violates least privilege; the application should only access variables it needs. Option C is wrong because enabling 'Everyone' write access to configuration files allows unauthorized modification, a severe security risk. Option D is wrong because running as root or administrator gives the application full control over the system, far exceeding necessary privileges.