Questions tagged [selinux]
NSA Security-Enhanced Linux (SELinux) is an implementation of a flexible mandatory access control architecture in the Linux operating system.
691
questions
0
votes
0
answers
28
views
How do you allow user_t SELinux users the ability to use sudo
I've got three classes of user that I have assigned to staff_t, user_t and guest_t. However the default permissions of these user types don't exactly correspond to what I need. It seemed easier to use ...
0
votes
0
answers
33
views
Create custom SELinux policy with full access
I have a process my_process which should have access to all processes, files, ports, network traffic, etc. This process needs to work with SELinux.
How can I configure the appropriate policy?
I tried ...
0
votes
2
answers
71
views
Grant sudo based on SELinux
I've recently come across SELinux and sudo.
Is it possible to allow users sudo when SELinux is permissive, and block these while allowing others when SELinux is enforced?
I've looked at section 3.9. ...
0
votes
2
answers
141
views
How do I configure SE Linux so PHP can connect to Postgres by socket
I have a PHP application that connects to a Postgresql Database.
This works when I connect via network but I get an SELinux violation when trying to connect using the socket. I believe the contexts ...
2
votes
1
answer
95
views
SELinux: Why can httpd read files in /var/www/html?
I'm just trying to understand targeted SELinux better. While I understand that users, processes, ports etc. are labled with a quadruple <user>,role>,<type>,<sensitivity> and how ...
0
votes
1
answer
148
views
Should SELinux be enabled and the filesystem relabelled before or after other software has been installed?
I have an AlmaLinux 9 server with SELinux installed but currently disabled as the server isn't in production use yet.
I am ready to start installing other applications (e.g. Apache, PHP, Postfix, ...
2
votes
1
answer
267
views
FAPolicyD overhead slowing down a server
We have a server with the Alma Linux 9.3 OS.
By default (as well as all current RHEL-like OSs) it has fapolicyd enabled.
There is also an application server (WildFly/JBoss/Java) running on that server....
1
vote
2
answers
352
views
Problems deploying Ansible playbook to Linux server using python3.8 - selinux python module does not assign correct contexts
I run an Alma 8/9 estate and use Ansible to deploy various config changes, and I've run into an unusual problem on one of my client boxes. Alma 8 by standard comes with python 3.6, which works quite ...
0
votes
0
answers
75
views
configure selinux to prevent non-root users from accessing particular port
Can selinux be locked down to prevent non-root users to being able to access a particular port on linux?
e.g if I have a local web server, I would like to prevent non-root users from being able to ...
1
vote
4
answers
317
views
Ngnix can't write socket file due to SELinux
When setting up nginx with a socket on my newer environment that runs SELinux I am getting the following error:
AVC avc: denied { write } for pid=23704 comm="nginx" name="xxx.sock&...
1
vote
0
answers
207
views
How to inspect the rules in a policy module?
I know I can use semodule -l to see what modules I have. However, I want to see the rules contained in a specific module.
I read almost all document I can find for semodule, seinfo, sesearch. I cannot ...
0
votes
0
answers
175
views
SELinux silently blocking PHP process listing
I have a system where we use PHP to run some rudimentary health checks on the server. When hitting a status page, it verifies that certain processes are running, and returns an error message if ...
1
vote
2
answers
902
views
SELinux blocking nginx -t
I'm setting up Rocky Linux and I've run into this error:
sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission ...
0
votes
1
answer
186
views
Does SELinux allow the apache user to read /etc/passwd file?
I was experimenting and learning SELinux on Alma Linux 9.2. The intention was to build a flask application that has a file inclusion vulnerability and show how SELinux can prevent the vulnerability to ...
0
votes
0
answers
227
views
SELinux on RHEL8 with Gunicorn and nginx has problems with saving file into diretory
I have Django application running on RHEL8 via Gunicorn and nginx. All works fine in case of testing with SELinux disabled. When I enable SELinux, there is a problem with saving the picture from ...
1
vote
0
answers
88
views
Incorrect SELinux labeling of mysql unix socket on Centos7
OS:
# rpm -q centos-release
centos-release-7-9.2009.1.el7.centos.x86_64
I'm trying to get zabbix-agent to access mysqld (using mysqladmin ping), but the process fails with the following errors(in ...
7
votes
2
answers
1k
views
How to log executions of specific commands on Linux no matter where it came from?
Dangerous commands like rm , kill and systemctl stop can be hidden outside bash inputs - i.e. - a malicious user can easily hide them inside a python script using os module and just run the python ...
0
votes
0
answers
107
views
Protecting a Linux against root users
I'm searching for a way to "protect" a Linux operating system against (root) users that can potentially misbehave.
My threat model is the one of university students, having access to root ...
0
votes
2
answers
257
views
Can mount on /mnt but not on other mount point, why?
this is an RHEL8 VM. I'm trying to mount a logical volume on /var (because I need more space). For now I have created a directory /xvar to mount on, but it doesn't work and doesn't show an error. ...
0
votes
1
answer
150
views
Remote call of NRPE comman fails in one case, while succeeding locally in all
I have amazingly strange issue with monitoring a CIFS (SMB) shared folder mounted to Linux machines by Nagios + NRPE.
NRPE process runs on the Linux machines under dedicated user nrpe:
# systemctl ...
1
vote
0
answers
52
views
Cannot create SPEC file with sepolicy-generate
In EL7 I have been creating custom policy with sepolicy-generate and one of the artefacts created is a SPEC file. When I run the same command on EL8 I don't get the SPEC file. According to the manpage ...
0
votes
1
answer
426
views
SELinux policys keeping Tomcat from starting
On a newly built Oracle Linux 8 server i added a drive and file system, then put put Apache Tomcat on that file system via the tarball. Now when starting Tomcat via a services file, I get an error ...
1
vote
1
answer
195
views
Error while customizing selinux policy for domain
I am following the steps outlined under this link to customize selinux policy for specific domains (types).
For the domain systemd_tmpfiles_t, I get the following suggestion from audit2allow for a ...
0
votes
1
answer
576
views
SELinux is preventing /usr/bin/mongod from search access
My question is similar to others, such as SELinux preventing mongod search access. In this case, I installed snapd for a reason entirely unrelated to Mongodb. That was about a week ago (2/5/2023). ...
3
votes
2
answers
322
views
Dedicated user vs selinux
What are the advantages and disadvantages of running a process with a dedicated (non root) user versus with SELinux (where a SE user may be bound to a Linux user) ?
0
votes
1
answer
159
views
How to set Apache-accessible SELinux policy for EFS mounted user directories?
When I mount my EFS to a user directory, the directory policy becomes system_u:object_r:nfs_t:s0, which is too restrictive - I need it to behave more like a typical user directory, which is ...
3
votes
1
answer
924
views
SELinux is preventing in:imjournal from unlink accesses on the file imjournal.state
I have a problem on Fedora 36 with rsyslog, selinux and /var/log/messages components.
As you can see:
AVC avc: denied { unlink } for pid=XXX comm="in:imjournal" name="imjournal.state&...
0
votes
0
answers
1k
views
Jboss as a service failing on OS Reboot RHEL8
0
I am facing some issues while running Jboss as a service on RHEL8 servers. The setup of service is done in a standard way as per the RHEL guidelines
https://access.redhat.com/documentation/en-us/...
1
vote
0
answers
3k
views
Podman is unable to start container with SELinux (sd-bus call permission error)
Here is the command I am using to start the container:
podman run -d --name busybox-top -v ./src:/dest:Z busybox top
Error:
Error: sd-bus call: Permission denied: OCI permission denied
I do not have ...
0
votes
1
answer
192
views
DB2 systemd startup
I have a DB2 systemd startup unit that is being denied by SELinux. Here is the unit:
[Unit]
Description=IBM DB2
After=network.service
[Service]
Type=forking
EnvironmentFile=/user/home/dvdxadm1/sqllib/...
2
votes
1
answer
1k
views
Timedatectl "Failed to parse bus message: Connection timed out" with systemd ExecPreStart while SELinux is enforcing
Using Oracle Linux 8.6 we're having an issue with timedatectl but only when it's run by systemd(239-58.0.1.el8_6.3) during ExecStartPre in a .service definition file and SELinux is set to Enforcing.
...
2
votes
3
answers
4k
views
Postfix master.pid ExecStartPre with exit status 255
When I restart the Postfix daemon on my Rockylinux server, It happen an restorecon error who don't avoid the starting of the service but still an error :
● postfix.service - Postfix Mail Transport ...
1
vote
1
answer
81
views
Is there such a tool on CentOS/SELinux to monitor incoming HTTP/HTTPS traffic the way Ngrok displays it?
I really love how ngrok displays the incoming connections to a server with the response. Is there such a tool (either to install or native) on CentOS/SELinux that would display some info? I found a ...
0
votes
1
answer
607
views
cannot boot unless Selinux is disabled
The system fails to boot due to mount failure. I've traced it back to selinux since I can hold shift and edit the grub cmd to read selinux=0, but interestingly enough if I try permissive mode, ...
1
vote
1
answer
263
views
How to adjust SELinux to allow not so large file downloads in Apache?
I have a centos 7 server running Apache 2.4 that will happily allow users to download files until they get to a certain size. I've noticed the problem with mp4 video files; I host both low and full ...
0
votes
1
answer
2k
views
How to set SELINUX HTTPD User Content RW?
I'm quite new to SELINUX, I've simple question, I know there are httpd_sys_rw_content_t for /var/www/html, and read only httpd_user_content_t, but if I want to allow some folder to be RW for that ...
0
votes
1
answer
2k
views
Ubuntu 20.04 doesn't boot after setting SELinux enforcing
I'm trying to set SELinux to enforcing on Ubuntu 20.04, and the steps I did are as follow:
Install SELinux = sudo apt-get install policycoreutils selinux-utils selinux-basics -y
Activate SELinux = ...
1
vote
2
answers
1k
views
How to allow user to run only specific binaries
I'm adding user logviewer with /sbin/nologin/ and to my system.
My custom service is running eg. sudo -u logviewer less --follow-name /var/log/messages.
But still there are ways to run other command ...
1
vote
1
answer
2k
views
Unable to change SSH port on Almalinux/CentOS 8 with selinux present
I am trying to change the SSH port on a VPS using Almalinux. I followed this guide but have not been able to.
These are the output I receive when try to SSH using both 22 and the new port respectively....
0
votes
1
answer
480
views
Centos7 Httpd cannot access mounted cifs directory
In a Centos 7 server I have a directory mounted with autofs in /mnt/cifs-shares/cone_files. I can read those files without issues.
The directory /mnt/cifs-shares/cone_files is owned by apache:apache ...
3
votes
2
answers
2k
views
SELinux preventing mongod search access
I noticed I am getting some SELinux errors when running mongod for the UniFi controller program. Namely, I am getting:
SELinux is preventing /usr/bin/mongod from search access on the directory /.
...
1
vote
0
answers
80
views
SELinux: two servers, identical configurations, but different contexts
I've had my fair share of struggles with SELinux, but this is the first time that it's totally stumped me. I have two production CentOS 8 servers with functionally identical configurations hosting a ...
0
votes
1
answer
814
views
How to set SELinux boolean using custom policy?
I know that SElinux booleans can be set via setsebool like this:
setsebool -P virt_qemu_ga_read_nonsecurity_files 1
But I want to set this boolean virt_qemu_ga_read_nonsecurity_files using custom ...
0
votes
1
answer
1k
views
Allow samba share to access mounted remote file store
I have two servers on the same network. One running Windows Server 2016 and another running CentOS 8. The Windows server is my main file store, it's where all my data is. The CentOS server has the ...
1
vote
0
answers
3k
views
Samba/Winbind domain member authentication issue
In setting up a new Linux Samba fileserver as a AD member I keep running into an issue with authentication.
It appears to be triggered by running with selinux in Enforcing mode after joining AD, but ...
1
vote
1
answer
629
views
On Fedora, how do I configure selinux to allow a port for a new undefined service type?
I have several things that I'd like to be able to stand up as servers on Fedora. I know I can run at least some of these in podman or docker but I already know how to do that. I also already know how ...
0
votes
1
answer
79
views
Which protections can I use on the server
I have read about server protection and I know how to work with fewalld protection because it is not demanding.
My question is:
Which of the following protections is best for the server and which of ...
0
votes
1
answer
2k
views
Why there are SELinux errors in permissive mode?
I have set CentOS 8 Stream with SELinux set to permissive but I still have bunch of red lines in the log e.g.:
SELinux is preventing /usr/lib/systemd/systemd from name_connect access on the tcp_socket ...
0
votes
1
answer
661
views
VNC server won't start on AlmaLinux/CentOS 8
I could not get tigervnc to start on my AlmaLinux 8 machine. We have SELinux enabled and our home directories are automounted NFS shares (configured by IPA).
I see errors in my /var/log/audit/audit....
1
vote
1
answer
3k
views
Where do I get full list of SELinux access control types?
I cant find any explanation how do I list all access control types in SELinux.
E.g. httpd_log_t httpd_sys_content_t..
I would like to see them all