chore: move some cron profiles.

This commit is contained in:
Alexandre Pujol 2022-06-14 20:14:32 +01:00
parent 55c0827c2a
commit d93879d9df
No known key found for this signature in database
GPG key ID: C5469996F0DF68EC
9 changed files with 0 additions and 0 deletions

View file

@ -0,0 +1,89 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2018-2021 Mikhail Morfikov
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = /{usr/,}sbin/cron-apt
profile cron-apt @{exec_path} {
include <abstractions/base>
include <abstractions/nameservice-strict>
# Needed?
capability setgid,
@{exec_path} r,
/{usr/,}bin/{,ba,da}sh rix,
/{usr/,}bin/dotlockfile rix,
/{usr/,}bin/sed rix,
/{usr/,}bin/mktemp rix,
/{usr/,}bin/diff rix,
/{usr/,}bin/mkdir rix,
/{usr/,}bin/rmdir rix,
/{usr/,}bin/rm rix,
/{usr/,}bin/{,e}grep rix,
/{usr/,}bin/md5sum rix,
/{usr/,}bin/stat rix,
/{usr/,}bin/date rix,
/{usr/,}bin/cat rix,
/{usr/,}bin/expr rix,
/{usr/,}bin/cp rix,
/{usr/,}bin/dd rix,
/{usr/,}bin/cksum rix,
/{usr/,}bin/gawk rix,
/{usr/,}bin/sleep rix,
/{usr/,}bin/mv rix,
/{usr/,}bin/logger rix,
/{usr/,}bin/ls rix,
/{usr/,}bin/touch rix,
/{usr/,}bin/uname rix,
/{usr/,}bin/fold rix,
/{usr/,}bin/apt-get rPx,
/{usr/,}bin/apt-file rPx,
/{usr/,}bin/aptitude{,-curses} rPx,
/{usr/,}sbin/exim4 rPx,
/usr/share/cron-apt/{,*} r,
/etc/cron-apt/{,*/} r,
/etc/cron-apt/config r,
/etc/cron-apt/refrain r,
/etc/cron-apt/action.d/[0-9]-* r,
# For shell pwd
/ r,
/etc/ r,
/root/ r,
/var/lib/cron-apt/ rw,
/var/lib/cron-apt/** rwl -> /var/lib/cron-apt/**,
# Logs
/var/log/cron-apt/ r,
/var/log/cron-apt/error w,
/var/log/cron-apt/temp rw,
/var/log/cron-apt/mail rw,
/var/log/cron-apt/lastfullmessage rw,
# For the "ls" command
/{usr/,}lib/locale/locale-archive r,
# TMP
/tmp/ r,
owner /tmp/cron-apt.*/ rw,
owner /tmp/cron-apt.*/difftemp rw,
owner /tmp/cron-apt.*/lockfile rw,
owner /tmp/cron-apt.*/initlog rw,
owner /tmp/cron-apt.*/status rw,
owner /tmp/cron-apt.*/run{log,error,mail,syslog} rw,
owner /tmp/cron-apt.*/action{log,error,mail,syslog} rw,
# file_inherit
owner /tmp/#[0-9]*[0-9] rw,
include if exists <local/cron-apt>
}

View file

@ -0,0 +1,28 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2020-2021 Mikhail Morfikov
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = /etc/cron.{hourly,daily,weekly,monthly}/apt-compat
profile cron-apt-compat @{exec_path} {
include <abstractions/base>
@{exec_path} r,
/{usr/,}bin/{,ba,da}sh rix,
/{usr/,}sbin/on_ac_power rPx,
/{usr/,}bin/apt-config rPx,
/{usr/,}lib/apt/apt.systemd.daily rPx,
/{usr/,}bin/dd rix,
/{usr/,}bin/cksum rix,
/{usr/,}bin/cut rix,
/{usr/,}bin/which{,.debianutils} rix,
/{usr/,}bin/sleep rix,
include if exists <local/cron-apt-compat>
}

View file

@ -0,0 +1,38 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2019-2021 Mikhail Morfikov
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = /etc/cron.{hourly,daily,weekly,monthly}/apt-listbugs
profile cron-apt-listbugs @{exec_path} {
include <abstractions/base>
@{exec_path} r,
/{usr/,}bin/{,ba,da}sh rix,
/{usr/,}lib/ruby/vendor_ruby/aptlistbugs/prefclean rCx -> prefclean,
@{run}/systemd/system r,
profile prefclean {
include <abstractions/base>
/{usr/,}lib/ruby/vendor_ruby/aptlistbugs/prefclean mr,
/{usr/,}bin/{,ba,da}sh rix,
/{usr/,}bin/mktemp rix,
/{usr/,}bin/rm rix,
/{usr/,}bin/cp rix,
/{usr/,}bin/date rix,
/{usr/,}bin/cat rix,
/var/spool/apt-listbugs/lastprefclean rw,
}
include if exists <local/cron-apt-listbugs>
}

View file

@ -0,0 +1,22 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2019-2021 Mikhail Morfikov
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = /etc/cron.{hourly,daily,weekly,monthly}/apt-show-versions
profile cron-apt-show-versions @{exec_path} {
include <abstractions/base>
@{exec_path} r,
/{usr/,}bin/{,ba,da}sh rix,
/{usr/,}bin/apt-show-versions rPx,
# For shell pwd
/ r,
include if exists <local/cron-apt-show-versions>
}

View file

@ -0,0 +1,30 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2020-2021 Mikhail Morfikov
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = /etc/cron.{hourly,daily,weekly,monthly}/apt-xapian-index
profile cron-apt-xapian-index @{exec_path} {
include <abstractions/base>
@{exec_path} r,
/{usr/,}bin/{,ba,da}sh rix,
/{usr/,}bin/which{,.debianutils} rix,
/{usr/,}bin/{,e}grep rix,
/{usr/,}bin/nice rix,
/{usr/,}bin/ionice rix,
/{usr/,}sbin/ r,
/{usr/,}sbin/update-apt-xapian-index rPx,
/{usr/,}sbin/on_ac_power rPx,
# For shell pwd
/ r,
include if exists <local/cron-apt-xapian-index>
}

View file

@ -0,0 +1,35 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2020-2021 Mikhail Morfikov
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = /etc/cron.{hourly,daily,weekly,monthly}/aptitude
profile cron-aptitude @{exec_path} {
include <abstractions/base>
@{exec_path} r,
/{usr/,}bin/{,ba,da}sh rix,
/{usr/,}bin/cp rix,
/{usr/,}bin/date rix,
/{usr/,}bin/basename rix,
/{usr/,}bin/which{,.debianutils} rix,
/{usr/,}bin/dirname rix,
/{usr/,}bin/rm rix,
/{usr/,}bin/mv rix,
/{usr/,}bin/savelog rix,
/{usr/,}bin/cmp rix,
/{usr/,}bin/gzip rix,
/var/lib/aptitude/pkgstates r,
/var/backups/ r,
/var/backups/* rw,
include if exists <local/cron-aptitude>
}

View file

@ -0,0 +1,48 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2019-2021 Mikhail Morfikov
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = /etc/cron.{hourly,daily,weekly,monthly}/debsums
profile cron-debsums @{exec_path} {
include <abstractions/base>
@{exec_path} mr,
/{usr/,}bin/{,ba,da}sh rix,
/{usr/,}bin/true rix,
/{usr/,}bin/logger rix,
/{usr/,}bin/sed rix,
/{usr/,}bin/{,e}grep rix,
/{usr/,}bin/ionice rix,
/{usr/,}bin/debsums rPx,
/{usr/,}bin/tee rCx -> tee,
/etc/ r,
/etc/default/debsums r,
/etc/debsums-ignore r,
# For shell pwd
/ r,
profile tee {
include <abstractions/base>
include <abstractions/consoles>
# Needed to write to /proc/self/fd/3
capability dac_override,
/{usr/,}bin/tee mr,
owner @{PROC}/@{pid}/fd/3 rw,
}
include if exists <local/cron-debsums>
}

View file

@ -0,0 +1,19 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2020-2021 Mikhail Morfikov
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = /etc/cron.{hourly,daily,weekly,monthly}/debtags
profile cron-debtags @{exec_path} {
include <abstractions/base>
@{exec_path} r,
/{usr/,}bin/{,ba,da}sh rix,
/usr/bin/debtags rPx,
include if exists <local/cron-debtags>
}

View file

@ -0,0 +1,158 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2019-2021 Mikhail Morfikov
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = /etc/cron.{hourly,daily,weekly,monthly}/popularity-contest
profile cron-popularity-contest @{exec_path} {
include <abstractions/base>
@{exec_path} r,
/{usr/,}bin/{,ba,da}sh rix,
/{usr/,}sbin/popularity-contest rPx,
/{usr/,}bin/logger rix,
/{usr/,}bin/date rix,
/{usr/,}bin/mktemp rix,
/{usr/,}bin/mkdir rix,
/{usr/,}bin/rm rix,
/{usr/,}bin/mv rix,
/{usr/,}bin/cat rix,
/{usr/,}bin/setsid rix,
# To send reports via TOR
/{usr/,}bin/torify rix,
/{usr/,}bin/torsocks rix,
/{usr/,}sbin/getcap rix,
/usr/share/popularity-contest/popcon-upload rCx -> popcon-upload,
/{usr/,}bin/gpg rCx -> gpg,
/{usr/,}sbin/runuser rCx -> runuser,
/{usr/,}bin/savelog rCx -> savelog,
/usr/share/popularity-contest/ r,
/usr/share/popularity-contest/default.conf r,
/etc/popularity-contest.conf r,
# For shell pwd
/ r,
/root/ r,
/var/log/ r,
/var/log/popularity-contest{,.new} rw,
/var/log/popularity-contest{,.new}.gpg rw,
/var/log/popularity-contest.[0-9]* rw,
# Store last successful http submission timestamp
/var/lib/popularity-contest/ rw,
/var/lib/popularity-contest/lastsub rw,
owner /tmp/tmp.*/ rw,
owner /tmp/tmp.*/random_seed w,
# file_inherit
owner /tmp/#[0-9]*[0-9] rw,
profile savelog {
include <abstractions/base>
/{usr/,}bin/savelog mr,
/{usr/,}bin/date rix,
/{usr/,}bin/basename rix,
/{usr/,}bin/which{,.debianutils} rix,
/{usr/,}bin/dirname rix,
/{usr/,}bin/rm rix,
/{usr/,}bin/mv rix,
/{usr/,}bin/touch rix,
/{usr/,}bin/gzip rix,
/{usr/,}bin/{,ba,da}sh rix,
/var/log/ r,
/var/log/popularity-contest.[0-9]*.gz rw,
/var/log/popularity-contest.[0-9]* rw,
/var/log/popularity-contest rw,
# file_inherit
owner /tmp/#[0-9]*[0-9] rw,
}
profile runuser {
include <abstractions/base>
include <abstractions/consoles>
include <abstractions/nameservice-strict>
include <abstractions/authentication>
/{usr/,}sbin/runuser mr,
/{usr/,}bin/{,ba,da}sh rix,
/{usr/,}sbin/popularity-contest rPx,
owner @{PROC}/@{pids}/loginuid r,
@{PROC}/1/limits r,
/etc/security/limits.d/ r,
/var/log/popularity-contest.new w,
# file_inherit
owner /tmp/#[0-9]*[0-9] rw,
}
profile gpg {
include <abstractions/base>
include <abstractions/nameservice-strict>
/{usr/,}bin/gpg mr,
/usr/share/popularity-contest/debian-popcon.gpg r,
/var/log/popularity-contest.new r,
/var/log/popularity-contest.new.gpg rw,
/var/log/popularity-contest.[0-9]* r,
/var/log/popularity-contest.[0-9]*.gpg rw,
owner /tmp/tmp.*/** rwkl -> /tmp/tmp.*/**,
# file_inherit
owner /tmp/#[0-9]*[0-9] rw,
}
profile popcon-upload {
include <abstractions/base>
include <abstractions/nameservice-strict>
include <abstractions/perl>
network inet dgram,
network inet6 dgram,
network inet stream,
network inet6 stream,
network netlink raw,
/usr/share/popularity-contest/popcon-upload r,
/{usr/,}bin/perl r,
/{usr/,}bin/gzip rix,
/var/log/ r,
/var/log/popularity-contest.new.gpg r,
/var/log/popularity-contest.[0-9]*.gpg r,
# file_inherit
owner /tmp/#[0-9]*[0-9] rw,
}
include if exists <local/cron-popularity-contest>
}