feat(profile): add some whonix specific profiles.

This commit is contained in:
Alexandre Pujol 2024-05-06 23:52:38 +01:00
parent c5ed997b6d
commit eeb990a934
Failed to generate hash of commit
4 changed files with 119 additions and 0 deletions

View file

@ -0,0 +1,47 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = @{bin}/anondate{,-get,-set}
profile anondate @{exec_path} {
include <abstractions/base>
include <abstractions/consoles>
include <abstractions/nameservice-strict>
include <abstractions/python>
@{exec_path} mrix,
@{sh_path} rix,
@{bin}/cat rix,
@{bin}/cp rix,
@{bin}/date rix,
@{bin}/grep rix,
@{bin}/minimum-unixtime-show rix,
@{bin}/rm rix,
@{bin}/systemd-cat rPx,
@{bin}/tee rix,
@{bin}/timeout rix,
@{bin}/tor-circuit-established-check rix,
@{bin}/touch rix,
@{bin}/whoami rix,
@{lib}/helper-scripts/{,**} r,
@{lib}/helper-scripts/tor_bootstrap_check.py rPx,
@{lib}/helper-scripts/tor_consensus_valid-after.py rPx,
/usr/share/timesanitycheck/{,**} r,
/var/lib/sdwdate/time-replay-protection-utc-unixtime r,
owner /tmp/tmp.@{rand10} rw,
@{run}/tor/control.authcookie r,
@{run}/tor/log r,
owner @{run}/sdwdate/* rw,
include if exists <local/anondate>
}

View file

@ -0,0 +1,24 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = @{lib}/msgcollector/msgdispatcher_delete_wrapper
profile msgdispatcher-delete @{exec_path} {
include <abstractions/base>
include <abstractions/consoles>
capability dac_read_search,
@{exec_path} mr,
@{sh_path} rix,
@{bin}/rm rix,
@{run}/msgcollector/user/* rw,
include if exists <local/msgdispatcher-delete>
}

View file

@ -0,0 +1,23 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = @{lib}/helper-scripts/tor_bootstrap_check.py
profile tor-bootstrap-check @{exec_path} {
include <abstractions/base>
include <abstractions/python>
@{exec_path} mr,
@{lib}/helper-scripts/{,**} r,
owner /tmp/tmp.@{rand10} rw,
@{run}/tor/control.authcookie r,
include if exists <local/tor-bootstrap-check>
}

View file

@ -0,0 +1,25 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2024 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = @{lib}/helper-scripts/tor_consensus_valid-after.py
profile tor-consensus-valid-after @{exec_path} {
include <abstractions/base>
include <abstractions/nameservice-strict>
include <abstractions/python>
@{exec_path} mr,
@{lib}/helper-scripts/{,**} r,
@{run}/tor/control.authcookie r,
owner @{run}/sdwdate/* rw,
owner /tmp/tmp.@{rand10} rw,
include if exists <local/tor-consensus-valid-after>
}