Course contentsShow
← Security
Lesson 1453 of 3,05229. Operating System Security - HardeningFree lesson

SELinux Architecture and Components

Explore Security-Enhanced Linux architecture including policy, contexts, domains, and types.

SELinux Architecture and Components

What you'll learn: You'll understand the core building blocks of Security-Enhanced Linux and how they work together to enforce mandatory access control.

The Big Picture

SELinux (Security-Enhanced Linux) isn't just a permission system—it's a complete security architecture layered on top of Linux. While traditional DAC (discretionary access control) asks "does the user own this?", SELinux asks "does the security policy allow this specific operation between these labeled entities?"

Think of SELinux like an airport security system: every person (process) has a badge with clearance level, every room (file/resource) has a required access level, and a central rulebook (policy) determines who can enter where—regardless of who "owns" the room.

Core Components

Policy Engine: The decision-making core that evaluates every access request against loaded security rules. This is the "rulebook" that contains thousands of allow/deny statements.

Security Contexts: Labels attached to every process, file, and resource in the format user:role:type:level. For example: system_u:object_r:httpd_sys_content_t:s0 labels a web server file.

Domains: Security contexts assigned to running processes. A process in the httpd_t domain can only do what policy allows that domain to do—even if it runs as root.

Types: Security contexts assigned to files and objects. A file labeled shadow_t (password file type) can only be accessed by domains explicitly granted permission.

Policy Rules: Statements like "allow httpd_t httpd_sys_content_t:file read;" that grant specific domains permission to perform specific actions on specific types.

How It Works Together

When a process tries to access a file, SELinux checks: "Does my domain have permission to perform this action on this type?" The policy engine makes the decision, and access is only granted if an explicit rule allows it—default deny in action.

Key Takeaway: SELinux enforces MAC through security contexts (labels), domains (process contexts), types (object contexts), and a centralized policy engine that evaluates every access against explicit rules.