Questions tagged [selinux]

SELinux (Security-Enhanced Linux) is an implementation of a flexible role-based, mandatory access control (MAC) architecture on Linux through kernel modifications and user-tools. It is primarily used to confine system processes and users beyond the basic Discretionary Access Controls (DAC) mechanism or access-control list found on *nix systems.

SELinux (Security-Enhanced Linux) is an optional component of Linux that provides mandatory access control based on the FLASK architecture. It originated as an NSA project, but has been part of the mainline Linux kernel since version 2.6.0.

Questions about SELinux often straddle the border between security and functionality. If your point of view is that of a system administrator (setting up SELinux, getting a program to work with SELinux, …), ask here. If your point of view is that of a security professional (choosing a security policy, encoding a security policy in SELinux, …), ask on our sister site IT Security.

SELinux provides mandatory access control, integrity controls, role-based access control with multilevel security. SELinux is primarily used to confine system processes (daemons), as writing a usable yet usefully restrictive policy for programs used by users is difficult.

SELinux assigns to each process and to each file a context consisting of a role, user (not related to Linux users) and a domain. Utilities such as ls and ps display SELinux contexts if the -Z flag is specified.

SELinux has been officially supported in since version 4.0 and since version 2. Other major distributions allow the use of SELinux but may not provide standard policies.

Generic SELinux questions

Other projects with a similar goal

577 questions
56
votes
6 answers

How to disable SELinux without restart?

I need to disable SELinux but cannot restart the machine i followed this link where i get bellow command setenforce 0 But after running this command i checked for that sestatus SELinux status: enabled SELinuxfs mount: …
Vikas Hardia
  • 695
  • 1
  • 6
  • 8
45
votes
5 answers

httpd can't write to folder/file because of SELinux

Does anyone know which sebool it is to allow httpd write access to /home/user/html? When I disable SELinux echo 0 > /selinux/enforce I can write, so my problem is definitely related to SELinux. I just don't know which one is the right one without…
Christian
  • 2,155
  • 3
  • 16
  • 14
25
votes
3 answers

What roles do DAC (file permissions), ACL and MAC (SELinux) play in Linux file security?

I need some clarification/confirmation/elaboration on the different roles DAC, ACL and MAC play in Linux file security. After some research from the documentation, this is my understanding of the stack: SELinux must allow you access to the file…
Belmin Fernandez
  • 9,347
  • 15
  • 46
  • 50
23
votes
1 answer

Are SELinux rules enforced before or after standard linux permissions?

When SELinux is installed on a system are its rules enforced before or after the standard linux permissions? For example if a non-root linux user tries to write to a file with linux permission -rw------- root root will SELinux rules be checked first…
satur9nine
  • 651
  • 4
  • 16
22
votes
3 answers

Myth or reality: SELinux can confine the root user?

I read or heard somewhere (maybe in LinuxCBT's SELinux course; but I'm not sure) that there are online Linux servers, for which the password of the root user is also given. The Linux server is hardened using SELinux rules, such that everyone can…
Sadeq Dousti
  • 383
  • 1
  • 3
  • 9
20
votes
7 answers

openvpn[]: Options error: In [CMD-LINE]:1: Error opening configuration file

when trying to service openvpn start Oct 12 14:02:01 ccushing1 openvpn[9091]: Options error: In [CMD-LINE]:1: Error opening configuration file: devnet-client-vm.conf running openvpn devnet-client-vm.conf works just fine. Why does openvpn not start?…
xenoterracide
  • 57,918
  • 74
  • 184
  • 250
20
votes
2 answers

What to use to harden Linux box? Apparmor, SELinux, grsecurity, SMACK, chroot?

I am planning to go back to Linux as a Desktop machine. I would like to make it more secure. And try a few hardening techniques, especially since I plan to get my own server. What would be a good, sane hardening strategy? Which tools should I use -…
jottr
  • 1,286
  • 3
  • 14
  • 19
17
votes
2 answers

Does SELinux provide enough extra security to be worth the hassle of learning/setting it up?

I recently installed Fedora 14 on my home pc and have been working on setting up different server related features such as apache, mysql, ftp, vpn, ssh, etc. I ran extremely quickly in to a barrier it felt like when I discovered SELinux which I had…
Kenneth
  • 573
  • 5
  • 13
16
votes
1 answer

How do I configure SELinux to allow outbound connections from a CGI script?

I'm migrating to a new webserver which has SELinux set up (running Centos 5.5). I've got it set up so that it can execute CGI scripts with no problem, but some of the older Perl based scripts are failing to connect to remote webservices (RSS feeds…
Rowland Shaw
  • 382
  • 3
  • 4
  • 11
16
votes
2 answers

Podman volume mounts: When to use the :z or :Z suffix?

The Podman man pages explains for volume mounts/binds: Labeling systems like SELinux require that proper labels are placed on volume content mounted into a container. Without a label, the security system might prevent the processes running inside…
rugk
  • 2,806
  • 6
  • 28
  • 58
16
votes
1 answer

how to create a custom SELinux label

I wrote a service/single binary app that I'm trying to run on Fedora 24, it runs using systemd, the binary is deployed to /srv/bot this service/app I wrote needs to create/open/read and rename files in this directory. I first started creating a new…
fmpwizard
  • 401
  • 1
  • 3
  • 9
16
votes
2 answers

How to label a newly created file with "system_u"?

I just created a blank conf file for freetds and noticed that the permissions are wrong: [root@box etc]# touch freetds.conf.new [root@box etc]# ll -lZ freetds.conf* -rw-r--r--. root root system_u:object_r:etc_t:s0 freetds.conf -rw-rw----. root…
a coder
  • 3,184
  • 9
  • 42
  • 63
14
votes
8 answers

How to prevent a process from writing files

I want to run a command on Linux in a way that it cannot create or open any files to write. It should still be able to read files as normal (so an empty chroot is not an option), and still be able to write to files already open (especially…
Joachim Breitner
  • 1,347
  • 2
  • 16
  • 25
14
votes
1 answer

What is the proper way to set SELinux context in an RPM .spec?

I am trying to build an RPM that targets RHEL4 and 5. Right now I call chcon from %post but multiple Google entries say "that's not how you are supposed to do it" with very limited help on the right way. I've also noticed that fixfiles -R mypackage…
Aaron D. Marasco
  • 5,708
  • 24
  • 29
13
votes
1 answer

Core difference between SELinux and Apparmor

What is the core [or kernel level] difference of SELinux and Apparmor?
arif
  • 1,379
  • 3
  • 15
  • 27
1
2 3
38 39