Access Control Models: RBAC vs DAC vs MAC, Least Privilege | AP Cybersecurity

AP Cybersecurity Topics › Access Controls
Unit 5 • Topic 5.2 • Protecting Data

Access Control Models Explained: RBAC, DAC, MAC & Least Privilege

Access control decides who can reach which data and what they can do with it. Topic 5.2 covers the principle of least privilege, the five access control models (RBAC, RuBAC, DAC, MAC, and Bell-LaPadula), and how to set Linux file permissions with chmod.

5access control models
Least privilegeonly what is needed
chmod4=read 2=write 1=execute
Broad accessOne breach exposes allLeast privilegeBreach is containedvs
Least privilege shrinks what a compromised account can reach.

Authorization and least privilege

Authorization is granting an entity permission for a specific type of access to a resource. It comes after authentication: authentication proves who you are, authorization decides what you may touch.

The principle of least privilege says entities should get exactly as much access as they need to do their job and no more. If a compromised account has only narrow access, the attacker is contained to that narrow scope, which is why over-permissioned accounts make breaches far worse.

Scenario

An intern is given full administrator rights 'to be safe.' Why does this violate least privilege?

Reveal answer

Least privilege grants only the access a role needs. Admin rights far exceed an intern's needs, so if that account is phished, the attacker inherits broad control instead of a small slice.

Exam tip

Authentication proves identity; authorization decides access. Least privilege means the narrowest permissions that still let the user do their job.

The five access control models

An access control model defines how the system decides which subjects (users or apps) get which type of access to which objects (files or apps). The CED names five, and the exam tests choosing the right one for a scenario.

Model How access is decided Example
RBAC (role-based) By the subject's assigned role Anyone in the "accountant" role can use payroll software
RuBAC (rule-based) By rules and conditions, layered on top of another model Deny database access outside business hours
DAC (discretionary) The owner of an object sets others' access Bob lets Alice edit his file and Frank only view it
MAC (mandatory) Fixed levels assigned by an administrator Government or military clearance levels
Bell-LaPadula A MAC model summarized as "write up, read down" You cannot read above your level or write below it
Scenario

A company wants access to a system allowed only during business hours and only from devices on the corporate network. Which model fits?

Reveal answer

Rule-based access control (RuBAC). It applies conditional rules (time and network) on top of whatever base model already grants access, denying access when the conditions are not met.

Exam tip

Match the trigger: role decides = RBAC, conditions/rules decide = RuBAC, owner decides = DAC, fixed admin levels = MAC, 'write up, read down' = Bell-LaPadula.

Linux permissions with chmod

On a Linux system, every file has three permission sets in a fixed order: the owner, the group, and all other users. Each set can grant read (r), write (w), and execute (x). In numeric mode, read is 4, write is 2, and execute is 1, and you add them up per entity.

Worked example: chmod 750 report.txt
numeric values: read = 4, write = 2, execute = 1
7 = owner = 4+2+1 = rwx (read, write, execute)
5 = group = 4+0+1 = r-x (read, execute, no write)
0 = others = 0 = --- (no access at all)
Scenario

You want the owner to read and write, the group to read only, and everyone else to have no access. What chmod number is that?

Reveal answer

chmod 640. Owner 6 = read(4)+write(2) = rw-, group 4 = read = r--, others 0 = ---. That produces -rw-r----- .

Exam tip

Read down the three digits as owner, group, others. Add 4+2+1 per digit: 7=rwx, 6=rw-, 5=r-x, 4=r--, 0=no access.

Real-world example

Over-permissioned accounts amplify breaches

Breach investigations repeatedly find that over-privileged accounts let attackers move freely after a single compromise. Least privilege would have limited them to a small scope.

Grant only the access the role needs.

Key Terms

Authorization Granting permission for a type of access to a resource.
Least privilege Giving only the access needed, and no more.
Data classification Ranking data by sensitivity to set controls.
Access control Settings that map users to allowed resources.

Match It Up

Tap a term, then tap its definition. Correct pairs lock in green.
Term
Definition
All matched. Nice work.

Common Mistakes

!

Granting broad access 'to be safe'

That violates least privilege and widens the blast radius of a compromise.

!

Confusing authentication with authorization

Authentication proves identity; authorization decides what that identity may access.

!

Ignoring data classification

Sensitive data warrants tighter access than low-risk data.

!

Forgetting to remove old access

Access should shrink as roles change, not just grow.

Check for Understanding

Predict your answer before you tap. Click a choice to check it and read why.
Question 1 Predict first
A rule grants system access only during business hours and only from corporate-network devices. Which access control model is being used?
D. Rule-based access control (RuBAC) applies conditional rules, like time and network, layered on another model.
Question 2 Predict first
Which command sets a file so the owner can read and write, the group can read, and others have no access?
A. 6=rw- (owner), 4=r-- (group), 0=--- (others), which is -rw-r----- .
Question 3
The principle of least privilege means giving an entity:
B. Least privilege grants only what the role requires, limiting damage if the account is compromised.
Question 4
In the Bell-LaPadula model, the rule 'write up, read down' means a subject may not:
A. Bell-LaPadula forbids reading above your level (and writing below it), summarized as write up, read down.
Question 5
Which statements are true? I. Authorization decides what an identity may access. II. Authentication proves identity. III. DAC lets a central administrator set all levels.
B. I and II are correct. DAC lets the file owner set access, not a central admin (that is MAC), so III is false.
Question 6
Access in which only members assigned the 'nurse' role can open patient charts is an example of:
C. Granting access by assigned role is role-based access control (RBAC).

Frequently Asked Questions

Role-based (RBAC, by role), rule-based (RuBAC, by conditions), discretionary (DAC, the owner decides), mandatory (MAC, fixed admin-set levels), and Bell-LaPadula, a MAC model summarized as write up, read down.
Giving every entity exactly as much access as it needs to do its job and no more, so a compromised account is contained to a narrow scope.
Each of the three digits sets owner, group, and others. Add read=4, write=2, execute=1 per entity. So chmod 750 gives the owner rwx, the group r-x, and others no access.
RBAC grants access based on a subject's assigned role. RuBAC grants or denies based on conditional rules, like time of day or network location, and is usually layered on top of another model.

Get in Touch

Whether you're a student, parent, or teacher — I'd love to hear from you.

Just want free AP CS resources?

Enter your email below and check the subscribe box — no message needed. Students get daily practice questions and study tips. Teachers get curriculum resources and teaching strategies.

Typically responds within 24 hours

Message Sent!

Thanks for reaching out. I'll get back to you within 24 hours.

🏫 Welcome, fellow educator!

I offer curriculum resources, practice materials, and study guides designed for AP CS teachers. Let me know what you're looking for — whether it's classroom materials, a guest speaker, or Teachers Pay Teachers resources.

Email

[email protected]

📚

Courses

AP CSA, CSP, & Cybersecurity

Response Time

Within 24 hours

Prefer email? Reach me directly at [email protected]