SEMODULE(8)
๐ SEMODULE(8) ๐
okay bestie, welcome to semodule, from the System Manager's Manual โ she's the SELinux policy module manager and she's that girl ๐
โจ NAME โจ
semodule โ Manage SELinux policy modules. ๐
๐ธ SYNOPSIS ๐ธ
semodule [option]... MODE...
๐ฆ DESCRIPTION ๐ฆ
so semodule is literally the tool for managing SELinux policy modules โ installing them, upgrading them, listing them, removing them, the whole vibe. ๐ซถ she can also force a rebuild of policy from the module store and/or force a reload of policy without doing any other transaction. no cap.
semodule acts on module packages created by semodule_package. conventionally those files have a .pp suffix (policy package) โ though this is not mandated in any way, it's just the ~aesthetic~ iykyk.
๐ MODES ๐
-R,--reloadโ force a reload of policy ๐-B,--buildโ force a rebuild of policy (also reloads unless-nis used)--refreshโ like--build, but she reuses the existing linked policy if no changes to module files are detected (by comparing with the checksum from the last transaction). you can use this instead of-Bto make sure any changes to the module store done by an external tool (e.g. a package manager) get applied, while automatically skipping the module re-linking if there are no module changes. efficient queen ๐-D,--disable_dontauditโ temporarily remove dontaudits from policy. reverts whenever policy is rebuilt โ ๏ธ-i,--install=MODULE_PKGโ install/replace a module package-u,--upgrade=MODULE_PKGโ deprecated, alias for--install-b,--base=MODULE_PKGโ deprecated, alias for--install-r,--remove=MODULE_NAMEโ remove existing module at desired priority (defaults to-X 400)-l[KIND],--list-modules[=KIND]โ display list of installed modules (other than base)
๐ KIND:
standardโ list highest priority, enabled, non-base modulesfullโ list all modules-X,--priority=PRIORITYโ set priority for following operations (1-999)-e,--enable=MODULE_NAMEโ enable module โจ-d,--disable=MODULE_NAMEโ disable module ๐-E,--extract=MODULE_PKGโ Extract a module from the store as an HLL or CIL file to the current directory. A module is extracted as HLL by default. The name of the module written is<module-name>.<lang_ext>
๐ OPTIONS ๐
-s,--storeโ name of the store to operate on-n,--noreload,-Nโ do not reload policy after commit-h,--helpโ prints help message and quit-P,--preserve_tunablesโ Preserve tunables in policy-C,--ignore-module-cacheโ Recompile CIL modules built from HLL files-g,--config=PATHโ use an alternate path for the semanage config-p,--pathโ Use an alternate path for the policy root-S,--store-pathโ Use an alternate path for the policy store root-v,--verboseโ be verbose ๐ฃ๏ธ-c,--cilโ Extract module as a CIL file. This only affects the--extractoption and only modules listed in--extractafter this option.-H,--hllโ Extract module as an HLL file. This only affects the--extractoption and only modules listed in--extractafter this option.-m,--checksumโ Add SHA256 checksum of modules to the list output.
๐ฅ EXAMPLE ๐ฅ
she ate with these, fr fr:
# Install or replace a base policy package.
$ semodule -b base.pp
# Install or replace a non-base policy package.
$ semodule -i httpd.pp
# Install or replace all non-base modules in the current directory.
# This syntax can be used with -i/u/r/E, but no other option can be entered after the module names
$ semodule -i *.pp
# Install or replace all modules in the current directory.
$ ls *.pp | grep -Ev "base.pp|enableaudit.pp" | xargs /usr/sbin/semodule -b base.pp -i
# List non-base modules.
$ semodule -l
# List all modules including priorities
$ semodule -lfull
# Remove a module at priority 100
$ semodule -X 100 -r wireshark
# Turn on all AVC Messages for which SELinux currently is "dontaudit"ing.
$ semodule -DB
# Turn "dontaudit" rules back on.
$ semodule -B
# Disable a module (all instances of given module across priorities will be disabled).
$ semodule -d alsa
# Install a module at a specific priority.
$ semodule -X 100 -i alsa.pp
# Set an alternate path for the policy root
$ semodule -B -p "/tmp"
# Set an alternate path for the policy store root
$ semodule -B -S "/tmp/var/lib/selinux"
# Write the HLL version of puppet and the CIL version of wireshark
# modules at priority 400 to the current working directory
$ semodule -X 400 --hll -E puppet --cil -E wireshark
# Check whether a module in "localmodule.pp" file is same as installed module "localmodule"
$ /usr/libexec/selinux/hll/pp localmodule.pp | sha256sum
$ semodule -l -m | grep localmodule
# Translate binary module file into CIL (useful for debugging installation errors)
$ /usr/libexec/selinux/hll/pp alsa.pp > alsa.cil
๐ SEE ALSO ๐
checkmodule(8), semodule_package(8)
๐ AUTHORS ๐
This manual page was written by Dan Walsh <dwalsh@redhat.com>. The program was written by Karl MacMillan <kmacmillan@tresys.com>, Joshua Brindle <jbrindle@tresys.com>, Jason Tang <jtang@tresys.com>
k that's the whole page bestie, you're officially semodule-pilled ๐ โจ
Security Enhanced Linux ๐ธ Nov 2005 ๐ โ that's the source, the version vibe and the date, mwah, go forth and manage those modules queen ๐๐ฆ
๐ฆ where this page comes from
- centos-stream 10: policycoreutils 3.11-1.el10 ยท GPL-2.0-or-later
- fedora 43: policycoreutils 3.9-5.fc43 ยท GPL-2.0-or-later
- fedora 43: policycoreutils 3.9-7.fc43 ยท GPL-2.0-or-later
- fedora 44: policycoreutils 3.10-1.fc44 ยท GPL-2.0-or-later
- fedora 44: policycoreutils 3.11-2.fc44 ยท GPL-2.0-or-later
- nixos 26.05: policycoreutils 3.11
- nixpkgs unstable: policycoreutils 3.11
- ubuntu resolute: policycoreutils 3.9-2
- ubuntu stonking: policycoreutils 3.11-1
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms