FAPOLICY...ER.CONF:(15)
β¨ fapolicyd-filter.conf β the filter config bestie β¨
okay so you found the fapolicyd-filter.conf man page and honestly? good for you. this is the config file that decides which files from a trust source get to be in the TrustDB. it's lowkey the bouncer at the club door π
πΈ NAME πΈ
fapolicyd-filter.conf β the fapolicyd filter configuration file. that's her. that's the whole vibe.
π DESCRIPTION π
so the filter? she controls which files from a trust source get added to the TrustDB. periodt.
rules are processed from top to bottom, and indentation narrows the scope of the parent rule. it's giving family tree energy π³
- a matching plus (
+) rule means a file gets included - a minus (
-) rule means it gets excluded - if no rule matches, the file is excluded by default (sorry bestie, no match = no entry, that's just how she is)
big important thing π¨ the filter is only consulted when trust data is imported β that's during system updates, and when the daemon starts and rebuilds its database. runtime policy decisions use the TrustDB itself, not the filter. so changing the filter affects new or rebuilt trust entries, not live access checks. iykyk.
Valid lines start with +, -, or # for comments. the rest of the line is a path specification. you can use a space as indentation to add more specific filters onto the previous one. and no cap, only one space is required for one level of indent π«Ά
if there are multiple specifications on the same indentation level, they extend the previous line with lower indentation β usually a directory.
the path may be specified using a glob pattern. and listen, a directory specification has to end with a slash /. without it, the rule is treated as a file glob and the directory decision from the parent rule remains in effect. no slash, no directory energy β
if the result was a plus (+), the respective file from a trust source is imported to the TrustDB. vice versa, if the result was a minus (-), the respective file is not imported.
π performance tea π
from a performance point of view, it is better to design an indented filter, because in the ideal situation each component of the path is compared only once. iconic. β¨
in contrast to it, a filter without any indentation has to contain a full path, which makes the pattern more complicated and thus slower to process. the motivation behind this is to have a flexible configuration and keep the TrustDB as small as possible to make the look-ups faster. she's efficient AND cute π¦
π examples (the receipts) π
# this is simple allow list
- /usr/bin/some_binary1
- /usr/bin/some_binary2
+ /
# this is the same
+ /
+ usr/bin/
- some_binary1
- some_binary2
# this is similar allow list with a wildcard
- /usr/bin/some_binary?
+ /
# this is similar with another wildcard
+ /
- usr/bin/some_binary*
# keeps everything except usr/share except python and perl files
# /usr/bin/ls - result is '+'
# /usr/share/something - result is '-'
# /usr/share/abcd.py - result is '+'
+ /
- usr/share/
+ *.py
+ *.pl
π THEORY OF OPERATION π
okay so here's the behind-the-scenes lore π
the filter configuration is parsed into a tree, where each node represents a path fragment and whether it is included or excluded. each level of indentation in the configuration file becomes another depth level in that tree.
during evaluation, the daemon iteratively walks the tree with an explicit stack rather than recursion, advancing through the path as fragments match. this approach keeps evaluation deterministic and prevents deep call stacks π
but here's the catch bestie: filter nesting cannot exceed 64 levels. longer hierarchies are rejected and reported as depth errors. so don't go wild with the indents, fr fr.
π§ TESTING FILTERS π§
admins can validate how a change to fapolicyd-filter.conf behaves before rebuilding the trust database. main character admin energy, we love to see it π
use:
fapolicyd-cli --test-filter /path/to/file
to trace how the configuration is applied to a specific path and see the final include/exclude decision. so satisfying, honestly π₯
when adding or updating trust entries, combine --file add or --file update with --filter so only paths that survive the filter are processed. this is useful when pointing the tool at directories to ensure the filter omits unwanted content while you test. chef's kiss πΈ
π FILES π
/etc/fapolicyd/fapolicyd-filter.conf
π SEE ALSO π
fapolicyd(8)fapolicyd-cli(1)fapolicy.rules(5)glob(7)
π AUTHOR π
Radovan Sroka β thank you for your service π«‘
and that's the whole page bestie, stan a well-documented filter. this iconic little manual came from Red Hat, dated June 2023 β go forth and filter responsibly πβ¨π
π¦ where this page comes from
- centos-stream 10: fapolicyd 2.0.1-1.el10 Β· GPL-3.0-or-later
- centos-stream 9: fapolicyd 2.0.1-1.el9 Β· GPL-3.0-or-later
- fedora 43: fapolicyd 2.0-1.fc43 Β· GPL-3.0-or-later
- fedora 44: fapolicyd 1.4.4-1.fc44 Β· GPL-3.0-or-later
- fedora 44: fapolicyd 2.0.1-1.fc44 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms