tftpd_selinux(8)

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

πŸ’… tftpd_selinux β€” the SELinux tea for your tftpd processes

okay so bestie, welcome to tftpd_selinux(8), the manual page that spills all the SELinux policy tea about the tftpd processes. yes, that's the whole NAME section, we're moving, keep up πŸƒβ€β™€οΈπŸ’¨


✨ DESCRIPTION ✨

Security-Enhanced Linux secures the tftpd processes via flexible mandatory access control. that's the whole vibe β€” mandatory access control, no negotiating, no "please sir may I", it just is. πŸ‘‘

Your tftpd processes run with the tftpd_t SELinux type. wanna check if you've got these processes running? just run the ps command with the -Z qualifier. like this, literally copy-paste:

ps -eZ | grep tftpd_t

see? easy. slay. ✨


πŸšͺ ENTRYPOINTS πŸšͺ

so how does a process even get into the tftpd_t SELinux type? through the tftpd_exec_t file type, bestie. that's the door. πŸšͺ

the default entrypoint paths for the tftpd_t domain are, and I quote:

/usr/bin/atftpd, /usr/bin/in.tftpd

those two. those are the ones. πŸŽ€


πŸ‘― PROCESS TYPES πŸ‘―

SELinux defines process types (domains) for each process running on the system. yes, each one. it's a lot. it's giving organized. πŸ—‚οΈ

you can see the context of a process using the -Z option to ps. same trick as before, it's a classic for a reason.

Policy governs the access confined processes have to files. the SELinux tftpd policy is very flexible, allowing users to set up their tftpd processes in as secure a method as possible. flexible and secure, we love a multitalented icon. πŸ’…

The following process types are defined for tftpd:

  • tftpd_t
Note: semanage permissive -a tftpd_t can be used to make the process type tftpd_t permissive. SELinux does not deny access to permissive process types, but the AVC (SELinux denials) messages are still generated. so like, it won't block anything, but it will absolutely still be in the group chat talking about it. 😭

πŸ”˜ BOOLEANS πŸ”˜

SELinux policy is customizable based on least access required β€” least access, bestie, we're minimalists now. πŸ§˜β€β™€οΈ the tftpd policy is extremely flexible and has several booleans that let you manipulate the policy and run tftpd with the tightest access possible.

tftp_home_dir β€” if you want to allow tftp to read and write files in the user home directories, you must turn on the tftp_home_dir boolean. Disabled by default.

setsebool -P tftp_home_dir 1

daemons_dontaudit_scheduling β€” if you want to dontaudit all daemons scheduling requests (setsched, sys_nice), you must turn on the daemons_dontaudit_scheduling boolean. Enabled by default.

setsebool -P daemons_dontaudit_scheduling 1

fips_mode β€” 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

nis_enabled β€” 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

use_nfs_home_dirs β€” if you want to support NFS home directories, you must turn on the use_nfs_home_dirs boolean. Enabled by default.

setsebool -P use_nfs_home_dirs 1

use_samba_home_dirs β€” if you want to support SAMBA home directories, you must turn on the use_samba_home_dirs boolean. Disabled by default.

setsebool -P use_samba_home_dirs 1

see, six booleans, six little switches, and every single one of them is a whole personality trait. flip responsibly. 🎚️✨


πŸ”Œ PORT TYPES πŸ”Œ

SELinux defines port types to represent TCP and UDP ports. ports are just vibes with numbers attached, honestly. πŸ”’

you can see the types associated with a port by using the following command:

semanage port -l

