tomcat_selinux(8)
π± tomcat_selinux(8) π β the SELinux glow-up for Tomcat
okay so bestie, welcome to the tomcat_selinux(8) page β this is the SELinux policy manual for the tomcat processes, and it's literally about keeping your Tomcat locked down and cute. the page source is tomcat, version 26-10-06, dated 26-10-06 (same date, efficient queen behavior), but we'll get to that at the end. let's go. π
β¨ NAME β¨
tomcat_selinux β Security Enhanced Linux Policy for the tomcat processes. that's the whole vibe. periodt.
π DESCRIPTION π
so Security-Enhanced Linux secures the tomcat processes via flexible mandatory access control. no cap, it's giving security with main character energy.
the tomcat processes execute with the tomcat_t SELinux type. you can check if you have these processes running by executing the ps command with the -Z qualifier. for example:
ps -eZ | grep tomcat_t
slay, now you can see what's up. π
πͺ ENTRYPOINTS πͺ
the tomcat_t SELinux type can be entered via the tomcat_exec_t file type. that's the doorway, bestie.
the default entrypoint paths for the tomcat_t domain are the following:
/usr/bin/tomcat(6)?, /usr/libexec/tomcat/server
those are the exact paths, keep them close. π«Ά
π PROCESS TYPES π
SELinux defines process types (domains) for each process running on the system. it's a whole thing.
you can see the context of a process using the -Z option to ps. yes, again with the -Z, it's iconic.
policy governs the access confined processes have to files. SELinux tomcat policy is very flexible allowing users to setup their tomcat processes in as secure a method as possible. we love a flexible queen.
the following process types are defined for tomcat:
tomcat_t
note:semanage permissive -a tomcat_tcan be used to make the process typetomcat_tpermissive. SELinux does not deny access to permissive process types, but the AVC (SELinux denials) messages are still generated. so like, permissive is not a free pass, it's just a vibe. π
π BOOLEANS π
SELinux policy is customizable based on least access required. tomcat policy is extremely flexible and has several booleans that allow you to manipulate the policy and run tomcat with the tightest access possible. it's giving "customize your security, bestie."
tomcat_use_execmemβ if you want to allow tomcat to use executable memory and executable stack, you must turn on thetomcat_use_execmemboolean. disabled by default. run:setsebool -P tomcat_use_execmem 1daemons_dontaudit_schedulingβ if you want to dontaudit all daemons scheduling requests (setsched,sys_nice), you must turn on thedaemons_dontaudit_schedulingboolean. enabled by default. run:setsebool -P daemons_dontaudit_scheduling 1mmap_low_allowedβ if you want to control the ability to mmap a low area of the address space, as configured by/proc/sys/vm/mmap_min_addr, you must turn on themmap_low_allowedboolean. disabled by default. run:setsebool -P mmap_low_allowed 1nis_enabledβ if you want to allow system to run with NIS, you must turn on thenis_enabledboolean. disabled by default. run:setsebool -P nis_enabled 1secure_mode_insmodβ if you want to disable kernel module loading, you must turn on thesecure_mode_insmodboolean. disabled by default. run:setsebool -P secure_mode_insmod 1selinuxuser_execheapβ if you want to allow unconfined executables to make their heap memory executable. doing this is a really bad idea. probably indicates a badly coded executable, but could indicate an attack. this executable should be reported in bugzilla, you must turn on theselinuxuser_execheapboolean. disabled by default. run:setsebool -P selinuxuser_execheap 1selinuxuser_execstackβ if you want to allow unconfined executables to make their stack executable. this should never, ever be necessary. probably indicates a badly coded executable, but could indicate an attack. this executable should be reported in bugzilla, you must turn on theselinuxuser_execstackboolean. disabled by default. run:setsebool -P selinuxuser_execstack 1
okay but fr fr, those last two? red flags. if you're turning those on, something is probably cursed. report it to bugzilla, bestie. π
π MANAGED FILES π
the SELinux process type tomcat_t can manage files labeled with the following file types. the paths listed are the default paths for these file types. note the processes UID still need to have DAC permissions. so like, SELinux isn't doing all the work, your UID has to cooperate too. π
file_typeβ all files on the system. literally every file, no cap.
π¨ FILE CONTEXTS π¨
SELinux requires files to have an extended attribute to define the file type. it's a whole labeling system.
you can see the context of a file using the -Z option to ls. yes, -Z again, it's the moment.
policy governs the access confined processes have to these files. SELinux tomcat policy is very flexible allowing users to setup their tomcat processes in as secure a method as possible. we love consistency.
π STANDARD FILE CONTEXT π
SELinux defines the file context types for the tomcat, if you wanted to store files with these types in a 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 tomcat_exec_t '/srv/tomcat/content(/.*)?'
restorecon -R -v /srv/mytomcat_content
note: SELinux often uses regular expressions to specify labels that match multiple files. so those regexes are intentional, don't come for them.
the following file types are defined for tomcat:
tomcat_cache_tβ set files with thetomcat_cache_ttype, if you want to store the files under the/var/cachedirectory. cache queen.tomcat_exec_tβ set files with thetomcat_exec_ttype, if you want to transition an executable to thetomcat_tdomain. paths:/usr/bin/tomcat(6)?, /usr/libexec/tomcat/servertomcat_log_tβ set files with thetomcat_log_ttype, if you want to treat the data as tomcat log data, usually stored under the/var/logdirectory. logs are iconic.tomcat_tmp_tβ set files with thetomcat_tmp_ttype, if you want to store tomcat temporary files in the/tmpdirectories. temp files, we stan.tomcat_unit_file_tβ set files with thetomcat_unit_file_ttype, if you want to treat the files as tomcat unit content. unit content, very demure.tomcat_var_lib_tβ set files with thetomcat_var_lib_ttype, if you want to store the tomcat files under the/var/libdirectory. paths:/var/lib/tomcat6?(/.*)?, /var/lib/tomcats?(/.*)?tomcat_var_run_tβ set files with thetomcat_var_run_ttype, if you want to store the tomcat files under the/runor/var/rundirectory. run files, run the world.
note: file context can be temporarily modified with thechconcommand. if you want to permanently change the file context you need to use thesemanage fcontextcommand. this will modify the SELinux labeling database. you will need to userestoreconto apply the labels. don't skip the restorecon, bestie. π
π» 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. for the girlies who like a visual interface. β¨
βοΈ AUTHOR βοΈ
this manual page was auto-generated using sepolicy manpage . β no human wrote this prose, it's giving robot with a cute filter. π€π
π SEE ALSO π
so yeah, that's the whole page, bestie. source/version is tomcat, version 26-10-06, dated 26-10-06. catch you later, stay secure, and don't turn on selinuxuser_execheap unless you have a really good reason. periodt. ππ¦πΈ
π¦ where this page comes from
- opensuse-leap 16.0: selinux-policy-doc 20250627+git412.dbf877ab7-160000.1.1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms