feat(abs): add pcscd

This commit is contained in:
Alexandre Pujol 2025-09-14 00:09:16 +02:00
parent 939a2b7f4b
commit 8e73353cc8
No known key found for this signature in database
GPG key ID: C5469996F0DF68EC
7 changed files with 27 additions and 9 deletions

View file

@ -42,6 +42,7 @@
include <abstractions/graphics> include <abstractions/graphics>
include <abstractions/nameservice-strict> include <abstractions/nameservice-strict>
include <abstractions/notifications> include <abstractions/notifications>
include <abstractions/pcscd>
include <abstractions/screensaver> include <abstractions/screensaver>
include <abstractions/secrets-service> include <abstractions/secrets-service>
include <abstractions/ssl_certs> include <abstractions/ssl_certs>
@ -107,7 +108,6 @@
/etc/@{name}/{,**} r, /etc/@{name}/{,**} r,
/etc/fstab r, /etc/fstab r,
/etc/{,opensc/}opensc.conf r,
/ r, / r,
owner @{HOME}/ r, owner @{HOME}/ r,

View file

@ -37,6 +37,7 @@
include <abstractions/graphics> include <abstractions/graphics>
include <abstractions/gstreamer> include <abstractions/gstreamer>
include <abstractions/nameservice-strict> include <abstractions/nameservice-strict>
include <abstractions/pcscd>
include <abstractions/ssl_certs> include <abstractions/ssl_certs>
include <abstractions/thumbnails-cache-read> include <abstractions/thumbnails-cache-read>
include <abstractions/uim> include <abstractions/uim>
@ -80,7 +81,6 @@
/usr/share/webext/{,**} r, /usr/share/webext/{,**} r,
/usr/share/xul-ext/kwallet5/* r, /usr/share/xul-ext/kwallet5/* r,
/etc/{,opensc/}opensc.conf r,
/etc/@{name}/{,**} r, /etc/@{name}/{,**} r,
/etc/fstab r, /etc/fstab r,
/etc/lsb-release r, /etc/lsb-release r,

View file

@ -0,0 +1,19 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2023 Canonical Ltd
# Copyright (C) 2025 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
# Allows interacting with PC/SC Smart Card Daemon
abi <abi/4.0>,
# Configuration file for OPENSC
/etc/opensc.conf r,
/etc/opensc/opensc.conf r,
# Socket for communication between PCSCD and PS/SC API library
@{run}/pcscd/pcscd.comm rw,
include if exists <abstractions/pcscd.d>
# vim:syntax=apparmor

View file

@ -9,13 +9,14 @@ include <tunables/global>
@{exec_path} = @{lib}/gsd-smartcard @{exec_path} = @{lib}/gsd-smartcard
profile gsd-smartcard @{exec_path} flags=(attach_disconnected) { profile gsd-smartcard @{exec_path} flags=(attach_disconnected) {
include <abstractions/base> include <abstractions/base>
include <abstractions/consoles>
include <abstractions/bus-session> include <abstractions/bus-session>
include <abstractions/bus/org.gnome.SessionManager> include <abstractions/bus/org.gnome.SessionManager>
include <abstractions/consoles>
include <abstractions/dconf-write> include <abstractions/dconf-write>
include <abstractions/gschemas>
include <abstractions/nameservice-strict> include <abstractions/nameservice-strict>
include <abstractions/p11-kit> include <abstractions/p11-kit>
include <abstractions/gschemas> include <abstractions/pcscd>
signal (receive) set=(term, hup) peer=gdm*, signal (receive) set=(term, hup) peer=gdm*,
@ -31,7 +32,6 @@ profile gsd-smartcard @{exec_path} flags=(attach_disconnected) {
/usr/share/dconf/profile/gdm r, /usr/share/dconf/profile/gdm r,
/usr/share/gdm/greeter-dconf-defaults r, /usr/share/gdm/greeter-dconf-defaults r,
/etc/{,opensc/}opensc.conf r,
/etc/tpm2-tss/* rk, /etc/tpm2-tss/* rk,
/var/tmp/ r, /var/tmp/ r,

View file

@ -19,6 +19,7 @@ profile seahorse @{exec_path} {
include <abstractions/dconf-write> include <abstractions/dconf-write>
include <abstractions/gnome-strict> include <abstractions/gnome-strict>
include <abstractions/p11-kit> include <abstractions/p11-kit>
include <abstractions/pcscd>
include <abstractions/secrets-service> include <abstractions/secrets-service>
include <abstractions/ssl_certs> include <abstractions/ssl_certs>
@ -34,7 +35,6 @@ profile seahorse @{exec_path} {
/etc/pki/trust/blocklist/ r, /etc/pki/trust/blocklist/ r,
/etc/gcrypt/hwf.deny r, /etc/gcrypt/hwf.deny r,
/etc/{,opensc/}opensc.conf r,
owner @{HOME}/@{XDG_SSH_DIR}/{,**} r, owner @{HOME}/@{XDG_SSH_DIR}/{,**} r,

View file

@ -9,11 +9,10 @@ include <tunables/global>
@{exec_path} = @{bin}/pkcs11-register @{exec_path} = @{bin}/pkcs11-register
profile pkcs11-register @{exec_path} { profile pkcs11-register @{exec_path} {
include <abstractions/base> include <abstractions/base>
include <abstractions/pcscd>
@{exec_path} mr, @{exec_path} mr,
/etc/{,opensc/}opensc.conf r,
owner @{HOME}/.mozilla/firefox/*/pkcs11.txt rw, owner @{HOME}/.mozilla/firefox/*/pkcs11.txt rw,
owner @{HOME}/.mozilla/firefox/profiles.ini r, owner @{HOME}/.mozilla/firefox/profiles.ini r,
owner @{HOME}/.pki/nssdb/pkcs11.txt r, owner @{HOME}/.pki/nssdb/pkcs11.txt r,

View file

@ -12,6 +12,7 @@ profile rngd @{exec_path} flags=(attach_disconnected) {
include <abstractions/base> include <abstractions/base>
include <abstractions/devices-usb> include <abstractions/devices-usb>
include <abstractions/nameservice-strict> include <abstractions/nameservice-strict>
include <abstractions/pcscd>
capability dac_read_search, capability dac_read_search,
capability net_admin, capability net_admin,
@ -24,7 +25,6 @@ profile rngd @{exec_path} flags=(attach_disconnected) {
/etc/conf.d/rngd r, /etc/conf.d/rngd r,
/etc/machine-id r, /etc/machine-id r,
/etc/{,opensc/}opensc.conf r,
/var/lib/dbus/machine-id r, /var/lib/dbus/machine-id r,
@{sys}/devices/virtual/misc/hw_random/rng_available r, @{sys}/devices/virtual/misc/hw_random/rng_available r,