sysadm_selinux(8)

πŸ“¦
version 20250627+git412.dbf877ab7 Β· 7 versions
, in opensuse-leap 16.0

πŸ’– NAME πŸ’–

okay so bestie, this is the glow-up era of sysadm_u β€” the General system administration role for Security Enhanced Linux Policy. it's giving main character energy for admins ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

sysadm_u is an SELinux User defined in the SELinux policy. no cap, that's the whole vibe. SELinux users come with default roles β€” hers is sysadm_r. and that default role has a default type, sysadm_t, riding along with it. πŸ‘‘

so when the SELinux user logs into a system, the context is lowkey gonna look like this:

sysadm_u:sysadm_r:sysadm_t:s0 - s0:c0.c1023

Linux users get an SELinux user assigned automatically at login. login programs use the SELinux User to hand out the initial context to your shell. then SELinux policy uses that context to control what you can access. it's literally the whole system. πŸ”₯

by default, all users are assigned to the SELinux user via the __default__ flag.

on Targeted policy systems, the __default__ user is assigned to the unconfined_u SELinux user. iykyk.

you can list every Linux User β†’ SELinux user mapping with:

semanage login -l

if you wanted to change that default user mapping to use the sysadm_u user, you'd run:

semanage login -m -s sysadm_u __default__

and if you want to map just the one Linux user (joe) to the SELinux user sysadm, you'd execute:

$ semanage login -a -s sysadm_u joe

🌸 USER DESCRIPTION 🌸

the SELinux user sysadm_u is an admin user. which means a mapped Linux user on this SELinux user is intended for administrative actions β€” she does the paperwork AND the chaos. usually this is assigned to a root Linux user. 🫢


πŸ’… SUDO πŸ’…

the SELinux user sysadm can execute sudo. periodt.

you can set up sudo so sysadm can transition to an administrative domain. add one or more of the following records to sudoers using visudo. πŸ‘‡

USERNAME ALL=(ALL) ROLE=user_r TYPE=user_t COMMAND

sudo will run COMMAND as sysadm_u:user_r:user_t:LEVEL

you might also need to add one or more of these new roles to your SELinux user record.

list the SELinux roles your SELinux user can reach by executing:

$ semanage user -l |grep selinux_name

then modify the roles list and add sysadm_r to it:

$ semanage user -m -R 'sysadm_r user_r staff_r secadm_r auditadm_r' sysadm_u

for more details you can see the semanage man page. πŸ“–

USERNAME ALL=(ALL) ROLE=staff_r TYPE=staff_t COMMAND

sudo will run COMMAND as sysadm_u:staff_r:staff_t:LEVEL

you might also need to add one or more of these new roles to your SELinux user record.

list the SELinux roles your SELinux user can reach by executing:

$ semanage user -l |grep selinux_name

then modify the roles list and add sysadm_r to it:

$ semanage user -m -R 'sysadm_r user_r staff_r secadm_r auditadm_r' sysadm_u

for more details you can see the semanage man page. πŸ“–

USERNAME ALL=(ALL) ROLE=secadm_r TYPE=secadm_t COMMAND

sudo will run COMMAND as sysadm_u:secadm_r:secadm_t:LEVEL

you might also need to add one or more of these new roles to your SELinux user record.

list the SELinux roles your SELinux user can reach by executing:

$ semanage user -l |grep selinux_name

then modify the roles list and add sysadm_r to it:

$ semanage user -m -R 'sysadm_r user_r staff_r secadm_r auditadm_r' sysadm_u

for more details you can see the semanage man page. πŸ“–

USERNAME ALL=(ALL) ROLE=auditadm_r TYPE=auditadm_t COMMAND

sudo will run COMMAND as sysadm_u:auditadm_r:auditadm_t:LEVEL

you might also need to add one or more of these new roles to your SELinux user record.

list the SELinux roles your SELinux user can reach by executing:

$ semanage user -l |grep selinux_name

then modify the roles list and add sysadm_r to it:

$ semanage user -m -R 'sysadm_r user_r staff_r secadm_r auditadm_r' sysadm_u

for more details you can see the semanage man page. πŸ“–

⚠️ heads up bestie: the SELinux type sysadm_t is not allowed to execute sudo. that's a hard no. 🚫

πŸŽ€ X WINDOWS LOGIN πŸŽ€

the SELinux user sysadm_u is able to X Windows login. yes queen, GUI access included. πŸ–₯️✨


🌈 NETWORK 🌈

the SELinux user sysadm_u is able to listen on the following tcp ports:

  • all ports >= 512 and < 1024
  • 32768-60999
  • 1716
  • all ports without defined types
  • all ports >= 1024

the SELinux user sysadm_u is able to connect to the following tcp ports:

  • 8955
  • all ports
  • 53,853
  • 389,636,3268,3269,7389
  • all ports without defined types
  • 32768-60999
  • all ports < 1024
  • 9080
  • 88,750,4444

the SELinux user sysadm_u is able to listen on the following udp ports:

  • all ports without defined types
  • 5353
  • 123
  • 1716
  • 32768-60999
  • all ports >= 1024

the SELinux user sysadm_u is able to connect to the following tcp ports:

  • 8955
  • all ports
  • 53,853
  • 389,636,3268,3269,7389
  • all ports without defined types
  • 32768-60999
  • all ports < 1024
  • 9080
  • 88,750,4444

⭐ BOOLEANS ⭐

