Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- daemon: Stop retrying a transport after 5 consecutive failures before user interaction; other transports keep running.
- daemon: Show the UI through the backend that xdg-desktop-portal selects, passed in the new `ui_backend` option
- daemon: Treat Debian's Firefox ESR (app ID `firefox-esr`) as a privileged client, like the other Firefox builds
- build: Harden the systemd user services with seccomp-based sandboxing (system call filter, address family and namespace restrictions, no new privileges) (#21)
- daemon: Build the list of devices offered to the user from libwebauthn's `available_transports()`, the same source discovery uses (#32)
- daemon: Allow clients to cancel requests through xdg-desktop-portal.
- ui: Pass the caller's activation token to the compositor when showing the dialog, so it can take focus when the requesting window is in the background (#152)
Expand Down
24 changes: 24 additions & 0 deletions systemd/xyz.iinuwa.credentialsd.Credentials.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,27 @@ Description=Service for creating and storing user credentials
Type=dbus
BusName=xyz.iinuwa.credentialsd.Credentials
ExecStart=@DAEMON_EXECUTABLE@

# Hardening
#
# credentialsd decides whether a caller is trusted partly by comparing its own
# mount namespace with the caller's. Options that give the service a private
# mount namespace (ProtectSystem=, ProtectHome=, PrivateTmp=, PrivateDevices=,
# ProtectKernelTunables=, ...) would make it reject xdg-desktop-portal, so only
# options enforced through seccomp and no_new_privs are used. They also work in
# the user service manager without user namespaces.
NoNewPrivileges=yes
LockPersonality=yes
MemoryDenyWriteExecute=yes
RestrictRealtime=yes
RestrictSUIDSGID=yes
RestrictNamespaces=yes
SystemCallArchitectures=native
SystemCallFilter=@system-service
# memfd_secret: the hybrid QR code secret are passed over D-Bus in memfd_secret file descriptors.
SystemCallFilter=memfd_secret
SystemCallErrorNumber=EPERM
# AF_UNIX: D-Bus (including BlueZ) and pcscd. AF_NETLINK: udev device
# monitoring. AF_INET/AF_INET6: the hybrid tunnel to the phone's relay server.
RestrictAddressFamilies=AF_UNIX AF_NETLINK AF_INET AF_INET6
UMask=0077
21 changes: 21 additions & 0 deletions systemd/xyz.iinuwa.credentialsd.UiControl.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,24 @@ Description=Internal helper service for credentialsd
Type=dbus
BusName=xyz.iinuwa.credentialsd.UiControl
ExecStart=@UI_EXECUTABLE@

# Hardening
#
# Like the daemon, no options that need a private mount namespace: the UI calls
# other portals (e.g. Settings for the colour scheme), and xdg-desktop-portal
# identifies its callers through /proc/<pid>/root. MemoryDenyWriteExecute= is left out because GTK's GL
# renderer may run on a JIT-compiling driver such as llvmpipe.
NoNewPrivileges=yes
LockPersonality=yes
RestrictRealtime=yes
RestrictSUIDSGID=yes
RestrictNamespaces=yes
SystemCallArchitectures=native
SystemCallFilter=@system-service
# memfd_secret: PINs are passed over D-Bus in memfd_secret file descriptors.
SystemCallFilter=memfd_secret
SystemCallErrorNumber=EPERM
# AF_UNIX: D-Bus and the Wayland/X11 display. AF_NETLINK: GLib's network
# monitor.
RestrictAddressFamilies=AF_UNIX AF_NETLINK
UMask=0077