Pebellslearn by building
0%
RoadmapsMatrixCoursesSandboxSign in
Operating Systems for Security  ›  Lesson

Permissions and Least Privilege

Understand Permissions 12 minPermissions control whether an account may read, write or execute something, and least privilege means granting each account only what its job needs.

Permissions and Least Privilege

The shop's shared drive has three folders: Stock, Staff Rota and Payroll. Right now everyone can open and edit all three, including Leo, the Saturday helper. Nothing bad has happened yet, but one wrong click, or one stolen password, could expose everyone's pay.

The rule

Give each account only what its job needs, and nothing more.

This is the principle of least privilege. Permissions say what an account may do with a file, folder or system. The classic three:

  • Read — open and view.
  • Write — change, add or delete.
  • Execute — run it as a program (for folders on Linux, it means enter the folder).

On Linux, a file listing shows these for three groups: the owner, the owner's group, and everyone else.

-rw-r----- 1 priya office payroll.csv

After the first character, read the letters in threes: owner rw- (read and write), group r-- (read only), others --- (nothing). So Priya can edit, the office group can read, and nobody else can touch it.

Least privilege also applies to accounts themselves. Daily work should happen on a standard account. An administrator account is used only when installing or changing the system. If malware runs while you are logged in as a standard user, it can do far less.

The shortcut

For every person and every folder, ask "Who needs it, and to do what?" Start from nothing and add only the permissions that have a reason.

Fixing the shared driveStep 1 of 4
  1. Stock

    All staff update stock counts: everyone gets read and write.

The trap is granting "everyone, full control" because it stops people asking for access. Convenience today becomes exposure tomorrow. Also review permissions when people change roles or leave.

Drills

Answer fast — trust the rule.

quick drill

What does least privilege mean?

quick drill

A file shows -rw-r-----. What can "others" (not owner, not group) do?

quick drill

Leo only needs to look at the staff rota. Which permission fits?

quick drill

Why should staff do daily work on a standard account, not an administrator account?

Remember

  • Give each account only what its job needs, and nothing more.
  • Ask "who needs it, and to do what?" and grant read, write or execute only with a reason.
  • Trap: "everyone, full control", daily admin accounts, and forgetting to remove access when people leave.

Practice — level up

0/1 solved

Write your answer, then compare it with a rubric and a model answer.

ExplainWho needs it, and to do what?

Hollow Oak Books adds a fourth folder, Supplier Contracts, which Priya and Sam must be able to edit and the accountant must be able to view. Explain the permissions you would set, and why you would not simply give everyone full control.