Security Enhanced Linux

Share this article

Operating system security is (or at least should be) of critical importance to us all. However, the varying levels of security required differ for each systems administrator.

For those who seek enhanced, tightened security control over their Linux systems, SELinux may be the answer. Standing for Security-Enhanced Linux, it is a result of research projects from the NSA (National Security Agency) in the US and focuses on mandatory access controls which offers powerful controls over users and devices as well as applications and services.

SELinux is released as a set of kernel patches which wraps into an existing Linux installation. The NSA states they have tested it successfully only on Red Hat.

In thet same vein, the Red Hat community has just announced integration with SELinux into its latest test release of Fedora (core 2), the replacement for Red Hat’s Professional series of distributions which ended with version 9. Red Hat facilitates the Fedora project but does not officially support it. However, it is obvious the goal is to test out and find the best improvements that can then make there way into Red Hat’s official Enterprise Linux products.

The NSA defines the difference between SELinux security and standard Linux security:

“The Security-enhanced Linux kernel enforces mandatory access control policies that confine user programs and system servers to the minimum amount of privilege they require to do their jobs. When confined in this way, the ability of these user programs and system daemons to cause harm when compromised (via buffer overflows or misconfigurations, for example) is reduced or eliminated. This confinement mechanism operates independently of the traditional Linux access control mechanisms. It has no concept of a “root” super-user, and does not share the well-known shortcomings of the traditional Linux security mechanisms (such as a dependence on setuid/setgid binaries).”

More Information on:
Security-Enhanced Linux

Red Hat Fedora and SELinux

Frequently Asked Questions (FAQs) about Security-Enhanced Linux (SELinux)

What is the main purpose of SELinux?

The primary purpose of Security-Enhanced Linux (SELinux) is to provide a mechanism for supporting access control security policies. It is an integral part of the Linux kernel, providing a flexible Mandatory Access Control (MAC) system built into the Linux kernel. This system allows the operations permitted for each user and process to be finely controlled, enhancing the security of the system by preventing unauthorized access or manipulation of system files and services.

How does SELinux enhance the security of a Linux system?

SELinux enhances the security of a Linux system by implementing Mandatory Access Control (MAC). Unlike traditional Discretionary Access Control (DAC), where a user has complete control over their files and processes, MAC restricts each user’s capabilities based on a centrally defined policy. This means even if a user’s account is compromised, the damage an attacker can do is limited by the policy, not by the user’s original permissions.

What are the different modes of operation in SELinux?

SELinux operates in three modes: Enforcing, Permissive, and Disabled. In Enforcing mode, SELinux enforces the security policy on the system, denying access based on SELinux policy rules. In Permissive mode, SELinux does not enforce the policy but only logs policy violations. This mode is useful for troubleshooting SELinux issues. In Disabled mode, SELinux is turned off.

How can I check the status of SELinux on my system?

You can check the status of SELinux on your system by using the ‘sestatus’ command in the terminal. This command will display the current status of SELinux, including whether it is enabled or disabled, the current mode (enforcing or permissive), and the policy being used.

How can I change the mode of SELinux?

You can change the mode of SELinux by using the ‘setenforce’ command followed by either ‘0’ for permissive mode or ‘1’ for enforcing mode. Please note that this change is temporary and will be reset after a system reboot. To make a permanent change, you need to modify the ‘/etc/selinux/config’ file.

What is the role of SELinux policies?

SELinux policies define the rules that govern how processes and users interact with each other and with system resources. They determine what actions are allowed or denied by the SELinux security system. Policies are highly customizable, allowing system administrators to define security rules that fit their specific needs.

How can I customize SELinux policies?

Customizing SELinux policies requires a good understanding of the SELinux policy language. You can use tools like ‘semanage’, ‘semodule’, and ‘audit2allow’ to manage and customize policies. It’s important to test any changes in a safe environment before applying them to a production system.

What is the difference between targeted and strict policies in SELinux?

The main difference between targeted and strict policies lies in the level of security enforcement. In a targeted policy, only selected processes are protected by SELinux, while in a strict policy, all processes are controlled by SELinux. The targeted policy is the default in most Linux distributions as it provides a good balance between security and usability.

Can SELinux prevent root user exploits?

Yes, one of the key benefits of SELinux is its ability to limit the damage that can be done by a root user exploit. Even if an attacker gains root access, they would still be constrained by the SELinux policy, which can prevent them from performing certain actions or accessing certain files.

Is it recommended to disable SELinux?

Disabling SELinux should be a last resort. While it can be challenging to configure and manage, the security benefits it provides are significant. Instead of disabling SELinux entirely, it’s recommended to use permissive mode while troubleshooting issues or configuring policies. This way, you can benefit from the additional security layer that SELinux provides.

Blane WarreneBlane Warrene
View Author
Share this article
Read Next
Get the freshest news and resources for developers, designers and digital creators in your inbox each week