Access Reviews, Privilege Escalation and Service Accounts
Access granted correctly can still become wrong over time. This lesson covers periodic access reviews, controlling privilege escalation and managing service accounts.
Learning outcomes
After completing this lesson, you will be able to:
- Explain the purpose of user, system and service account access reviews.
- Describe controls on privilege escalation with sudo and administrator groups.
- Identify good practices for service account management.
Account access reviews
Access reviews (recertification) ask managers and data owners to confirm that each account still needs its access. They cover user accounts, system accounts used by operating systems and devices, and service accounts used by applications. Reviews detect privilege creep, orphaned and dormant accounts, and segregation of duties conflicts. Privileged access is reviewed more frequently than standard access.
Reviewers must be people who understand the business need, not only IT administrators, and unnecessary access is removed promptly. Identity governance tools automate review campaigns and record evidence for auditors.
The main weakness of access reviews is rubber-stamping: a manager presented with a list of 400 entitlements described by cryptic technical names approves them all to finish the task. Reviews become effective when they show reviewers meaningful information, such as plain descriptions of what each permission allows, when it was last used and whether it is unusual for the person's peers, and when they focus attention on the highest-risk items first. A permission unused for six months is a strong candidate for removal regardless of the reviewer's opinion.
Dormant accounts deserve particular attention. An account that has not been used for a long period may belong to someone on extended leave, or it may be a leftover that nobody watches, which attackers value because its misuse is unlikely to be noticed. Many organisations disable accounts automatically after a defined period of inactivity and require a request to re-enable them.
Effective access reviews
Privilege escalation
Legitimate privilege escalation tools let users perform specific administrative tasks. On Unix and Linux, sudo runs commands as another user, usually root, according to the sudoers configuration; on Windows, User Account Control and administrator groups serve a similar purpose. Configurations should grant only the commands needed, require authentication, and avoid commands that allow escape to a full shell, such as editors and interpreters.
Shell escapes are the subtle risk in sudo rules. Granting a user the right to run a text editor as root so that they can edit one configuration file also lets them use the editor's own command feature to start a root shell. The same applies to file viewers with command features, scripting interpreters and programs that can be told to run other programs. Safer approaches grant the specific command with fixed arguments, or use a purpose-built tool for editing protected files that does not run the editor itself with root privileges.
Every use of elevated privileges should be logged centrally and reviewed. Unauthorised escalation through vulnerabilities or misconfigurations is a key attacker technique, so monitoring should alert on new members of administrator groups, unusual sudo use and privilege changes.
The following diagram compares an over-broad sudo rule with a least-privilege rule.

Safe sudo rule?
Service account management
Service accounts run applications, scheduled tasks and integrations. They often hold high privileges and long-lived passwords, and misuse goes unnoticed because no person is watching. Each service account needs a documented purpose and an accountable owner, least privilege, denial of interactive logon, and strong credentials rotated automatically, for example with managed service accounts, workload identities or a secrets vault. Service accounts are included in access reviews and monitored for unusual behaviour such as interactive logins.
Service accounts are difficult to manage because changing their password can break the application that uses it, so teams avoid changing it. Over the years, the password ends up in configuration files, scripts and the memory of former employees. Managed credentials remove that problem: the platform generates a long random password or key, rotates it automatically and supplies it to the application, so no person ever knows it. In cloud environments, workload identities go further by giving the running workload a short-lived token issued by the platform, so there is no long-lived secret to steal at all.
Because service accounts behave predictably, deviations are easy to detect. A backup service account normally logs on to the same servers at the same times; an interactive logon from a workstation, or access to systems it has never touched, is a strong sign of misuse and should raise an alert.
An over-broad sudo rule
To let a web team restart the web server, an administrator adds the rule "webteam ALL=(ALL) ALL" to the sudoers file. What is wrong, and what should the rule be?
The rule gives the team unrestricted root access to the whole server, far beyond the need. The rule should allow only the specific command required, such as the service restart command for the web server, with authentication, and sudo activity should be logged and reviewed. This applies least privilege while still meeting the team's operational need.
Should service accounts allow interactive logon?
Show answer
No. Denying interactive logon limits misuse and makes abnormal use easier to detect.
Exam Tips
Remember for the exam
- Access reviews detect privilege creep and orphaned accounts.
- Grant specific sudo commands, not ALL.
- Every service account needs an owner and no interactive logon.