Mandatory Access Control (MAC) and Role-Based Access Control (RBAC)

Understanding Mandatory Access Control (MAC)

Mandatory Access Control (MAC) is a model designed to enhance security in computer systems by addressing the weaknesses of Discretionary Access Control (DAC). In MAC, access to resources is regulated by a central authority based on the classification of the data and the clearance of users. This contrasts with DAC, where resource owners define access policies, potentially leading to unauthorized data leaks.

Motivation for MAC

The motivation behind using MAC is predominantly informed by the limitations of DAC in controlling the flow of sensitive information. For instance, consider a scenario where Alice shares sensitive data with Bob under DAC. Bob, having read access, can create copies and inadvertently share the sensitive material with others, circumventing the intended controls. In contrast, MAC employs a Trusted Computing Base (TCB) that restricts data sharing in accordance with organizational policies, thereby reducing the risk of unauthorized dissemination.

The Role of Labels in MAC

Labels are essential features in MAC, serving as metadata that provides context about the sensitivity and integrity of the data. In this scheme, each subject (user) and object (resource) is associated with a label consisting of a sensitivity level and a compartment. These labels facilitate fine-grained access control by allowing only authorized users to access specific information based on the nature of the data and the user’s need-to-know.

Label Comparison in MAC

Comparing labels entails examining their sensitivity and compartment level. The relationship between labels can be categorized into three primary forms:

  • Dominance (L1 > L2): This means the label of one subject (L1) provides more access (higher sensitivity or more compartments) than another (L2).

  • Subordination (L1 < L2): This indicates that L1 is less privileged than L2.

  • Equality (L1 = L2): Indicates identical levels and compartments.

This relationship can lead to a partial order of labels, allowing for a structured method of managing permission in access control.

Label Components
  • Label L1 = (l1, c1) where l1 is level (e.g., how sensitive) and c1 is compartment that describes the kind of data in the object.

  • Level typically means how sensitive the data is (e.g., confidential, secret, top secret).

  • Compartment is typically a set (e.g., Cyber arsenal, Conventional Arms, Asia, Europe, America etc.).

Bell-LaPadula (BLP) Model for Confidentiality

The BLP model is a foundational privacy model focusing on confidentiality within MAC systems. It utilizes the concepts of security levels (such as Top Secret, Secret, Confidential, and Unclassified) and compartments to classify data and users. According to BLP:

  • A subject can read an object only if the subject's label dominates the object's label (the simple security property). Read down Rule.

  • A subject can write to an object (have write permissions) only if the object's label dominates the subject's label (the star property). Write up Rule. Prevent users from writing data of lower sensitivity levels.

This structured rule-set helps maintain effective control over sensitive information flows.

How Does State S Change?

State S can change by the following API calls, which modify access, security levels, or the structure of subjects/objects:

  • get_access(): Grants access right based on current permissions.

  • release_access(): Revokes access for a subject to a specific object.

  • read(): Allows a subject to read data from an object, dependent on permissions.

  • write(): Allows a subject to write data to an object, also dependent on permissions.

  • grant(): Provides permissions to a subject for accessing an object.

  • revoke(): Removes permissions from a subject.

  • create()/delete(): Functions that handle the creation or deletion of subjects or objects within the system.

  • change-sensitivity-level(): Adjusts the sensitivity classification of an object or subject, impacting the access control rules and potentially altering their permissions accordingly.

The TCB allows a call when:

  1. The call adheres to the Tranquility principle, which states that a subject cannot change the security class of an active object. This maintains security classification stability during operations.

  2. The call respects the Non-accessibility of inactive objects principle, which requires that objects cannot be accessed unless they're explicitly activated first. This creates a clear boundary between accessible and inaccessible resources.

  3. The call originates from trusted users who are authorized to activate objects. Only designated trusted users can perform certain privileged operations.

  4. The call doesn't need to follow the Bell-LaPadula (BLP) security model rules, which suggests that these particular operations exist outside the standard "no read up, no write down" access control constraints that BLP normally enforces.

Biba Model for Integrity

Biba model focuses on unauthorized modification of data or quality of information in objects. It emphasizes:

  • Read Up and Write Down: Users cannot write to higher integrity levels or read from lower integrity levels.

Another Use of Information Flow
  • Sensitive data is the source from which information flow starts.

  • Reads and writes allowed but tracked (static or dynamic) to see where such information can end up.

  • Prevent information flow at certain exit points (e.g., Social security number being sent to an untrusted remote server).

  • Policy must define sensitive data sources and allowed/disallowed exits.

  • System utilizes techniques like taint tracking to enforce policy (lots of taint tracking papers & systems).

Information Flow and BLP Limitations

Although the BLP model serves adequately in defense and intelligence sectors, it is less effective in commercial environments where data classification is not as rigorous. In a corporate context, challenges arise regarding user roles, permissions, and the fluidity of data access, complicating the traditional BLP framework. Policies, such as Role-Based Access Control (RBAC), emerged to accommodate the requirements specific to commercial implementations of MAC.

Role-Based Access Control (RBAC)

RBAC is a popular access control method that prioritizes roles over individual user permissions. It defines roles that a user can assume, and permissions are allocated based on these roles rather than directly to individual users. This model helps simplify policy management as it links users with specific functionalities while enforcing organizational security requirements effectively.

Implementation of RBAC

RBAC involves several components, including authentication (verifying user identity), role activation (what roles are active for a user), and authorization services (granting access based on active roles). This hierarchical structure allows for more scalable and less error-prone access management, especially in environments with numerous users and varying access levels.

RBAC Implementation
  • Authentication service authenticates users.

  • Role activation service allows authenticated users to activate allowed roles.

  • Authorization service grants access based on currently active roles.

  • More on implementation when we explore SELinux.

Roles vs Groups
  • Group: Set of users but says nothing about permissions.

  • Roles: Set of users who perform a certain function and associated set of permissions.

  • Roles can be activated or deactivated but not the same for groups.

  • Permissions for a role are known from a policy file but no such single place for group permissions.

Policies with Roles
  • Some notation:

    • U = number of users

    • R = number of roles

    • O = number of objects

  • Access control matrix (ACM) size is based on (U.O).

  • Policy file size is U.R + R.O = R .(U+O).

  • For small R, size goes from U.O to U+O.

Conclusion and Other Policies

In conclusion, while MAC, particularly through implementations like the BLP model, addresses the weaknesses of DAC, it is vital to adapt these principles to commercial environments via policies like RBAC, Clark-Wilson, and the Chinese Wall Policy. These adaptations ensure compliance with organizational needs regarding sensitive data flow and access management, thus supporting a secure operational framework.


SELinux Background

SELinux enhances Linux security through tighter restrictions on user access to information by implementing the access control models: Domain/Type enforcement(D/TE), Multilevel Security (MLS), Role Based Access Control (RBAC).

Design Goals for SELinux:

  • Orthogonal to DAC

  • Decouple policy from enforcement

  • Flexible/ Configurable/ Loadable

  • Included in Mainline/ Upstream Kernel

Linux Security Module
  • Linux Security Module (LSM) provides a flexible framework for MAC.

  • Loadable, decouples enforcement from policy.

  • Can implement different security modules like SELinux, LIDS, SMAC, AppArmor.

Linux Security Module (LSM) hook implementation which handles permission checks:

  1. The process begins with a system call that requests permission (e.g. create, open, or delete call).

  2. A decision path follows:

    • If permission is denied, the system returns an error immediately

    • If the specific security module (xyz) is not loaded, it calls the security mediation function (security_inode_permission)

    • If the module is loaded, it proceeds with the module-specific checks

  3. The right side shows the structure of security operations:

    • Each security module (standard LSM and xyz_LSM) implements a set of operation functions:

      • inode_create/xyz_inode_create

      • inode_post_create/xyz_inode_post_create

      • inode_permission/xyz_inode_permission

  • Access Flow:

    • A Subject makes a syscall() to access an Object

    • This request passes through security hooks that can either permit or deny access

  • Policy Components:

    • Text Policy (human-readable security rules)

    • Policy Compiler (transforms text policy into machine-readable format)

    • Binary Policy (compiled security rules)

    • Policy DB (database storing active policies)

  • Decision Making:

    • Security Server consults the Policy DB to make decisions

    • Access Vector Cache improves performance by storing recent decisions

    • Multiple hooks evaluate the request at different stages

    • Each hook can either permit or deny the access

  • Audit System:

    • Records system events for security tracking and compliance


SELinux Attributes – Security Context

Access rules – “allow source target:class operation”

• For example, allow staff_t etc_t:file { read write }

Inheritance rules – child process inherits parent's & file/dir inherit from parent directory

Transition rules – Through execution of file, for example staff_t can transition to

mount_t by executing a binary with type mount_exec_t

Override – No specific override rules. Each access must be explicitly granted


Access Control Model - SELinux MLS

Attributes have inherent hierarchical property

  • Executive/Manager/Employee/Public

  • Top Secret/Secret/Confidential/Unclassified

Information flow-based access policy rules

  • Information flow direction during read, write operations

  • Address Confidentiality and Integrity security goals


Security Context MLS

• MLS Range

• Used as constraint for Type based decisions

• “Effective Level” - “Clearance”

• Each security level contains hierarchical sensitivity level and non-hierarchical categories

• c0,c1,c2.c10,c25,c100.c1023

Categories specified with a “.” or “,” notation

staff_u:staff_r:staff_t:s0-s15:c0.c1023


SELinux MLS Attribute Representation

MLS security label consists of hierarchical sensitivity level and non-hierarchical category set.

• s15 > s14 > s13 > ... > s1 > s0

• c0,c1,c2,c3,c4.c1023

• Valid security label s15:c2,c3,c4

SELinux context contains two valid levels indicating effective security level and clearance level


BLP (Bell-LaPadula) in SELinux

Any two labels, L1 and L2, can have the following four relations

• L1 is equal to L2 (levels are equal; category sets are equal)

• L1 dominates L2 (level of L1 is ≥ level of L2; L2 category set equal or subset of

L1 category set)

• L1 is dominated by L2 (level of L2 is ≥ level of L1; L1 category set equal

or subset of L2 category set)

• L1 and L2 are incomparable (L1 and L2 are not equal and neither dominates the

other

• L1 = s5:c0.c10 L2 = s5:c0.c10 → L1 is equal to L2​

• L1 = s5:c0.c10 L2 = s4:c1,c3 → L1 dominates L2​

• L1 = s5:c0.c10 L2 = s15:c0.c15 → L1 is dominated by L2​

• L1 = s5:c0.c10 L2 = s3:c0.c15 → L1 and L2 are incomparable