Access Control, Authentication & SELinux
Module 8 · Networking & Security

Access Control, Authentication & SELinux

The CIA triad, authentication methods, privilege escalation, chroot jails, and how SELinux's mandatory access control goes beyond standard file permissions.

The CIA Triad

Every security control ultimately serves one (or more) of three goals:

PrincipleGoal
ConfidentialityOnly authorized parties can read the data
IntegrityData can’t be altered undetected
AvailabilityAuthorized parties can access the data/system when they need to

Authentication: Verifying Identity

Authentication is the verification of an individual’s identity — proving who someone claims to be, distinct from authorization (what they’re allowed to do once verified). Common authentication methods:

MethodHow it works
PasswordSomething the user knows
Key-based (SSH keys)Something the user has — a private key that mathematically pairs with a known public key
Multi-factor (MFA)Combines two or more independent factors (knowledge + possession + biometric)
KerberosA network authentication protocol using time-limited cryptographic tickets instead of transmitting credentials repeatedly

Linux Kerberos commands:

TaskCommand
Request/renew a Kerberos ticketkinit username
View currently held ticketsklist
Destroy (clear) held ticketskdestroy

PAM (Pluggable Authentication Modules) is the framework most Linux authentication actually runs through under the hood — login, sudo, sshd, and passwd all defer to PAM modules (configured under /etc/pam.d/) to decide how authentication is actually performed, which is why a single PAM misconfiguration can lock out login system-wide even when every individual account is fine.


Privilege Escalation and Containment

Privilege escalation occurs when a user obtains additional access or functionality beyond what they’re normally allowed — the goal of most attacks, and the reason sudo and su are audited so closely.

chroot is a technique for controlling exactly what a process can access on the filesystem, by changing that process’s apparent root directory (/) to some other location. Anything outside the new root is simply invisible to the process — a lightweight containment mechanism often used to isolate a service, or to build/test software in a clean environment without touching the real system.

⚠️ Common Pitfall: chroot Is Containment, Not a Security Boundary

A chroot jail restricts what a process can see in the filesystem, but a process running as root inside a chroot can often still escape it through kernel-level access, device files, or other tricks. Don’t treat chroot as equivalent to a container or VM’s isolation — it’s a much weaker boundary, useful for accident prevention more than defense against a determined attacker.


DAC vs. MAC: Two Access Control Models

ModelHow access is decided
DAC (Discretionary Access Control)The standard rwx permission model covered in Module 2 — the file’s owner decides who gets access, at their discretion
MAC (Mandatory Access Control)Access is decided by the system, comparing a security label on the object (file/process) against a security clearance on the subject (user/process) — the owner has no say

Multiple pieces of information — user identity, process context, file labels, and policy rules — combine to make each individual access decision under MAC, which is what makes it far more restrictive (and far harder to accidentally misconfigure into an open state) than DAC alone.


SELinux

SELinux (Security-Enhanced Linux) is the default MAC implementation shipped with RHEL, Rocky Linux, AlmaLinux, and Fedora — it defines access parameters for every process and resource on the system through a security policy, layered on top of standard DAC permissions rather than replacing them.

TaskCommand
Check SELinux’s current modegetenforce
Temporarily change the running modesetenforce 0 (permissive — logs violations without blocking) or setenforce 1 (enforcing)
Full SELinux status reportsestatus
View SELinux security context/labels on filesls -Z
View SELinux context for processesps -Z
Change a file’s SELinux contextchcon -t httpd_sys_content_t file
Restore a file’s default context based on policyrestorecon file
Manage SELinux policy (booleans, ports, file contexts) persistentlysemanage
⚠️ Common Pitfall: 'Permission Denied' With Correct rwx Permissions? Check SELinux Next

A classic SELinux symptom: standard ls -l permissions look completely correct, chmod/chown are right, and the operation still fails — because SELinux’s separate policy layer is blocking it. Check getenforce and ausearch -m avc -ts recent (or /var/log/audit/audit.log) before assuming a DAC permissions problem when the DAC permissions are visibly fine.


🧠 Knowledge Check

1. What fundamentally distinguishes MAC (Mandatory Access Control) from DAC (Discretionary Access Control)?

2. A web server can't read a file even though `ls -l` shows correct owner, group, and rwx permissions. What should you check?

3. Why shouldn't a chroot jail be treated as equivalent to a container or VM's security isolation?


What’s Next

Lesson 4 covers the last piece of the security domain: encrypting data at rest, securing SSH, firewalls, and reading the logs that tell you what actually happened.