Apply least privilege: design and review only the access work requires
Least privilege means giving a person or program only the access and resources needed for its assigned work. Narrow permissions reduce what an attacker can read or change if an account is compromised or code has a flaw. Splitting role names is not enough: define who can do which action on which resource, under what conditions and for how long, check every request, then revisit permissions as work changes.
Apply least privilege: design and review only the access work requires
Least privilege means giving a person or program only the access and resources needed for its assigned work. Narrow permissions reduce what an attacker can read or change if an account is compromised or code has a flaw. Splitting role names is not enough: define who can do which action on which resource, under what conditions and for how long, check every request, then revisit permissions as work changes.
This guide covers access control for people and application features. Detailed credential and cloud-role operations for service identities are a separate subject. Least privilege is not a fixed list of “smallest” permissions; it is a process for grounding and verifying access in actual work and resources.
What do role labels miss?
Successful sign-in does not mean a person may access every feature or record. An accountant and a sales representative at the same organizational level need different data; people with the same role may be assigned different customers or projects. An administrator may also need a regular account for routine work.
OWASP recommends least privilege both horizontally and vertically. Horizontal limits prevent access to another person’s resources at the same privilege level; vertical limits separate capabilities such as ordinary user and administrator actions. A simple “admin/user” split may not express row-level access or whether a particular action is allowed on a specific object.
How can an access decision be made concrete?
List resources and actions first, then record the work-based reason for each allowed combination. The table below is a hypothetical project-management app example.
| Actor and context | Resource and action | Decision and condition | Basis or verification |
|---|---|---|---|
| Project member | Read documents in a project they belong to | Allow | The server checks that membership is active |
| Project member | Change project settings or members | Deny by default | Check both the project-admin role and the specific project scope |
| Finance staff | Read billing records | Allow only records for assigned organizations | Check organization ID and user assignment on every request |
| Finance staff | Approve a refund | Separate requester and approver or require another approval | Apply separation of duties to high-impact actions |
| Ordinary user | Change security settings or grant policy | Deny | Restrict security administration to designated roles and record its use |
Do not trust an object ID supplied by the user. If someone changes a project ID in a URL or request body, the server still needs to check the current user’s rights and the object’s ownership or organization. Hiding a button in the interface improves usability; it does not replace access control.
How should roles, attributes, and default denial work together?
Role-based access control (RBAC) assigns bundles of permissions by job or responsibility, so it is often easy to understand and administer. Too many roles or repeated exceptions can cause role explosion and complex rules. Attribute-based access control (ABAC) evaluates properties of the user, resource, action, or environment; it can express organization, project, data classification, location, or time conditions. It also requires clear definitions and reliable, current attributes, plus policies that people can review. Neither model is always better: use roles for stable job bundles and attributes for resource-specific or contextual conditions, considering policy complexity and operational capacity.
When no rule matches, deny by default. This does not mean making every page private: explicitly allow public pages and explicitly authorize protected resources and actions. Do not assume a new feature or resource automatically inherits access just because an existing role exists.
How can permissions be reduced through their life cycle?
**Inventory work and resources.** List user types, important data and functions, read/create/change/delete/admin actions, and trust boundaries.
**Grant only needed combinations.** Use roles or attributes and object ownership or organization to check the actor, action, and target on each request. Separate sensitive administration with a dedicated account or extra approval where appropriate.
**Enforce checks on the server for every request.** Confirm that the same policy applies to list views, direct API calls, and background paths.
**Limit access by context and duration.** For emergency or temporary project access, set a start and expiry time; consider activation only when needed. Give standing access an owner and work-based reason.
**Revoke when work changes or ends.** Recalculate access after job, project, or organization changes and contract termination. Check that disabling an account does not leave separate tokens or shared grants usable.
**Review use and denials.** Compare actual use with approved policy to find excess rights. Lack of use during an observation period alone is not proof a rare close, recovery, or seasonal task is unnecessary; check task cycles and owners before removal.
How do you verify least privilege?
Test allowed and denied cases. Confirm that a user can read their own object but not another organization’s, that changing an object ID is rejected, and that unspecified actions are denied. Verify that even privileged users cannot access security functions they do not need for their task. Include integration cases for role or attribute changes, session refresh, cached permissions, and background jobs.
During operation, record the reason, approver, and duration for exceptions and permission changes. At review time, compare current access with the design. Access logs help identify unused permissions, but no log entry does not by itself prove a permission is unneeded. Audit sensitive administrative actions without recording secrets.
The goal is not to block every possible access. It is to let approved work happen reproducibly while narrowing, with evidence, the resources and actions a mistaken account, request, or feature can reach. Removing old access can be harder than granting it, so start narrow and review after work changes.
References
NIST CSRC Glossary, least privilege — limiting users and processes to the minimum access needed for assigned tasks.
NIST SP 800-53 Rev. 5, AC-6 Least Privilege — authorizing only access needed for organizational tasks, including process access and security functions.
NIST SP 800-171 Rev. 3, 03.01.05–03.01.07 — review and adjust role privileges, separate privileged accounts and functions, and log privileged actions.
OWASP Authorization Cheat Sheet, Enforce Least Privileges / Deny by Default / Validate the Permissions on Every Request — development guidance on mapping actors, resources, and actions, default denial, and per-request checks.