Access Control Models (DAC, MAC, RBAC)
What Are Access Control Models?
Access control models are frameworks that define how permissions are assigned and enforced, determining which users or processes can access specific resources within a system.
Discretionary Access Control (DAC)
In DAC, the owner of a resource decides who is granted access and what level of permission they receive, offering flexibility but relying heavily on the owner's judgment.
Mandatory Access Control (MAC)
MAC enforces access rules centrally based on fixed security labels and classifications, and individual users cannot alter these rules - commonly used in government and military systems requiring strict confidentiality.
Role-Based Access Control (RBAC)
RBAC assigns permissions based on a user's role within an organization, such as "admin" or "editor," simplifying management by grouping similar access needs rather than assigning permissions individually.
| Model | Who Controls Access | Flexibility |
|---|---|---|
| DAC | Resource owner | High |
| MAC | Central authority/system policy | Low |
| RBAC | Assigned roles | Moderate |
Each Model in a Real System
DAC on a Linux file
Standard Linux permissions are discretionary. The file owner decides who can read or write, and can change it at any time.
ls -l report.txt
# -rw-r----- 1 priya finance 2048 report.txt
chmod 640 report.txt # owner read/write, group read, others nothing
setfacl -m u:arjun:r report.txt # owner grants one extra user read access
The weakness is visible here: if Priya grants access carelessly, nothing stops her.
MAC with SELinux
SELinux labels processes and files and applies a central policy. Even if a web server process runs as root, the policy can stop it reading files that are not labelled for web content. Users cannot override these rules with chmod.
ls -Z /var/www/html/index.html
getenforce # Enforcing, Permissive or Disabled
RBAC in an application
Most business apps and cloud platforms use roles. Permissions attach to the role, and users are added to roles.
| Role | View invoices | Create invoices | Approve payments |
|---|---|---|---|
| Viewer | Yes | No | No |
| Accountant | Yes | Yes | No |
| Finance Manager | Yes | Yes | Yes |
Attribute-Based Access Control
ABAC decides access using attributes of the user, the resource and the situation, for example "allow if the user's department equals the document's department and the request comes from a company device". It is more flexible than RBAC and avoids creating hundreds of narrow roles, but policies are harder to read and test. Many organisations use RBAC for broad access and add a few attribute conditions on top.
Designing Roles Without Creating a Mess
- List the tasks people actually perform, not job titles.
- Group tasks into a small set of roles and give each role only the permissions those tasks need.
- Separate duties that should not sit with one person, such as creating and approving the same payment.
- Assign users to roles, never permissions directly to users.
- Review memberships on a schedule and remove access when people change teams or leave.
Mistakes That Weaken Access Control
- Role explosion: a new role for every exception until nobody understands them.
- Privilege creep: people keep old access after moving to a new job.
- Shared admin accounts: actions cannot be traced to a person.
- Checks only in the user interface: hiding a button is not enough; the server must check permission on every request.
- No logging: without access logs, misuse goes unnoticed.
Checklist: least privilege by default, roles reviewed regularly, sensitive actions logged, separation of duties for money and data changes, and server-side checks on every protected action.
Ready to master Cybersecurity Training Course?
Join Uncodemy's hands-on training and build real-world cybersecurity skills with expert mentors.