least privilege
Giving every program and person only the access they need, and nothing more.
In more detail
Each extra permission is something an attacker or a mistake can use. Granting only what a task needs shrinks the damage any one failure can do.
Examples
Connect as an ordinary user and become root only for the tasks that need it; give each person the vault passwords for only the environments they run.Non-root containers, signing keys only on the identity server, public keys only on microservices.On a Linux host this means narrow sudo rules instead of root shells, group access instead of world-writable files, few setuid programs and firewalls that allow only required ports. Each step shrinks what an attacker gains from one mistake.Few identities should be able to create CronJobs, webhooks or role bindings.One action (s3:GetObject) on one prefix (arn:aws:s3:::reports/*) instead of s3:* on *In Terraform: Pipelines that only plan should hold read-only credentials; only the protected apply job needs write access, and nobody should be able to destroy production from a laptop.Related terms
- become — The Ansible keyword that switches on privilege escalation, so a task or a whole play runs as another account, root by default.
- privilege escalation — Gaining the rights of a more powerful account, such as root, either deliberately through a tool like sudo or illegitimately through a flaw.
- access control — The rules and mechanisms that decide who may read, use or change a resource.
- OAuth scope — A named permission a token carries, such as tasks:read or tasks:write, limiting what the token may be used for.
- audience — The recipient a token is meant for, named in its aud claim, such as one particular API.
- data minimisation — Collecting, keeping and exposing only the personal data a stated purpose actually needs.
- IAM policy — A JSON document that lists which actions are allowed or denied on which resources, and under which conditions.
- wildcard — A special character, such as *, that stands for any value or any run of characters when matching names or patterns.
- blast radius — How much of a system is affected when something fails or has to be running for a check to happen.
- IAM policy simulator — A free IAM tool that tells you whether a policy, or an existing identity, would allow a given action on a given resource, without doing anything.
- workflow permissions — The workflow or job key that sets exactly what the GITHUB_TOKEN may do, such as contents: read.
- trust policy — A JSON document on a cloud role that says who may assume the role and under which conditions.
- GITHUB_TOKEN — A short-lived access token GitHub creates for each job so the workflow can call the GitHub API for its own repository.
- non-root user — An ordinary user account with limited rights, which a container should run its service as.
- Linux capabilities — Separate pieces of root power, such as binding low ports or changing file owners, that can be granted or removed one by one.
- read-only root filesystem — Running a container so that nothing in its root filesystem can be changed, with writable space only where you add it.
- attack surface — Everything an attacker could try to use against a system: open ports, installed programs, accounts and settings.
- public-key cryptography — Cryptography that uses a pair of keys: a private key kept secret to sign or decrypt, and a public key that can be shared to verify or encrypt.
- sudo — A command that runs another command with administrator (root) rights after checking you are allowed to.
- sudoers file — The configuration file, /etc/sudoers plus files in /etc/sudoers.d, that says who may run which commands as which user through sudo.
- setuid — A permission bit on an executable that makes it run with the file owner's identity instead of the identity of the user who started it.
- default deny — A starting policy that blocks all traffic, so only connections you then explicitly allow are possible.
- authorization — Deciding whether an already identified caller may perform a particular action on a particular resource.
- role-based access control — An authorization model where permissions are grouped into named roles, such as reader or editor, and people or services are given roles.
- short-lived credentials — Credentials issued for one job or session that expire within minutes or hours, instead of long-lived keys stored as secrets.
- release gate — An automatic check that must pass before a change may be deployed.
Taught in
- Planning, Memory And Many Agents — AI Engineering: LLM Apps, RAG & Agents
- Excessive Agency — AI Engineering: LLM Apps, RAG & Agents
- Connections And Privilege Escalation — Ansible Configuration Management at Scale
- Vault IDs And Multiple Passwords — Ansible Configuration Management at Scale
- OAuth Two And OpenID Connect — Modern API Architecture: REST, GraphQL & gRPC
- Scopes And Key Rotation — Modern API Architecture: REST, GraphQL & gRPC
- Handling PII And Data Privacy — Modern API Architecture: REST, GraphQL & gRPC
- Pipeline Security: The Build Role That Could Do Anything — AWS Certified DevOps Engineer – Professional (DOP-C02) Exam Prep
- Should Theo Be An Owner? Azure Roles And Scopes — Microsoft Azure Administrator (AZ-104) Exam Prep
- Brightside Opticians: A Case Study, Read The Exam's Way — Microsoft Azure Administrator (AZ-104) Exam Prep
- Seventy-Two Percent, Now What? The Full Mock And Your Review Plan — Microsoft Azure Administrator (AZ-104) Exam Prep
- Zero Trust, Defence In Depth And Defender For Cloud — Microsoft Azure Fundamentals (AZ-900) Exam Prep
- Governance Decision Drill — Microsoft Azure Fundamentals (AZ-900) Exam Prep
- Securing Pipelines: Secrets Management — Continuous Integration & Continuous Delivery Pipelines
- Keyless Authentication: OIDC to the Cloud — Continuous Integration & Continuous Delivery Pipelines
- Bootstrapping Flux on a Cluster — Continuous Integration & Continuous Delivery Pipelines
- Authentication, Authorisation And Admission — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Final Review: Where Your Marks Are At Risk — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Users, Groups and Roles — Cloud Infrastructure & Hyperscaler Architecture
- Policies and Least Privilege — Cloud Infrastructure & Hyperscaler Architecture
- Infrastructure as Code (Handover to Terraform) — Cloud Infrastructure & Hyperscaler Architecture
- The Intern Who Could Delete Backups: Identity And Access — CompTIA Cloud+ (CV0-004) Exam Prep
- An Image That Runs As Root: Security Best Practices — CompTIA Cloud+ (CV0-004) Exam Prep
- The Bill That Jumped Overnight: Spotting Attacks — CompTIA Cloud+ (CV0-004) Exam Prep
- A Padlock Warning On Monday: Troubleshooting Security — CompTIA Cloud+ (CV0-004) Exam Prep
- Shared Responsibility Model & Cloud Threat Landscapes — Cloud Security & DevSecOps Engineering
- Cloud IAM Architecture & Permission Boundaries — Cloud Security & DevSecOps Engineering
- Least Privilege Enforcement & CIEM Architecture — Cloud Security & DevSecOps Engineering
- Minimal Bases, Non Root Users And Smaller Images — Docker Architecture & Production Containers
- Harden And Deliver The Complete Service Stack — Docker Architecture & Production Containers
- Environment Layering and User Secrets — Modern .NET Core, C# & Enterprise Microservices
- JWT Verification: Asymmetric Keys & Refresh Rotation — Production Full-Stack Engineering
- Containerization Architecture: Multi-Stage Dockerfiles — Production Full-Stack Engineering
- RBAC: Roles, Bindings And Least Privilege — Kubernetes: Production-Grade Container Orchestration
- Setuid, Setgid, And Root Through sudo — Linux Fundamentals & Systems Administration
- Firewalls: Default Deny, State And Rule Order — Linux Fundamentals & Systems Administration
- Containerized Deployment: Multi-Stage Docker Builds — Next.js 15 & Modern App Router Architecture
- Runtime Configuration: CLI Flags & Native --env-file — Node.js Internals & Backend Services
- Production Hardening: Graceful Shutdown & Docker — Node.js Internals & Backend Services
- Detecting Persistence: Tasks, Registry & Services — Security Operations & Threat Hunting (SOC)
- Least Privilege In IAM And RBAC — Application Security & Threat Modeling for Engineers
- The Environment Variable Trap — Application Security & Threat Modeling for Engineers
- Workload Identity — Application Security & Threat Modeling for Engineers
- Container Security: Minimal Bases And Non Root — Application Security & Threat Modeling for Engineers
- Tearing It Down With Destroy — Infrastructure as Code with Terraform
- Running Terraform In CI — Infrastructure as Code with Terraform
References
- NIST glossary: least privilege
- IAM best practices: apply least-privilege permissions
- OWASP Docker Security Cheat Sheet
- sudoers manual
- OWASP Authorization Cheat Sheet
Certification courses
- AWS AIP-C01 course and practice exam: AI engineering with LLM apps, RAG and agents
- AWS DevOps Engineer Professional course and practice exam: DOP-C02
- AZ-104 course and practice exam: Microsoft Azure Administrator
- AZ-900 course and practice exam: Microsoft Azure Fundamentals
- CKAD course and practice exam: Certified Kubernetes Application Developer
- CompTIA Cloud+ course and practice exam: CV0-004