Authorization

Authorization

One-liner: The process of verifying what you can do after your identity is confirmed.

🎯 What Is It?

Authorization (AuthZ) is the security process that determines what resources and actions an authenticated user can access. It answers the question: "What are you allowed to do?"

📊 Authorization Models

Model Description Use Case
DAC (Discretionary) Owner controls access File systems (chmod)
MAC (Mandatory) System enforces labels Military, government
RBAC (Role-Based) Access via roles Enterprise apps
ABAC (Attribute-Based) Access via attributes Cloud, dynamic policies
ReBAC (Relationship) Access via relationships Social networks, graphs

🛡️ RBAC Deep Dive

User → Role → Permission → Resource

Example:
Alice → "Editor" → [read, write] → /documents/*
Bob   → "Viewer" → [read]        → /documents/*

❗ Authentication vs Authorization

Authentication Authorization
WHO are you? WHAT can you do?
Happens first Happens after AuthN
Validates identity Validates permissions
Example: Login Example: Access admin panel

🚨 Common Authorization Vulnerabilities

🎤 Interview STAR Example

Situation: Users could access other users' invoices by changing the ID in the URL.
Task: Identify the vulnerability and implement proper access controls.
Action: Identified IDOR vulnerability. Implemented server-side authorization checks verifying user ownership before returning data. Added access control tests.
Result: Eliminated unauthorized data access. Passed subsequent pentest with no authorization findings.

✅ Best Practices

📚 References