Policy governs the access confined processes have to these ports. the SELinux tftpd policy is very flexible, allowing users to set up their tftpd processes in as secure a method as possible. (yes I said that before, it's still true, consistency is a flex πŸ’…)

The following port types are defined for tftpd:

  • tftp_port_t

Default Defined Ports:

udp 69

udp 69. nice. iconic number, no notes. 😌


πŸ“‚ MANAGED FILES πŸ“‚

the SELinux process type tftpd_t can manage files labeled with the following file types. the paths listed are the default paths for these file types. and remember bestie β€” the process's UID still needs to have DAC permissions. SELinux isn't out here overriding the classics. πŸ™…β€β™€οΈ

cifs_t

cluster_conf_t

/etc/cluster(/.*)?

cluster_var_lib_t

/var/lib/pcsd(/.*)?
/var/lib/cluster(/.*)?
/var/lib/openais(/.*)?
/var/lib/pengine(/.*)?
/var/lib/corosync(/.*)?
/usr/lib/heartbeat(/.*)?
/var/lib/heartbeat(/.*)?
/var/lib/pacemaker(/.*)?

cluster_var_run_t

/run/crm(/.*)?
/run/cman_.*
/run/rsctmp(/.*)?
/run/aisexec.*
/run/heartbeat(/.*)?
/run/pcsd-ruby.socket
/run/corosync-qnetd(/.*)?
/run/corosync-qdevice(/.*)?
/run/pcsd.socket
/run/corosync.pid
/run/cpglockd.pid
/run/rgmanager.pid
/run/cluster/rgmanager.sk

ecryptfs_t

/home/[^/]+/.Private(/.*)?
/home/[^/]+/.ecryptfs(/.*)?

fusefs_t

/run/user/[0-9]+/gvfs

krb5_host_rcache_t

/var/tmp/krb5_0.rcache2
/var/cache/krb5rcache(/.*)?
/var/tmp/nfs_0
/var/tmp/DNS_25
/var/tmp/host_0
/var/tmp/imap_0
/var/tmp/HTTP_23
/var/tmp/HTTP_48
/var/tmp/ldap_55
/var/tmp/ldap_487
/var/tmp/ldapmap1_0

nfs_t

root_t

/sysroot/.aleph-version.json
/sysroot/ostree/deploy/.*-atomic/deploy(/.*)?
/
/initrd
/var/lib/ntp

tftpd_var_run_t

tftpdir_rw_t

/var/lib/tftpboot(/.*)?

okay that was a lot of paths. hydrate. drink water. you ate that. πŸ’§πŸ«Ά


🏷️ FILE CONTEXTS 🏷️

SELinux requires files to have an extended attribute to define the file type. yes, files have extended attributes, they're complex little creatures with rich inner lives. πŸ¦‹

you can see the context of a file using the -Z option to ls. same -Z energy as before, it's a family tradition at this point.

Policy governs the access confined processes have to these files. the SELinux tftpd policy is very flexible, allowing users to set up their tftpd processes in as secure a method as possible.

πŸŽ€ STANDARD FILE CONTEXT πŸŽ€

SELinux defines the file context types for the tftpd. if you wanted to store files with these types in different paths, you need to execute the semanage command to specify alternate labeling and then use restorecon to put the labels on disk. like so:

semanage fcontext -a -t tftpd_exec_t '/srv/tftpd/content(/.*)?'
restorecon -R -v /srv/mytftpd_content
Note: SELinux often uses regular expressions to specify labels that match multiple files. regex girlies stay winning. πŸ§šβ€β™€οΈ

The following file types are defined for tftpd:

tftpd_etc_t

  • Set files with the tftpd_etc_t type, if you want to store tftpd files in the /etc directories.

tftpd_exec_t

  • Set files with the tftpd_exec_t type, if you want to transition an executable to the tftpd_t domain.

Paths:

/usr/bin/atftpd, /usr/bin/in.tftpd

tftpd_var_run_t

  • Set files with the tftpd_var_run_t type, if you want to store the tftpd files under the /run or /var/run directory.

tftpdir_rw_t

  • Set files with the tftpdir_rw_t type, if you want to treat the files as tftpdir read/write content.

tftpdir_t

  • Set files with the tftpdir_t type, if you want to treat the files as tftpdir data.

Paths:

/tftpboot/.*, /tftpboot
Note: File context can be temporarily modified with the chcon command. If you want to permanently change the file context you need to use the semanage fcontext command. This will modify the SELinux labeling database. You will need to use restorecon to apply the labels. temporarily vs permanently is literally the whole plot of this story, don't mix them up bestie 😭

🀝 SHARING FILES 🀝

if you want to share files with multiple domains (Apache, FTP, rsync, Samba), you can set a file context of public_content_t and public_content_rw_t. these contexts allow any of the above domains to read the content. group project energy, but make it secure. πŸ‘―β€β™€οΈ

if you want a particular domain to write to the public_content_rw_t domain, you must set the appropriate boolean.

Allow tftpd servers to read the /var/tftpd directory by adding the public_content_t file type to the directory and by restoring the file type:

semanage fcontext -a -t public_content_t "/var/tftpd(/.*)?"
restorecon -F -R -v /var/tftpd

Allow tftpd servers to read and write /var/tftpd/incoming by adding the public_content_rw_t type to the directory and by restoring the file type. you also need to turn on the tftpd_anon_write boolean:

semanage fcontext -a -t public_content_rw_t "/var/tftpd/incoming(/.*)?"
restorecon -F -R -v /var/tftpd/incoming
setsebool -P tftpd_anon_write 1

if you want to allow tftp to modify public files used for public file transfer services., you must turn on the tftp_anon_write boolean:

setsebool -P tftp_anon_write 1

(yes, both spellings show up above β€” tftpd_anon_write in the command, tftp_anon_write in the boolean sentence. I'm not fixing it, I'm just reporting the tea exactly as it was served 🍡)


⌨️ COMMANDS ⌨️

so you wanna do stuff? here's the toolkit, bestie:

  • 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 port can also be used to manipulate the port definitions.
  • semanage boolean can also be used to manipulate the booleans.
  • system-config-selinux is a GUI tool available to customize SELinux policy settings. a GUI! for the girlies who like a little pointing and clicking with their mandatory access control πŸ–±οΈβœ¨

✍️ AUTHOR ✍️

This manual page was auto-generated using sepolicy manpage. a bot wrote this. a policy bot. and honestly? it ate. πŸ’…


πŸ‘€ SEE ALSO πŸ‘€

selinux(8), tftpd(8), semanage(8), restorecon(8), chcon(1), sepolicy(8), setsebool(8)


and that's the whole page, bestie, you're literally an SELinux tftpd expert now, no cap πŸ§šβ€β™€οΈβœ¨ this little number came to you courtesy of the tftpd manual, dated 26-10-06, living at tftpd_selinux(8) β€” go forth and label things correctly, ily, bye πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from