anitsh / til

Today I Learn (til) - Github `Issues` used as daily learning management system for taking notes and storing resource links.
https://anitshrestha.com.np
MIT License
78 stars 11 forks source link

SELinux #666

Open anitsh opened 3 years ago

anitsh commented 3 years ago

Security-Enhanced Linux (SELinux)

SELinux can potentially control which activities a system allows each user, process, and daemon, with very precise specifications. It is used to confine daemons such as database engines or web servers that have clearly defined data access and activity rights. This limits potential harm from a confined daemon that becomes compromised.

Security-Enhanced Linux (SELinux) is a Linux kernel security module that provides a mechanism for supporting access control security policies, including mandatory access controls (MAC).

SELinux is a set of kernel modifications and user-space tools that have been added to various Linux distributions. Its architecture strives to separate enforcement of security decisions from the security policy, and streamlines the amount of software involved with security policy enforcement

SELinux features include:

Command-line utilities include: chcon, restorecon, restorecond, runcon, secon, fixfiles, setfiles, load_policy, booleans, getsebool, setsebool, togglesebool, setenforce, semodule, postfix-nochroot, check-selinux-installation, semodule_package, checkmodule, selinux-config-enforcing, selinuxenabled, and selinux-policy-upgrade


CONCEPTS

SELinux = LABELING system Labeling → files, process, ports, etc. (system objects) Type enforcement → Isolates processes from each other based on types

Every process, file, directory, system object has a LABEL. Policy rules control access between labeled processes and labeled objects. The kernel enforces these rules.

LABELING

Label format: user:role:type:level (optional)

user → identity known to the policy authorized for a specific set of roles and a specific MLS/MCS range role → attribute of RBAC, serves as an intermediary between domains and SELinux users type → attribute of type enforcement, defines a domain for processes and a type for files level → attribute of MLS/MCS, pair of levels, written as low level-high level if the levels differ, or low level if the levels are identical

Resource

anitsh commented 3 years ago

Comparison with AppArmor

SELinux represents one of several possible approaches to the problem of restricting the actions that installed software can take. Another popular alternative is called AppArmor and is available on SUSE Linux Enterprise Server (SLES), openSUSE, and Debian-based platforms. AppArmor was developed as a component to the now-defunct Immunix Linux platform. Because AppArmor and SELinux differ radically from one another, they form distinct alternatives for software control. Whereas SELinux re-invents certain concepts to provide access to a more expressive set of policy choices, AppArmor was designed to be simple by extending the same administrative semantics used for DAC up to the mandatory access control level.

There are several key differences: