The fapolicyd application whitelist: default rules measured, a surprise about script allowlisting, and the troubleshooting boundary
What you will learn
Section titled “What you will learn”The complete deployment and validation path for fapolicyd (the application whitelist) on OL 10 — and an honest “it didn’t block” investigation: the default rules’ real behavior, the causes ruled out, and the validation probes left to you. Far more valuable than a one-click-whitelist fairy tale.
Deployment
Section titled “Deployment”dnf install -y fapolicydsystemctl enable --now fapolicydjournalctl -u fapolicyd --no-pager | tail -3# Loaded trust info from all backends: 9740# Trust database checks OK# Starting to listen for eventsThe first trust-database build takes tens of seconds (a full rpmdb scan); during that window the service reports active but the rules are not yet effective — wait for Trust database checks OK before testing.
The rule structure: /etc/fapolicyd/rules.d/
Section titled “The rule structure: /etc/fapolicyd/rules.d/”The measured default rule set (matched in order; the first hit wins):
| File | Key rule | Meaning |
|---|---|---|
| 20-dracut | allow uid=0 trust=1 : all | root is allowed everything against trusted files |
| 30-patterns | deny pattern=ld_so : all | blocks ld.so.preload-class injection |
| 42-trusted-elf | allow perm=execute trust=1 | RPM-origin executables are allowed |
| 72-shell | allow perm=any : ftype=text/x-shellscript | all shell scripts unconditionally allowed |
| 90-deny-execute | deny perm=execute : all | fallback: everything else’s execution denied |
| 95-allow-open | allow perm=open : all | the open-operation fallback allowance |
Custom rules go in rules.d/*.rules (the number sets precedence); after changes run fapolicyd-cli --update to recompile.
Execution observations (recorded honestly)
Section titled “Execution observations (recorded honestly)”By rule inference all of the following should be denied by the 90 fallback — measured: all allowed:
cp /bin/true /tmp/untrusted-bin && /tmp/untrusted-bin # executed successfully (expected: denied)printf '#!/bin/sh\necho ok\n' > /tmp/u.sh && /tmp/u.sh # succeeded (72-shell explicitly allows; as expected)echo x > /etc/ld.so.preload # the write was not blocked (30-patterns expected: denied)Causes ruled out:
permissive = 0(fapolicyd.conf — not audit mode);- kernel
CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y(UEK 6.12 supports the permission events blocking requires); - service active, trust database ready, rules in place.
Conclusion: on this UEK VM, fapolicyd’s blocking behavior did not engage; the root cause is undetermined (open question). Possible directions: the fanotify event path, the compiled-rule state, or a UEK combination issue — further comparison against an RHEL kernel with kill -USR1 $(pidof fapolicyd) statistics is suggested.
The reader’s probe set (run after every deployment)
Section titled “The reader’s probe set (run after every deployment)”# 1. Service and trust database readysystemctl is-active fapolicyd && journalctl -u fapolicyd | grep "checks OK"# 2. Untrusted ELF should be deniedcp /bin/true /tmp/t && /tmp/t; echo rc=$? # expected rc=126/Permission denied# 3. ld.so.preload should be deniedecho /dev/null > /etc/ld.so.preload && echo NOT-BLOCKED; rm -f /etc/ld.so.preload# 4. Event statisticskill -USR1 $(pidof fapolicyd); journalctl -u fapolicyd --since "1 min ago"If the three probes behave as in this article (not blocked) → your environment is likewise in the default-allow state; if blocked → blocking works and you whitelist as needed. A compliance plan is judged by the probe results, never by “fapolicyd is installed”.
The division of labor with SELinux
Section titled “The division of labor with SELinux”SELinux governs “may this service touch this class of resource” (type enforcement), while fapolicyd governs “which binary may execute” (a trust whitelist) — complementary, not substitutes. SELinux measured is on the SELinux basics page.
Evidence and limits on this page
Section titled “Evidence and limits on this page”- Measured: the deployment chain, the full rule reading, the three probes’ execution observations, and the exclusion checks (E3);
- Not located: the root cause of blocking not engaging (open question, troubleshooting path provided); not measured: custom allowlisting (trust.d) and language-bytecode scenarios;
- Sources:
fapolicyd(8),fapolicyd.rules(5), OL10 security documentation.