SELinux policy is customizable based on least access required. the sysadm policy is extremely flexible and has several booleans that let you manipulate the policy and run sysadm with the tightest access possible. tiny toggles, big power. πŸ”₯

if you want to determine whether crond can execute jobs in the user domain as opposed to the the generic cronjob domain, you must turn on the cron_userdomain_transition boolean. Enabled by default.

setsebool -P cron_userdomain_transition 1

if you want to deny all system processes and Linux users to use bluetooth wireless technology, you must turn on the deny_bluetooth boolean. Disabled by default.

setsebool -P deny_bluetooth 1

if you want to deny user domains applications to map a memory region as both executable and writable β€” this is dangerous and the executable should be reported in bugzilla β€” you must turn on the deny_execmem boolean. Disabled by default.

setsebool -P deny_execmem 1

if you want to deny any process from ptracing or debugging any other processes, you must turn on the deny_ptrace boolean. Disabled by default.

setsebool -P deny_ptrace 1

if you want to allow all domains to execute in fips_mode, you must turn on the fips_mode boolean. Enabled by default.

setsebool -P fips_mode 1

if you want to determine whether calling user domains can execute Git daemon in the git_session_t domain, you must turn on the git_session_users boolean. Disabled by default.

setsebool -P git_session_users 1

if you want to allow system to run with NIS, you must turn on the nis_enabled boolean. Disabled by default.

setsebool -P nis_enabled 1

if you want to determine whether calling user domains can execute Polipo daemon in the polipo_session_t domain, you must turn on the polipo_session_users boolean. Disabled by default.

setsebool -P polipo_session_users 1

if you want to disable kernel module loading, you must turn on the secure_mode_insmod boolean. Disabled by default.

setsebool -P secure_mode_insmod 1

if you want to allow unconfined executables to make their stack executable β€” and like, this should never, ever be necessary, it probably indicates a badly coded executable, but could indicate an attack, and the executable should be reported in bugzilla β€” you must turn on the selinuxuser_execstack boolean. Disabled by default.

setsebool -P selinuxuser_execstack 1

if you want to allow user to r/w files on filesystems that do not have extended attributes (FAT, CDROM, FLOPPY), you must turn on the selinuxuser_rw_noexattrfile boolean. Disabled by default.

setsebool -P selinuxuser_rw_noexattrfile 1

if you want to allow users to run TCP servers (bind to ports and accept connection from the same domain and outside users) β€” disabling this forces FTP passive mode and may change other protocols β€” you must turn on the selinuxuser_tcp_server boolean. Disabled by default.

setsebool -P selinuxuser_tcp_server 1

if you want to allow users to run UDP servers (bind to ports and accept connection from the same domain and outside users) β€” disabling this may break avahi discovering services on the network and other udp related services β€” you must turn on the selinuxuser_udp_server boolean. Disabled by default.

setsebool -P selinuxuser_udp_server 1

🧚 HOME_EXEC 🧚

the SELinux user sysadm_u is able execute home content files. yes, your ~ stuff. slay. 🏠


πŸ‘‘ TRANSITIONS πŸ‘‘

three things can happen when sysadm_t attempts to execute a program. let's break it down bestie:

  1. SELinux Policy can deny sysadm_t from executing the program. rude but valid. 😭
  2. SELinux Policy can allow sysadm_t to execute the program in the current user type.

execute the following to see the types that the SELinux user sysadm_t can execute without transitioning:

sesearch -A -s sysadm_t -c file -p execute_no_trans
  1. SELinux can allow sysadm_t to execute the program and transition to a new type.

execute the following to see the types that the SELinux user sysadm_t can execute and transition:

$ sesearch -A -s sysadm_t -c process -p transition

πŸ’œ MANAGED FILES πŸ’œ

the SELinux process type sysadm_t can manage files labeled with the following file types. the paths listed are the default paths for these file types. quick note tho β€” the process's UID still needs to have DAC permissions. no skipping that line. πŸ™ˆ

  • file_type

all files on the system


πŸ“ COMMANDS πŸ“

  • semanage fcontext can also be used to manipulate default file context mappings.
  • semanage permissive can also be used to manipulate whether or not a process type is permissive.
  • semanage module can also be used to enable/disable/install/remove policy modules.
  • semanage boolean can also be used to manipulate the booleans
  • system-config-selinux is a GUI tool available to customize SELinux policy settings.

πŸŽ€ AUTHOR πŸŽ€

this manual page was auto-generated using sepolicy manpage. πŸ€–


πŸ”₯ SEE ALSO πŸ”₯

selinux(8), sysadm(8), semanage(8), restorecon(8), chcon(1), sepolicy(8), setsebool(8), sysadm_dbusd_selinux(8), sysadm_dbusd_selinux(8), sysadm_gkeyringd_selinux(8), sysadm_gkeyringd_selinux(8), sysadm_passwd_selinux(8), sysadm_passwd_selinux(8), sysadm_screen_selinux(8), sysadm_screen_selinux(8), sysadm_seunshare_selinux(8), sysadm_seunshare_selinux(8), sysadm_ssh_agent_selinux(8), sysadm_ssh_agent_selinux(8), sysadm_su_selinux(8), sysadm_su_selinux(8), sysadm_sudo_selinux(8), sysadm_sudo_selinux(8)


and that's the whole page bestie!! this gorgeous little doc lives in the sysadm SELinux Policy documentation manual as sysadm_selinux(8), and it was brought to you by mgrepl@redhat.com. mwah, go configure your policy responsibly πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from