Access Control

Obviously, access control is a foundational topic of computer security. If a non-authorized user (i.e., an attacker) gains access to resources of your system, your system has been compromised; your system is not secure.

Examples

Access control works at a number of levels:

Subjects and Objects

When we discuss access control, we use the terms like subjects and objects.

Reference monitor

A reference monitor enforces an access control policy over subjects (e.g., processes and users) ability to perform operations (e.g., read and write) on objects (e.g., files and sockets) on a system.

There are a few requirements that the reference monitor of a system should satisfy.

Access Control Matrix

A straightforward method that we can use to specify which subjects can access which objects is using a big matrix. In particular, in an access control matrix:
/etc/passwd /usr/bin/python3 /home/alice /home/bob  ...  
root read, write read, write, execute read, write, execute read, write, execute
alice read read, execute read, write, execute
bob read read, execute read,write, execute
...
The above shows a toy access control matrix for a fictional file system.

Drawbacks

With an access control matrix, determining which subject can access which object is super easy and quick, which is good! However, there are a few drawbacks that discourages people from using the access control matrix.

Access Control Lists

Access control lists are one way to overcome inefficiency of the access control matrix mechanism.

Pros and cons

ACLs provide the following advantages: However, there are some disadvantages as well:

Access control lists (ACL) in UNIX

The UNIX file system implements the concept of access control lists. As shown in the above, each file allows permissions set for
  • the owner of the file,
  • the group to which the owner belongs, and
  • everyone else (all).
$ ls -alF
...
-rw-r--r--  1 choi scs   126 Oct 21 21:44 sh.txt
-rw-r--r--  1 choi scs   127 Nov  4 10:37 shtxtcode.txt
-rwxr-xr-x  1 choi scs 16952 Oct 31 22:08 stack*
-rw-r--r--  1 choi scs   337 Oct 31 22:08 stack.c
...
For example, consider file stack in the above:
 -rwxr-xr-x  1 choi scs 16952 Oct 31 22:08 stack* 
One can use shell commands like chmod, chown, chgrp to change the permission.

If one needs an access control list that is more granular than owner-group-others permissions, UNIX provides the following commands:
  • getfacl: get file ACL.
  • setfacl: set file ACL.
We are going to learn more about these commands during the lab.
~$ getfacl README
# file: README
# owner: choi
# group: scs
user::rw-
user:www-data:rwx               #effective:rw-
user:choi:rwx                   #effective:rw-
group::r-x                      #effective:r--
mask::rw-
other::---

Access control lists in Windows

Windows also provides ACL. To view or change a Windows ACL, right click "Properties", click the "Security" tab, and click "Advanced".

Capabilities

In another approach, capabilities take a subject-based approach. That is, for each subject, there is a list containing all the objects and the access rights for that subject. For example, the capability of alice is showne below.
alice: (/etc/passwd, r), (/usr/bin/python3, rx), (/home/alice, rwx)

ACLs vs Capabilities

ACLs and Capabilities with iPhone/Android

Discretionary Access Control (DAC) vs Mandatory Access Control (MAC)

DAC vs. MAC

When DAC is not sufficient

The DAC model often works poorly in environments where management needs to enforce its policies and define access permissions. For example, consider the following situation:

To summarize:

So, how could we fix the problem? The problem is, with DAC, it's hard to fix this once Alice's account is compromised. After reading the file, she can always create and write her own file, by the definition of DAC.

Example of MAC: The Bell-LaPadula (BLP) Model

The Bell-LaPadula model puts subjects and objects in security levels. One example is the U.S. military classification scheme:

top secret > secret > confidential > restricted > unclassified 
  • A subject is said to have a security clearance of a given level.
  • An object is said to have a security label of a given level.

Properties

The BLP model defines the following two properties:
  • Simple Security Property (SSP). A subject can read an object only if the security clearance of the subject dominates or equals the security label of the object. This is also known as no-read-up rule.
  • The *-property (star property). A subject can only write into an object of greater or equal security level. This is also known as no-write-down rule. Because of this rule, one cannot spill classified information.
If you think about it, these two properties make sure of the following:

Basic Security Theorem

Actually, Bell and LaPadula proved a Basic Security Theorem in their paper: The fact that their access control system can be rigorously proved to be secure is quite cool!

Limitations of BLP model

Although it is provable secure, the BLP model mainly works only for confidentiality; it only prevents unauthorized disclosure. BLP doesn't deal with the integrity of the data.

MAC in Android, iOS and Windows