Easier to read with cream paper, a tint, more contrast or larger text? Choose your colours and text, once, for every page.

Preview

DI 1.27; NC 1.26; DS 1.26: Access control: MAC, DAC, ABAC and RBAC

This is the first page of the lesson. Read it and have a go at the activities. The rest is in the full lesson.

55 minutes

Who may open the pay file?

A firm of 200 has one file with everyone's pay. Five people need it. The other 195 must not see it.

Who decides? The owner? The boss? A rule about jobs? A rule about time and place?

Four models give four different answers.

Key words

WordWhat it means
FirewallA gate that lets some traffic in or out and blocks the rest.
Access controlDeciding who may use which resource, and how.
ResourceAnything a user may want to use, such as a file, a printer or a server.
Security levelA rank given to data or to a person, such as public, internal or secret.
AttributeA fact about a user, a device or a situation, such as department or time of day.
RoleA job title that carries a set of rights, such as teacher or student.
MACMandatory access control: access is set by security levels, and users cannot change it.
DACDiscretionary access control: the owner of a resource chooses who may use it.
ABACAttribute-based access control: access depends on facts about the user, device and moment.
RBACRole-based access control: access depends on the user's role.

The cells students fill in are left blank in this preview.

By the end of this lesson

Note

I can describe MAC, DAC, ABAC and RBAC, and choose the right model for a situation.

Starter: IAAA

Have a go

Starter: IAAA

3 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Your answers are marked here and are not kept. A college account keeps every student’s marks.

Cycle 1: MAC and DAC

MAC is strict. Data has a security level and so does each person. A person may open data at their own level or lower. Users cannot change the rules. Armies and secure labs use it.

DAC is flexible. The owner of a file decides who may open it. A home folder, or a Linux file, works this way. It is simple, but owners can make mistakes, such as sharing with everyone.

Run: the owner sets the access

Command
cd /tmp && echo "pay list" > pay.txt && chmod 640 pay.txt && ls -l pay.txt

A command for the lesson’s lab terminal. It is shown here and not run.

What you should see

Note

A line starting -rw-r----- . The owner can read and write. The owner's group can read. Everyone else gets nothing. The owner chose this with chmod. That is DAC.

Cycle 2: RBAC and ABAC

RBAC gives rights to roles, and people get roles. All teachers can mark. All students can submit. When someone changes job, change the role. It scales well.

ABAC looks at attributes: who you are, what device you use, where you are, what time it is. Rule: "Finance staff, on a managed laptop, between 9 and 5." It is the most precise, and the most work to set up.

Run: a group acts like a role

Command
groupadd -f payroll && (id aisha >/dev/null 2>&1 || useradd -M -G payroll aisha) && chgrp payroll /tmp/pay.txt && ls -l /tmp/pay.txt && su -s /bin/sh aisha -c "cat /tmp/pay.txt"

A command for the lesson’s lab terminal. It is shown here and not run.

The lesson goes on

12 more parts of this lesson are in the full curriculum, with the tasks, the final check and the labs. A college account gives your students all of it.