User Tools

Site Tools


linux:selinux_cheatsheet

[CHEATSHEET] selinux

Binaries

Add path as binaries to allow execution

semanage fcontext -a -t bin_t '/app/bin/.*'

Change security context of files/folder

chcon -Rv -u system_u -t bin_t '/app/data/executable.sh'

List defined paths by context

 semanage fcontext --list

Restore Default Security Contexts

Over 1 file:

restorecon -v /var/www/html/index.html

or to recursively restore the default security contexts for the whole directory:

restorecon -Rv /var/www/html 

Networking

Allowing Access to a Port

semanage port -a -t http_port_t -p tcp 81

Link

List port services

semanage port -l

Empty

 
linux/selinux_cheatsheet.txt · Last modified: 2023/02/27 14:25 by dodger