QA
Beginner LevelWeb Security & Cyber Defense

What is the Principle of Least Privilege (PoLP) in application and cloud security?

❓ Interview Prompt: Explain Principle of Least Privilege (PoLP), limiting permission blast radius, IAM roles, database user privileges, and container scoping.

The Principle of Least Privilege (PoLP) dictates that every user, process, application, and service account MUST be granted ONLY the minimum permissions necessary to complete its specific function:

Application Examples:

•
Database User: Web applications should connect using a DB user with 'SELECT, INSERT, UPDATE' permissions on specific tables (NEVER 'DBA' or 'root' permissions!).
•
Cloud IAM: Grant AWS IAM roles access ONLY to the specific S3 bucket required.
•
Containers: Run Docker containers as unprivileged non-root users ('USER node').

Code Implementation Example

dockerfile
# Secure Dockerfile applying Principle of Least Privilege (Non-root user)
FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
# Switch from root to unprivileged node user!
USER node
EXPOSE 3000
CMD ["node", "server.js"]
💡Configuring an unprivileged non-root container user in Dockerfile.
🎯 Interview Key Takeaway

Enforce the Principle of Least Privilege across database users, IAM roles, and containers to minimize attack blast radius.

#Least Privilege#PoLP#Security Principles#Beginner
Back to all Web Security & Cyber Defense Questions→

More Web Security & Cyber Defense Interview Questions

Beginner LevelSecurity & Web Security

Explain OWASP Top 10 vulnerabilities (XSS, CSRF, SQL Injection) and their defenses.

Beginner LevelSecurity & Web Security

What are the 3 types of XSS (Stored, Reflected, DOM-based) and how do they differ?

Beginner LevelSecurity & Web Security

How do Parameterized Queries (Prepared Statements) prevent SQL Injection attacks?