Excess permissions are a vulnerability: if an account or service is compromised, the attacker gets everything its owner had access to. The principle of least privilege limits that damage: everyone holds the smallest set of permissions sufficient for their task.
What it means in practice
- a developer gets permissions for their own project, not for every repository and production database;
- a service gets access to one database and one message queue, not to the whole network;
- a container runs as an unprivileged user with no access to the host;
- an administrator holds permanent permissions for day-to-day tasks, while elevation to root is requested and granted for a limited time.
Where the principle comes from
The principle was formulated by Jerome Saltzer and Michael Schroeder in the paper “The Protection of Information in Computer Systems” (1975): every program and every user of a system should operate using the least set of privileges necessary to complete the job. The authors explained that the principle limits the damage from an accident or an error and reduces the number of potentially dangerous interactions among privileged programs. The same paper, among its eight design principles for protection, also includes separation of privilege and complete mediation.
How to apply it
The mechanisms differ, the idea is the same: permissions are granted by role and task, not “just in case”. The NIST glossary describes the principle as an architecture requirement: each participant is granted the minimal resources and privileges needed for its function. A role model defines what a role may do; sudo and PAM decide when a user receives elevated privileges; in the cloud, policies grant a service access only to the resources it needs.
dbadmin=> CREATE USER app_reader;dbadmin=> GRANT SELECT ON sales TO app_reader;dbadmin=> -- no GRANT INSERT, UPDATE, DELETE — the service only readsSources
the term is written from these pagesVerified 9 Nov