-
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PACKAGING] Provides a dedicated AppArmor profile
Co-Authored-By: Alexandre Pujol <[email protected]> Co-Authored-By: Michael Bromilow <[email protected]>
- Loading branch information
1 parent
121b1cc
commit 55c2c20
Showing
7 changed files
with
159 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
# Archey4 AppArmor profile | ||
# Copyright (C) 2023-2024 - Samuel Forestier <[email protected]> | ||
|
||
# /!\ DO NOT MODIFY THIS FILE /!\ | ||
# Please edit local profile extension (/etc/apparmor.d/local/usr.bin.archey4). | ||
|
||
abi <abi/3.0>, | ||
|
||
include <tunables/global> | ||
|
||
profile archey4 /usr/{,local/}bin/archey{,4} { | ||
include <abstractions/base> | ||
include <abstractions/consoles> | ||
include <abstractions/python> | ||
include <abstractions/ssl_certs> | ||
|
||
/usr/{,local/}bin/archey{,4} r, | ||
|
||
# configuration files | ||
owner @{HOME}/.config/archey4/*.json r, | ||
/etc/archey4/*.json r, | ||
|
||
# required in order to kill sub-processes in timeout | ||
capability kill, | ||
signal (send), | ||
|
||
# allow running processes listing through ps | ||
/{,usr/}bin/ps PUx, | ||
|
||
# allow distro to parse system data sources | ||
/usr/lib/os-release r, | ||
/etc/*[-_]{release,version} r, | ||
/{,usr/}bin/lsb_release PUx, | ||
/{,usr/}bin/uname PUx, | ||
|
||
# allow screenshot tools execution | ||
/{,usr/}bin/escrotum PUx, | ||
/{,usr/}bin/flameshot PUx, | ||
/{,usr/}bin/gnome-screenshot PUx, | ||
/{,usr/}bin/grim PUx, | ||
/{,usr/}bin/import PUx, | ||
/{,usr/}bin/maim PUx, | ||
/{,usr/}bin/scrot PUx, | ||
/{,usr/}bin/shutter PUx, | ||
/{,usr/}bin/spectacle PUx, | ||
/{,usr/}bin/xfce4-screenshoter PUx, | ||
|
||
# [CPU] entry | ||
/{,usr/}bin/lscpu PUx, | ||
|
||
# [Disk] entry | ||
/{,usr/}bin/df PUx, | ||
|
||
# [GPU] entry | ||
/{,usr/}bin/lspci PUx, | ||
|
||
# [Hostname] entry | ||
/etc/hostname r, | ||
|
||
# [Load Average] entry | ||
@{PROC}/loadavg r, | ||
|
||
# [Model] entry | ||
@{sys}/devices/virtual/dmi/id/* r, | ||
/{,usr/}bin/systemd-detect-virt PUx, | ||
/{,usr/}{,s}bin/virt-what PUx, | ||
/{,usr/}bin/getprop PUx, | ||
|
||
# [Packages] entry | ||
/{,usr/}bin/ls rix, | ||
/{,usr/}bin/apk PUx, | ||
/{,usr/}bin/dnf PUx, | ||
/{,usr/}bin/dpkg PUx, | ||
/{,usr/}bin/emerge PUx, | ||
/{,usr/}bin/nix-env PUx, | ||
/{,usr/}bin/pacman PUx, | ||
/{,usr/}bin/pacstall PUx, | ||
/{,usr/}bin/pkgin PUx, | ||
/{,usr/}bin/port PUx, | ||
/{,usr/}bin/rpm PUx, | ||
/{,usr/}bin/yum PUx, | ||
/{,usr/}bin/zypper PUx, | ||
|
||
# [RAM] entry | ||
/{,usr/}bin/free rix, | ||
|
||
# [Temperature] entry | ||
@{sys}/devices/thermal/thermal_zone[0-9]*/temp r, | ||
/{,usr/}bin/sensors PUx, | ||
/{,opt/vc/,usr/}bin/vcgencmd PUx, | ||
|
||
# [Uptime] entry | ||
@{PROC}/uptime r, | ||
/{,usr/}bin/uptime rix, | ||
|
||
# [User] & [Shell] entries | ||
/{,usr/}bin/getent rix, | ||
|
||
# [WAN IP] entry (and potentially [Kernel]) | ||
/{,usr/}bin/dig PUx, | ||
network inet stream, # urllib (HTTP/IP) | ||
network inet6 stream, # urllib (HTTP/IPv6) | ||
|
||
# [Window Manager] entry | ||
/{,usr/}bin/wmctrl PUx, | ||
|
||
# allow profile extension (e.g. for user-defined [Custom] entries) | ||
include if exists <local/usr.bin.archey4> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
|
||
# Handles AppArmor profile (see dh_apparmor). | ||
if ! [ -e /etc/apparmor.d/usr.bin.archey4 ] ; then | ||
rm -f /etc/apparmor.d/disable/usr.bin.archey4 || true | ||
rm -f /etc/apparmor.d/force-complain/usr.bin.archey4 || true | ||
rm -f /etc/apparmor.d/local/usr.bin.archey4 || true | ||
rm -f /var/cache/apparmor/*/usr.bin.archey4 || true | ||
rmdir /etc/apparmor.d/disable 2>/dev/null || true | ||
rmdir /etc/apparmor.d/local 2>/dev/null || true | ||
rmdir /etc/apparmor.d 2>/dev/null || true | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters