Skip to content

Commit

Permalink
Package filter conf parser (#1012)
Browse files Browse the repository at this point in the history
Adds a parser and evaluator for the fapolicyd filter config

The public api here is not integrated into the system in this PR. A
later commit will integrate it as the backend of the editor.

The evaluation function implemented here can be used to enhance the
analysis view by tying a trust decision back to a line from rpm filter,
similar to how rules are referenced. A difference between rules and
trust here is that the trust relation may not exist, where the rule
relation always exists.

The impl uses a trie to map characterwise for searching. The impl
supports the same wildcard characters as the fapolicyd impl. There is
decent test coverage, but likely more corner cases. Configurations from
the wild, mapped into tests, would be useful. The examples from the
fapolicyd man pages are mapped to tests.

#758
  • Loading branch information
jw3 committed Apr 13, 2024
1 parent f1756ed commit e9f482b
Show file tree
Hide file tree
Showing 7 changed files with 597 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/trust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ edition = "2021"

[dev-dependencies]
tempfile = "3.3"
assert_matches = "1.5"

[dependencies]
lmdb = "0.8"
Expand Down

0 comments on commit e9f482b

Please sign in to comment.