CHECKMODULE(8)
π CHECKMODULE(8) π
okay bestie, this is checkmodule(8) from the System Manager's Manual, and it's literally the glow-up station for SELinux policy modules. buckle up π
β¨ NAME β¨
checkmodule β the SELinux policy module compiler π
πΈ SYNOPSIS πΈ
checkmodule [-h] [-b] [-c policy_version] [-C] [-E] [-m] [-M] [-N] [-L]
[-U handle_unknown] [-V] [-o output_file] [input_file]
π¦ DESCRIPTION π¦
so this page is all about the checkmodule command, and honestly? it's iconic.
checkmodule is the program that checks and compiles a SELinux security policy module into a binary representation. no cap.
it can spit out either:
- a base policy module β that's the default, the main character π«Ά
- a non-base policy module β that's the
-moption, the side quest π
and typically you'd build a non-base policy module to add to an existing module store that already has a base module, provided by the base policy. iykyk.
here's the full pipeline, bestie:
- use
semodule_package(8)to combine this module with its optional file contexts β that creates a policy package - then use
semodule(8)to install the module package into the module store and load the resulting policy β¨
π OPTIONS π
-b,--binaryβ read an existing binary policy module file instead of a source policy module file. ngl this one is a development/debugging aid, not the everyday vibe.-C,--cilβ write a CIL policy file instead of a binary policy file.-E,--werrorβ treat warnings as errors. harsh but fair π-h,--helpβ print usage. the classic.-mβ generate a non-base policy module.-M,--mlsβ enable the MLS/MCS support when checking and compiling the policy module.-N,--disable-neverallowβ do not check neverallow rules. π-L,--line-marker-for-allowβ output line markers for allow rules, in addition to neverallow rules. this option increases the size of the output CIL policy file, but those extra line markers help with debugging, especially for neverallow failure reports. > π heads up: it can only be used when writing a CIL policy file.-V,--versionβ show policy versions created by this program.-o,--outputfilename β write a binary policy module file to the specified filename. otherwise?checkmodulewill only check the syntax of the module source file and will not generate a binary module at all. literally just vibes and validation.-U,--handle-unknown<action> β specify how the kernel should handle unknown classes or permissions (deny,alloworreject).-cpolicyvers β specify the policy version, defaults to the latest.
π EXAMPLE π
# Build a MLS/MCS-enabled non-base policy module.
$ checkmodule -M -m httpd.te -o httpd.mod
π SEE ALSO π
semodule(8), semodule_package(8) and the SELinux Reference Policy documentation at https://github.com/SELinuxProject/refpolicy/wiki β go read those, bestie, fr fr π
π AUTHOR π
this manual page was copied from the checkpolicy man page written by ΓrpΓ‘d MagosΓ‘nyi <mag@bunuel.tii.matav.hu>, and edited by Dan Walsh <dwalsh@redhat.com>. legends only π«Ά
and that's the whole page, babe β checkmodule(8), straight out of the System Manager's Manual. thanks for coming to my ted talk, go compile something gorgeous β¨ππΈ
π¦ where this page comes from
- centos-stream 10: checkpolicy 3.10-1.el10 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- centos-stream 10: checkpolicy 3.11-2.el10 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- fedora 43: checkpolicy 3.9-2.fc43 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- fedora 44: checkpolicy 3.10-1.fc44 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- fedora 44: checkpolicy 3.11-1.fc44 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- nixos 26.05: checkpolicy 3.10
- nixpkgs unstable: checkpolicy 3.11
- ubuntu resolute: checkpolicy 3.9-1 Β· GPL-2.0-only
- ubuntu stonking: checkpolicy 3.11-1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms