You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -21,7 +21,7 @@ that are designed to work together. They are copied into /etc/fapolicyd/rules.d/
21
21
When the service starts, the systemd service file runs fagenrules which
22
22
assembles the units of rules into a comprehensive policy. The policy is
23
23
evaluated from top to bottom with the first match winning. You can see the
24
-
assembled policy by running
24
+
assembled policy by running
25
25
26
26
```
27
27
fapolicyd-cli --list
@@ -161,7 +161,7 @@ Policy. But you can do that. It is not recommended to do this except when
161
161
necessary. Every rule that is added has to potentially be evaluated - which
162
162
delays the decision.
163
163
164
-
If you needed to allow admins access to ping, but deny it to everyone
164
+
If you needed to allow admins access to ping, but deny it to everyone
165
165
else, you could do that with the following rules:
166
166
167
167
```
@@ -224,10 +224,10 @@ The report gives some basic forensic information about what was being accessed.
224
224
225
225
PERFORMANCE
226
226
-----------
227
-
When a program opens a file or calls execve, that thread has to wait for
227
+
When a program opens a file or calls execve, that thread has to wait for
228
228
fapolicyd to make a decision. To make a decision, fapolicyd has to lookup
229
229
information about the process and the file being accessed. Each system call
230
-
fapolicyd has to make slows down the system.
230
+
fapolicyd has to make slows down the system.
231
231
232
232
To speed things up, fapolicyd caches everything it looks up so that
233
233
subsequent access uses the cache rather than looking things up from
@@ -324,7 +324,7 @@ in the lmdb database is 512 bytes. So, for each 4k page, we can have data on
324
324
8 trusted files.
325
325
326
326
An ideal size for the database is for the statistics to come up around 75% in
327
-
case you decide to install new software some day. The formula is
327
+
case you decide to install new software some day. The formula is
328
328
329
329
```
330
330
(db_max_size x percentage in use) / desired percentage = new db_max_size
@@ -419,22 +419,22 @@ to debug the policy is:
419
419
420
420
Look at the rule that triggered and see if it makes sense that it triggered. If
421
421
the rule is a catch all denial, then check if the file is in the trust db. To see the rule that is being triggered, either reproduce the problem with the daemon running in debug-deny mode or change the rules from deny_audit to deny_syslog. If you choose this method, the denials will go into syslog. To see them run:
422
+
422
423
```
423
424
journalctl -b -u fapolicyd.service
424
425
```
426
+
425
427
to list out any events since boot by the fapolicyd service.
426
428
427
429
Starting with 1.1, fapolicyd-cli includes some diagnostic capabilities.
| --check-config | Opens fapolicyd.conf and parses it to see if there are any syntax errors in the file. |
432
-
| --check-path | Check that every file in $PATH is in the trustdb. (New in 1.1.5) |
433
-
| --check-status | Output internal metrics kept by the daemon. (New in 1.1.4) |
434
-
| --check-trustdb | Check the trustdb against the files on disk to look for mismatches that will cause problems at run time. |
435
-
| --check-watch_fs | Check the mounted file systems against the watch_fs daemon config entry to determine if any file systems need to be added to the configuration. |
|`--check-config`| Opens fapolicyd.conf and parses it to see if there are any syntax errors in the file. |
434
+
|`--check-path`| Check that every file in `$PATH` is in the trustdb. (New in 1.1.5) |
435
+
|`--check-status`| Output internal metrics kept by the daemon. (New in 1.1.4) |
436
+
|`--check-trustdb`| Check the trustdb against the files on disk to look for mismatches that will cause problems at run time. |
437
+
|`--check-watch_fs`| Check the mounted file systems against the watch_fs daemon config entry to determine if any file systems need to be added to the configuration. |
438
438
439
439
MANAGING TRUST
440
440
--------------
@@ -497,113 +497,129 @@ FAQ
497
497
---
498
498
1) Can this work with other distributions?
499
499
500
-
Absolutely! There is a backend API that any trust source has to implement.
501
-
This API is located in fapolicyd-backend.h. A new backend needs an init, load,
502
-
and destroy function. So, someone who knows the debian package database,
503
-
for example, could implement a new backend and send a pull request. We are
504
-
looking for collaborators.
500
+
Absolutely! There is a backend API that any trust source has to implement.
501
+
This API is located in `fapolicyd-backend.h`. A new backend needs an init, load,
502
+
and destroy function.
505
503
506
-
An initial implementation for Debian distributions has been added.
507
-
Run:
508
-
```
509
-
cd deb
510
-
./build_deb.sh
511
-
```
504
+
An initial implementation for Debian distributions has been added, run:
505
+
506
+
```
507
+
cd deb
508
+
./build_deb.sh
509
+
```
510
+
511
+
To build the `.deb` package that uses the `debdb` backend.
512
+
You must add rules to `/etc/fapolicyd/rules.d/` and change configuration
513
+
in `/etc/fapolicyd/fapolicyd.conf` to use `trust=debdb` after installation.
514
+
515
+
Gentoo-based distributions can try using the ebuild backend:
512
516
513
-
To build the `.deb` package that uses the `debdb` backend.
514
-
You must add rules to `/etc/fapolicyd/rules.d/` and change configuration
515
-
in `/etc/fapolicyd/fapolicyd.conf` to use `trust=debdb` after installation.
517
+
```
518
+
./configure --with-ebuild --with-audit
519
+
make -j
520
+
make install
521
+
```
516
522
517
-
Also, if the distribution is very small, you can use the file trust database
518
-
file. Just add the places where libraries and applications are stored.
523
+
To use the ebuild backend:
524
+
525
+
1. Enable the ebuild backend by adding `trust = ebuilddb` to `/etc/fapolicyd/fapolicyd.conf`
526
+
2. Increase `db_max_size` to 100 or more in `/etc/fapolicyd/fapolicyd.conf`
527
+
3. Copy the example rules to `/etc/fapolicyd/rules.d/` and run `fagenrules` to compile them.
528
+
529
+
There is also an ebuild in the Gentoo Repository to simplify installation which
530
+
does these things automatically.
531
+
532
+
Finally, if the distribution is very small (or in an embedded context), consider using
533
+
the trust file database - Just whitelist applications or libraries and their hashes.
519
534
520
535
2) Can SE Linux or AppArmor do this instead?
521
536
522
-
SE Linux is modeling how an application behaves. It is not concerned about
523
-
where the application came from or whether it's known to the system. Basically,
524
-
anything in /bin gets bin_t type by default which is not a very restrictive
525
-
label. MAC systems serve a different purpose. Fapolicyd by design cares solely
526
-
about if this is a known application/library. These are complimentary security
527
-
subsystems. There is more information about application whitelisting use cases
528
-
at the following NIST website:
537
+
SE Linux is modeling how an application behaves. It is not concerned about
538
+
where the application came from or whether it's known to the system. Basically,
539
+
anything in /bin gets bin_t type by default which is not a very restrictive
540
+
label. MAC systems serve a different purpose. Fapolicyd by design cares solely
541
+
about if this is a known application/library. These are complimentary security
542
+
subsystems. There is more information about application whitelisting use cases
0 commit comments