Sub topic 4
Access control and the principle of least privilege
This chapter assumes you know how Windows user accounts and groups work at a basic level and that you have seen the CIA triad (confidentiality, integrity, availability). It builds on the authentication factors chapter. Here you will learn how a system decides what an authenticated user may do, and why the safest answer is "as little as possible."
The working model: who, what, and how much
Access control is the set of rules and mechanisms that decide who can use a resource and what they can do with it. A resource can be a file, a folder, a printer, a share, a registry key, or a whole computer. Access control has three steps, and they happen in a fixed order.
- Authentication proves who you are, for example with a password and a code from your phone.
- Authorization decides what that identity may do. Permissions and rights are checked at this step.
- Accounting records what the identity did, such as logon events and file access in the event logs.
This trio is often called AAA. Many exam questions test whether you can tell the steps apart. A user who types the wrong password failed authentication. A user who logs on fine but sees "Access is denied" on a folder failed authorization.
The principle of least privilege
The principle of least privilege says that every user, service, and program should have only the access needed to do its job, and nothing more. It also limits access in time, so that elevated access ends when the task ends.
It matters because accounts get compromised. Phishing, malware, and stolen passwords all give an attacker whatever the victim could do. A bookkeeper with a standard account exposes only the finance files. The same bookkeeper as a local administrator exposes the whole computer, because the attacker can install software, disable antivirus, and read other users' data.
Least privilege supports the CIA triad in three ways:
- Confidentiality: people cannot read data they have no reason to see.
- Integrity: people cannot change or delete data they do not own.
- Availability: a mistake or a malware infection in one account cannot damage the whole system.
Access control models
Four models appear in exam objectives and in real environments. They differ in who sets the rules.
| Model | Who decides access | Typical use |
|---|---|---|
| Discretionary (DAC) | The owner of the resource | Windows NTFS files and folders |
| Mandatory (MAC) | The system, using labels such as Secret or Confidential | Government and military systems |
| Role-based (RBAC) | Administrators, by job role | Business networks with groups such as Accounting or HelpDesk |
| Attribute-based (ABAC) | A policy that checks attributes like location, device, or time | Cloud and conditional access systems |
In a small office, RBAC is the model you will use most. You create a group for each role, put users in the group, and grant permissions to the group.
Applying least privilege on a Windows workstation
These practices are the ones the exam expects you to recognize.
- Use standard accounts for daily work. Administrators should keep a separate admin account and use it only when needed. User Account Control (UAC) prompts for approval before elevation, which enforces this at the moment of need.
- Assign permissions to groups, not individuals. When someone changes jobs, you move them between groups instead of editing permissions on every folder.
- Disable or rename default accounts. The built-in Guest account is disabled by default on current Windows versions. Confirm that it stays that way. The built-in Administrator account should also be disabled or renamed, because attackers know its name.
- Limit logon times and locations. Logon hour restrictions block access outside working hours. Account lockout policies stop repeated password guessing.
- Require a login after idle time. A screen lock timeout with a password limits who can use an unattended session.
- Remove access at the right time. Disable accounts the day an employee leaves. Review group membership on a schedule.
- Prefer "need to know." Grant access based on a business reason, not on seniority or convenience.
Worked example: the Finance folder
A small firm has a C:\Finance folder. Only the Accounting group should change files there. The Guest account should not exist as a way in. Run both commands from an elevated command prompt.
net user guest /active:no
icacls "C:\Finance" /grant "Accounting:(OI)(CI)M"The first command disables the Guest account. The second grants the Accounting group Modify permission. M means Modify, which allows reading, changing, creating, and deleting files, but not changing permissions or taking ownership. (OI) makes the permission inherit to files in the folder. (CI) makes it inherit to subfolders. Together they apply the permission to everything inside.
Modify is deliberate. Full Control would let Accounting members change who can access the folder, which they do not need.
To check the result, list the current permissions:
icacls "C:\Finance"Look for the Accounting entry with (OI)(CI)(M). Also look for broad entries such as Everyone or BUILTIN\Users with write access. These often come from the parent folder through inheritance and may need to be removed.
Common errors
- Permission creep. Users change roles and keep old access. Over the years they collect far more rights than any job needs. Regular access reviews fix this.
- Giving Everyone Full Control to "make it work." This removes least privilege entirely. Find the actual missing permission instead.
- Granting rights to users one by one. This is hard to audit and easy to forget when staff leave.
- Shared accounts. If five technicians use one admin login, accounting cannot show who did what, and you cannot remove one person's access without changing the password for everyone.
- Working as an administrator all day. Malware run from an admin session gets admin rights.
- Forgetting that Deny wins. In NTFS, an explicit Deny overrides an Allow. A user in two groups, one allowed and one denied, is denied.
- Leaving default accounts and passwords unchanged. Default credentials are the first thing an attacker tries.
Exam tips
Match the scenario to the control. If the question describes a user who can do more than their job requires, the answer involves least privilege. If it describes one person per account with logs of their actions, the answer is accounting. If it describes owners setting permissions, the answer is DAC. If it describes job-based groups, the answer is RBAC.
Exercise
A help desk technician needs to reset passwords for the Sales department, but a manager proposes making the technician a domain administrator "to be safe." Which principle does this proposal violate, and what is a better approach?
Show answer
It violates the principle of least privilege. A better approach is to create a role-based group (or delegate permission) that allows only password resets for the Sales department, and add the technician to that group. The technician keeps a standard account for daily work.
Exercise
A user is in two groups. Group A has Allow Write on a folder, and Group B has Deny Write on the same folder. Can the user save a file there, and which access control step is involved?
Show answer
No. An explicit Deny overrides an Allow in NTFS. The step is authorization, because the user was already authenticated.
Exercise
Write the command that gives the group Sales the Read and Execute permission (RX) on C:\Reports, inherited by files and subfolders.
Show answer
icacls "C:\Reports" /grant "Sales:(OI)(CI)RX"