Skip to content
Search Oracle Linux

    Browse this documentation

    The fapolicyd application whitelist: default rules measured, a surprise about script allowlisting, and the troubleshooting boundary

    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.

    Terminal window
    dnf install -y fapolicyd
    systemctl enable --now fapolicyd
    journalctl -u fapolicyd --no-pager | tail -3
    # Loaded trust info from all backends: 9740
    # Trust database checks OK
    # Starting to listen for events

    The 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):

    FileKey ruleMeaning
    20-dracutallow uid=0 trust=1 : allroot is allowed everything against trusted files
    30-patternsdeny pattern=ld_so : allblocks ld.so.preload-class injection
    42-trusted-elfallow perm=execute trust=1RPM-origin executables are allowed
    72-shellallow perm=any : ftype=text/x-shellscriptall shell scripts unconditionally allowed
    90-deny-executedeny perm=execute : allfallback: everything else’s execution denied
    95-allow-openallow perm=open : allthe 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:

    Terminal window
    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)”
    Terminal window
    # 1. Service and trust database ready
    systemctl is-active fapolicyd && journalctl -u fapolicyd | grep "checks OK"
    # 2. Untrusted ELF should be denied
    cp /bin/true /tmp/t && /tmp/t; echo rc=$? # expected rc=126/Permission denied
    # 3. ld.so.preload should be denied
    echo /dev/null > /etc/ld.so.preload && echo NOT-BLOCKED; rm -f /etc/ld.so.preload
    # 4. Event statistics
    kill -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”.

    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.

    • 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.