CHECKMODULE(8)

πŸ“¦
version 3.11 Β· 3 versions
, in centos-stream 10, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, ubuntu resolute, ubuntu stonking

πŸ’– 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 -m option, 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:

  1. use semodule_package(8) to combine this module with its optional file contexts β†’ that creates a policy package
  2. 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, --output filename β€” write a binary policy module file to the specified filename. otherwise? checkmodule will 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, allow or reject).
  • -c policyvers β€” 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