Add initial cockpit profiles.

This commit is contained in:
Alexandre Pujol 2021-10-07 14:58:54 +01:00
parent 1a31d8271e
commit a2dc5b1132
No known key found for this signature in database
GPG Key ID: C5469996F0DF68EC
11 changed files with 259 additions and 1 deletions

View File

@ -0,0 +1,16 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2021 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = /{usr/,}lib/cockpit/cockpit-askpass
profile cockpit-askpass @{exec_path} {
include <abstractions/base>
@{exec_path} mr,
include if exists <local/cockpit-askpass>
}

View File

@ -0,0 +1,58 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2021 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = /{usr/,}bin/cockpit-bridge
profile cockpit-bridge @{exec_path} {
include <abstractions/base>
include <abstractions/app-launcher-root>
include <abstractions/nameservice-strict>
include <abstractions/consoles>
capability dac_read_search,
capability sys_nice,
network inet dgram,
network inet stream,
network inet6 dgram,
network inet6 stream,
signal (send) set=term peer=dbus-daemon,
signal (send) set=term peer=ssh-agent,
signal (send) set=term peer=sudo,
signal (send) set=term peer=unconfined,
@{exec_path} mr,
/{usr/,}bin/journalctl rPx,
/usr/share/cockpit/{,**} r,
/etc/cockpit/{,**} r,
/etc/machine-id r,
/etc/motd r,
/etc/shadow r,
owner @{user_cache_dirs}/ssh-agent.[0-9A-Z]* rw,
@{run}/systemd/userdb/ r,
@{run}/user/@{uid}/ssh-agent.[0-9A-Z]* rw,
@{run}/utmp r,
owner @{PROC}/@{pid}/cgroup r,
owner @{PROC}/@{pid}/fd/ r,
owner @{PROC}/@{pid}/mounts r,
@{PROC}/@{pids}/net/dev r,
@{PROC}/1/cgroup r,
@{PROC}/diskstats r,
@{PROC}/sys/kernel/random/boot_id r,
@{PROC}/uptime r,
/dev/ptmx rw,
include if exists <local/cockpit-bridge>
}

View File

@ -0,0 +1,18 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2021 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = /{usr/,}lib/cockpit/cockpit-certificate-ensure
profile cockpit-certificate-ensure @{exec_path} {
include <abstractions/base>
@{exec_path} mr,
/etc/cockpit/ws-certs.d/{,*} r,
include if exists <local/cockpit-certificate-ensure>
}

View File

@ -0,0 +1,16 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2021 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = /{usr/,}lib/cockpit/cockpit-certificate-helper
profile cockpit-certificate-helper @{exec_path} {
include <abstractions/base>
@{exec_path} mr,
include if exists <local/cockpit-certificate-helper>
}

View File

@ -0,0 +1,16 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2021 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = /{usr/,}lib/cockpit/cockpit-desktop
profile cockpit-desktop @{exec_path} {
include <abstractions/base>
@{exec_path} mr,
include if exists <local/cockpit-desktop>
}

View File

@ -0,0 +1,49 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2021 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = /{usr/,}lib/cockpit/cockpit-session
profile cockpit-session @{exec_path} flags=(attach_disconnected) {
include <abstractions/base>
include <abstractions/nameservice-strict>
include <abstractions/authentication>
capability audit_write,
capability dac_read_search,
capability net_admin,
capability setgid,
capability setuid,
network netlink raw,
@{exec_path} mr,
/{usr/,}bin/{,z,ba,da}sh rix,
/{usr/,}bin/cockpit-bridge rPx,
/etc/environment r,
/etc/group r,
/etc/motd r,
/etc/security/limits.d/{,*.conf} r,
/etc/shells r,
@{run}/faillock/[a-zA-z0-9]* rwk,
@{run}/systemd/sessions/[0-9].ref rw,
@{run}/systemd/userdb/ r,
@{run}/utmp rwk,
/var/log/btmp rw,
/var/log/lastlog rw,
/var/log/wtmp rwk,
owner @{PROC}/@{pid}/loginuid rw,
owner @{PROC}/@{pid}/uid_map r,
@{PROC}/@{pids}/fd/ r,
@{PROC}/sys/kernel/random/boot_id r,
include if exists <local/cockpit-session>
}

View File

@ -0,0 +1,16 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2021 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = /{usr/,}lib/cockpit/cockpit-ssh
profile cockpit-ssh @{exec_path} {
include <abstractions/base>
@{exec_path} mr,
include if exists <local/cockpit-ssh>
}

View File

@ -0,0 +1,20 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2021 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = /{usr/,}lib/cockpit/cockpit-tls
profile cockpit-tls @{exec_path} {
include <abstractions/base>
network inet6 stream,
@{exec_path} mr,
/etc/cockpit/ws-certs.d/{,**} r,
include if exists <local/cockpit-tls>
}

View File

@ -0,0 +1,24 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2021 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = /{usr/,}lib/cockpit/cockpit-ws
profile cockpit-ws @{exec_path} {
include <abstractions/base>
@{exec_path} mr,
/{usr/,}lib/cockpit/cockpit-session rPx,
/usr/share/cockpit/{,**} r,
/etc/cockpit/ws-certs.d/ r,
owner @{PROC}/@{pid}/cgroup r,
owner @{PROC}/@{pid}/fd/ r,
include if exists <local/cockpit-ws>
}

View File

@ -0,0 +1,16 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2021 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = /{usr/,}lib/cockpit/cockpit-wsinstance-factory
profile cockpit-wsinstance-factory @{exec_path} {
include <abstractions/base>
@{exec_path} mr,
include if exists <local/cockpit-wsinstance-factory>
}

View File

@ -12,7 +12,16 @@ bootctl complain
borg complain
cfdisk complain
cgdisk complain
cockpit-askpass complain
cockpit-bridge complain
cockpit-certificate-ensure complain
cockpit-certificate-helper complain
cockpit-desktop complain
cockpit-session attach_disconnected,complain
cockpit-ssh complain
cockpit-tls complain
cockpit-ws complain
cockpit-wsinstance-factory complain
dbus-daemon-launch-helper complain
dbus-run-session complain
dkms complain