Day 52 of 100
The Over-Permissioned Service Account
π₯ Problem Statement
A routine access review turns up a service account with administrator-level permissions across the environment. Digging into what it's actually used for, the answer is underwhelming relative to the grant: read-only access to a handful of specific resources. The broad role was assigned early on, for convenience during initial setup, and nobody ever came back to narrow it once the real, much smaller usage pattern became clear.
ποΈ Environment
- Service account: administrator-level role assignment
- Actual usage: read-only access to a small number of resources
- History: role granted broadly for convenience during initial setup
- No current process for periodically reviewing granted permissions
π€ Your Challenge
How would you safely reduce this service account's permissions without breaking whatever currently depends on it?
- Why is it risky to just immediately revoke broad access and hope nothing breaks?
- What would you want to know about actual usage before deciding on a replacement, narrower role?
- How would you test a reduced-permission role safely before fully cutting over?
- What would make this kind of drift β broad grant, narrow actual use β less likely to happen again?
Solution Hidden
Think through the problem yourself before looking at the answer.
π‘Solution
Step 1 β Understand the symptoms
A broad grant made for setup convenience and never revisited is an extremely common pattern β nobody explicitly decided "this should stay administrator-level forever," it just never became anyone's job to come back and narrow it once real usage stabilized. The gap between "administrator" and "read-only access to a handful of resources" is a large one, and it represents real risk: if this service account's credentials were ever compromised, the blast radius is the entire environment, not the small footprint it actually needs.
Step 2 β Identify the likely bottleneck
The risk here isn't that anything is currently broken β it's latent: an over-permissioned credential is a larger target and a larger potential blast radius than necessary, sitting unused in its broader form until either an audit catches it (as happened here) or, worse, a compromise exploits it. The bottleneck to actually fixing it is usually not technical β it's the fear of breaking something by reducing access without being fully certain what depends on the current broad grant.
Step 3 β Investigation
- Pull actual usage history from audit logs over a meaningful window (weeks to months) β this shows exactly which actions this service account has genuinely performed, which is a much more reliable basis for a new role than guessing from its name or original intent.
- Cross-reference logged actions against the resources this account needs to touch β building a precise list of exactly what permissions are actually exercised, not just what the current role happens to allow.
- Check whether this credential is used by a single, identifiable workload or process, or potentially multiple, less obvious ones β reducing permissions safely requires knowing everything actually depending on it, not just the primary known use case.
Step 4 β Recommended action
Design a new, narrowly-scoped role based on the actual usage evidence gathered β read-only access to the specific resources actually touched, nothing more. Before fully cutting over, test the new role in parallel where possible: apply it to a duplicate or staging credential and confirm the actual workload functions correctly against the narrower permissions before revoking the broad grant on the production credential.
Once confirmed, replace the administrator-level assignment with the new, precise role. Don't leave both in place indefinitely "just in case" β that defeats the purpose of the reduction and recreates the same unused-broad-access risk this whole exercise was meant to close.
Step 5 β Engineering lesson
Least privilege isn't a one-time setup decision β permissions granted broadly for convenience during initial setup tend to persist indefinitely unless something specifically revisits them, and "it's always been this way" is not the same as "it needs to stay this way." A periodic review process, checking actual usage against granted access, is what catches this kind of drift before it's discovered by an audit β or worse, by an incident.
π§ Todayβs Takeaway
Least privilege should be continuously improved.
π Donβt Miss Tomorrowβs Challenge
A new real-world engineering challenge is released every day.
100 Days β 100 Challenges β 100 New Things Learned.
Get the useful stuff, not the noise.
Occasional notes on engineering, Platform Engineering, AI, cloud and things Iβm learning along the way.

