Commit Graph

12 Commits

Author SHA1 Message Date
7aecec1449 data: Restrict syscall usage of fprintd
fprintd only needs very few syscalls. Mainly normal IO operations and
ioctl for USB access. All of this is covered by @system-service, we
could likely restrict it quite a bit more though.
2021-06-29 21:10:59 +02:00
0f7340130e data: Disallow fprintd to read kernel logs 2021-06-29 21:10:03 +02:00
fcd7e9bc76 data: Only allow access to USB and SPI devices
That is all that fprintd. Note that ProtectClock already restricts
device access and other device types need to be listed explicitly
because of this.
2021-06-29 20:48:16 +02:00
6fd1aa51cd data: Use the correct mode for the state dir
The code (in file_storage.c) expects mode 0700. However, systemd
defaults to 0755. This causes strange behavior.

https://bugs.archlinux.org/task/68932
2021-01-19 22:18:55 +00:00
e224913b80 Revert "data: Add additional fprintd lockdown"
The current lockdown rules prevent USB devices from being accessed and
cause threading to not work.
As such, revert them until it is clear on how/if we can apply these
measures. It is primarily not clear on how to prevent fork/clone as
fprintd does not need those.

This reverts commit 2fd86624e5.

See: #82
2020-11-10 12:27:38 +00:00
2fd86624e5 data: Add additional fprintd lockdown 2020-10-13 09:28:39 +00:00
94a9815362 data: tell systemd to create state directory
If the directory referred to by ReadWritePaths= does not exist, the
service fails to start:

    systemd[1]: Starting Fingerprint Authentication Daemon...
    systemd[9736]: fprintd.service: Failed to set up mount namespacing: No such file or directory
    systemd[9736]: fprintd.service: Failed at step NAMESPACE spawning /usr/lib/fprintd/fprintd: No such file or directory
    systemd[1]: fprintd.service: Main process exited, code=exited, status=226/NAMESPACE
    systemd[1]: fprintd.service: Failed with result 'exit-code'.
    systemd[1]: Failed to start Fingerprint Authentication Daemon.

This may happen when booting with an empty /var filesystem.

For a system service, "StateDirectory=fprint" causes /var/lib/fprint and
any parent directories to be created if missing (with mode 0755 by
default, owned by the user and group of the service, which in this case
is root).  In combination with ProtectSystem=strict, this state
directory will be mounted read-write.  StateDirectory was introduced in
systemd 235, so require at least this version.

The /var/lib prefix is hardcoded in systemd. (Since systemd 240, the
full path(s) to StateDirectory are provided as $STATE_DIRECTORY, but
since it is always /var/lib, we continue to just hardcode that path.)

On non-systemd systems, since fprintd runs as root with no confinement,
it can create its state directory as needed (with g_mkdir_with_parents()
in file_storage_print_data_save()).
2019-07-04 15:27:54 +01:00
9ed8767cb3 Hardcode storage path as /var/lib/fprint
--localstatedir (and --prefix) will now be ignored in favour of this
hardcoded path.  This is in preparation for a change to use systemd's
StateDirectory feature.
2019-07-04 15:27:54 +01:00
2704e72308 data: Restrict available socket protocols
When starting the daemon
2018-04-26 14:44:02 +02:00
6494efa94e data: Stop privilege escalations in daemon
Using the NoNewPrivileges stanza from systemd.
2017-09-13 15:48:17 +02:00
36d3d9d749 data: Lockdown the fprintd service
Give read-write access to USB devices in /dev, and the location of the
fingerprints, access to Unix sockets for D-Bus and
close everything else down.

See systemd.exec(5) for details about the options.
2017-01-05 13:04:48 +01:00
9ea025d9cb Add a systemd unit file
It's just better if we get activated via systemd rather than dbus.
Various bits of configury/makefile taken from polkit.

https://bugs.freedesktop.org/show_bug.cgi?id=58468
2012-12-18 17:29:26 +01:00