Commit Graph

4 Commits

Author SHA1 Message Date
Panu Matilainen 35195684d2 Pass file descriptor to file prepare plugin hook, use when possible
Sadly the thing that allegedly makes things better mostly just makes
things more complicated as symlinks can't be opened, so we'll now have
to deal with both cases in plugins too. To make matters worse, most
APIs out there support either an fd or a path, but very few support
the *at() style dirfd + basename approach so plugins are stuck with
absolute paths for now.

This is of course a plugin API/ABI change too.
2022-02-16 10:57:18 +02:00
Panu Matilainen a388d5e8ab Fix missing includes revealed by c2ef4dd2a7 2021-11-18 09:49:40 +02:00
Radovan Sroka 6d61b7118a Fix resource leaks in fapolicyd plugin
Issues were found by coverity scan.

Signed-off-by: Radovan Sroka <rsroka@redhat.com>
2021-03-10 13:14:34 +02:00
Radovan Sroka 39595ccee3 Added fapolicyd rpm plugin
Fapolicyd (File Access Policy Daemon) implements application whitelisting
to decide file access rights. Applications that are known via a reputation
source are allowed access while unknown applications are not.

The rpm plugin allows us to use rpm database as a source of trust.
We used dnf plugin since the beggining but it only provides notification
when transaction ends. With "integrity checking" requirement we need
a continual addition of files which are installed during the system
update. With fapolicyd rpm plugin we can allow using of recently
added/updated files in scriptlets during rpm transaction.

The fapolicyd plugin gathers metadata of currently installed files.
It sends the information about files and about ongoing rpm transaction
to the fapolicyd daemon. The information is written to Linux pipe which
is placed in /var/run/fapolicyd/fapolicyd.fifo.

The data format is "%s %lu %64s\n". [path, size, sha256]

The fapolicyd rpm plugin can be enabled with "--with-fapolicyd"
configure option.

Related PRs:
https://github.com/linux-application-whitelisting/fapolicyd/pull/105
https://github.com/linux-application-whitelisting/fapolicyd/pull/106

Signed-off-by: Radovan Sroka <rsroka@redhat.com>
2021-01-28 16:35:35 +02:00