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

596 questions
10
votes
2 answers

Which SELinux policies apply to haproxy?

I just bumped into another SELinux related problem. It would seem my haproxy wasn't allowed to open TCP connections to the backend and I was able to fix it quickly using Google. Now, I would like to know how one would fix this problem if one…
Bananguin
  • 7,984
10
votes
2 answers

SELinux not allowing oddjobd-mkhomedir to create user home directory on a non-standard location

We are using SSSD to authenticate users on CentOS servers. oddjobd-mkhomedir works perfectly fine when the default home directory is /home, but on a particular server, we had to change default home directory to /data, which is on a SAN mount. Now,…
Abhi
  • 173
9
votes
1 answer

Why setsebool command of SELINUX taking so long and slow?

I have noticed the command setsebool take longer time than other linux commands. Such as: setsebool -P ftp_home_dir ON Out of curiosity I want to know why "setsebool" command needs such a long time to complete the task?
Xianlin
  • 1,033
  • 5
  • 14
  • 20
9
votes
2 answers

Make all SELinux contexts permanent

I've done a lot of chcon-ing lately,but if I understand it correctly, these will be erased on the next relabel. Is there any way to make the current contexts (preferably just under a certain directory) permanent? I understand there's a way to do it…
6
votes
2 answers

Is there a tool which can find which SELinux rule allowed a particular access to occur?

My system has a very complex SELinux policy. Is there a tool which can explain why a particular access was granted? Often when I search for a particular rule using text search I don't find it because the rule has been created via macros or via…
6
votes
1 answer

Listing and editing the content of /sepolicy

I am in a position to create my own boot image for my Android tablet - which means I can in theory modify the /sepolicy file to, for example, give the shell account that is used by adb shell sessions, complete root privileges. How do I do that? How…
ttsiodras
  • 2,371
  • 1
  • 21
  • 26
4
votes
2 answers

How to recursively remove all SELinux contexts?

I am trying to make my production environment equivalent to my staging environment. On production, SELinux contexts were applied. If I list the files in a directory, I see the dot at the end of the permission string, like... drwxrwxr-x. How can I…
4
votes
0 answers

SElinux config file missing

Trying to set up mail I found out I have important file missing or it seems I do. First of all I have no selinux in /etc/sysconfig and in /etc/selinux there is folder mls and files restorecond.conf restorecond_user.conf semanage.conf but no general…
cea
  • 1,543
3
votes
1 answer

SELinux: chcon to a type, ls -Z shows another one

When I do chcon -v -t httpd_sys_script_ro_t a_folder_at_home/ And then: ls -dZ I got: DACs user grp unconfined_u:object_r:httpd_sys_content_t:s0 a_folder_at_home/ In case of error I would have expected something like: chcon -v -t…
3
votes
1 answer

what is the best way to add/update fcontext rules for many paths?

I need a routine to configure the fcontext for many paths. Currently I maintain a bash script calling semanage to do that. But the task seems quite verbose. The main issue here is: I cannot find a simple command force update the rule for an object.…
Wang
  • 1,296
3
votes
0 answers

What is the meaning of the confidence level in sealert?

In the output of sealert, how one should evaluate plugin confidence levels? The highest value should mean the most recommended action. However, are they expressed in percent? How are they calculated? [root@mybox ~]# sealert -a…
dr_
  • 29,602
3
votes
1 answer

How to set SELinux in permissive mode without reboot?

I am on Fedora 29 and SELinux is currently disabled. I am trying to put into permissive mode using setenforce permissive, but always get setenforce: SELinux is disabled this output and then status still remains disabled. I looked and found out that…
Pensu
  • 131
3
votes
1 answer

How is SELinux loaded on boot?

I understand that a configuration file is in: /etc/selinux/config But how is it processed at boot? How does SELinux start, is it a daemon? Which startup script starts SELinux?
ransh
  • 1,407
3
votes
5 answers

selinux is causing “nexus.service: Failed at step EXEC spawning /opt/nexus/bin/nexus: Permission denied” Fedora 26, nexus 3.06

After installing the latest version of nexus, currently 3.6.0, I'm able to start it by using the manual command /opt/nexus/bin/nexus start but when trying to start as a service (per directions…
swv
  • 319
3
votes
0 answers

SELinux prevents fstab auto mount

For a long time I have been running Fedora with disabled SELinux. Since it seems like SELinux is recommended to be running and in targeted mode for desktop use, I decided to enable it. I set it to enforcing and targeted mode. After I rebooted my…
Bob
  • 235
1
2 3 4 5