2021-04-01 17:17:47 +02:00
|
|
|
# apparmor.d - Full set of apparmor profiles
|
|
|
|
# Copyright (C) 2015-2020 Mikhail Morfikov
|
2024-02-07 00:16:21 +01:00
|
|
|
# Copyright (C) 2021-2024 Alexandre Pujol <alexandre@pujol.io>
|
2021-04-01 17:17:47 +02:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-only
|
2020-09-12 17:19:23 +02:00
|
|
|
|
2020-12-10 22:33:39 +01:00
|
|
|
abi <abi/3.0>,
|
2020-09-12 17:19:23 +02:00
|
|
|
|
2020-12-10 22:33:39 +01:00
|
|
|
include <tunables/global>
|
2020-09-12 17:19:23 +02:00
|
|
|
|
2023-07-09 15:23:22 +02:00
|
|
|
@{exec_path} = @{bin}/conky
|
2020-09-12 17:19:23 +02:00
|
|
|
profile conky @{exec_path} {
|
2020-12-10 22:33:39 +01:00
|
|
|
include <abstractions/base>
|
|
|
|
include <abstractions/consoles>
|
|
|
|
include <abstractions/freedesktop.org>
|
|
|
|
include <abstractions/fonts>
|
|
|
|
include <abstractions/fontconfig-cache-read>
|
|
|
|
include <abstractions/nameservice-strict>
|
|
|
|
include <abstractions/ssl_certs>
|
|
|
|
|
2021-12-08 12:59:46 +01:00
|
|
|
# To get the external IP address
|
|
|
|
# For samba share mounts
|
2020-12-10 22:33:39 +01:00
|
|
|
network inet dgram,
|
|
|
|
network inet6 dgram,
|
2021-12-08 12:59:46 +01:00
|
|
|
network inet stream,
|
|
|
|
network inet6 stream,
|
2020-09-12 17:19:23 +02:00
|
|
|
|
2021-08-18 11:05:43 +02:00
|
|
|
# For dig
|
|
|
|
#network inet stream,
|
|
|
|
#network inet6 stream,
|
|
|
|
#network netlink raw,
|
|
|
|
|
2020-09-12 17:19:23 +02:00
|
|
|
@{exec_path} mr,
|
|
|
|
|
|
|
|
# Needed tools to render conky output
|
2024-02-11 15:34:46 +01:00
|
|
|
@{sh_path} rix,
|
2023-07-09 15:23:22 +02:00
|
|
|
@{bin}/cp rix,
|
|
|
|
@{bin}/rm rix,
|
|
|
|
@{bin}/sed rix,
|
|
|
|
@{bin}/{,e}grep rix,
|
|
|
|
@{bin}/{m,g,}awk rix,
|
|
|
|
@{bin}/tr rix,
|
|
|
|
@{bin}/uniq rix,
|
|
|
|
@{bin}/head rix,
|
|
|
|
@{bin}/cut rix,
|
|
|
|
@{bin}/date rix,
|
|
|
|
@{bin}/cat rix,
|
|
|
|
@{bin}/wc rix,
|
|
|
|
@{bin}/sed rix,
|
|
|
|
@{bin}/sleep rix,
|
2020-09-12 17:19:23 +02:00
|
|
|
|
2021-08-18 11:05:43 +02:00
|
|
|
# For external IP address
|
2023-07-09 15:23:22 +02:00
|
|
|
#@{bin}/dig rix,
|
2021-08-18 11:05:43 +02:00
|
|
|
#owner @{PROC}/@{pid}/task/@{tid}/comm rw,
|
|
|
|
|
2020-09-12 17:19:23 +02:00
|
|
|
# To remove the following error:
|
|
|
|
# .conky/Accuweather_conky_script/accuweather: line 917: /usr/bin/pkill: Permission denied
|
2023-07-09 15:23:22 +02:00
|
|
|
@{bin}/pgrep rix,
|
2020-09-12 17:19:23 +02:00
|
|
|
@{PROC}/sys/kernel/osrelease r,
|
|
|
|
|
|
|
|
# Browsers to fetch remote content
|
2023-07-09 15:23:22 +02:00
|
|
|
@{bin}/wget rCx -> browse,
|
|
|
|
@{bin}/curl rCx -> browse,
|
|
|
|
@{bin}/lynx rCx -> browse,
|
|
|
|
@{bin}/w3m rCx -> browse,
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
# Conky home files
|
|
|
|
owner @{HOME}/ r,
|
|
|
|
owner @{HOME}/.conky/ r,
|
|
|
|
owner @{HOME}/.conky/** rw,
|
|
|
|
|
|
|
|
# Display images (graphic) inside of the conky window
|
2023-07-09 15:23:22 +02:00
|
|
|
@{lib}/@{multiarch}/imlib2/loaders/*.so mr,
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
# Get the PRETTY_NAME name from /etc/os-release link
|
|
|
|
/etc/ r,
|
|
|
|
|
|
|
|
# Get the kernel version and its architecture via "uname -r"
|
2023-07-09 15:23:22 +02:00
|
|
|
@{bin}/uname rix,
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
# Display machine's hostname
|
|
|
|
/etc/hostname r,
|
|
|
|
|
|
|
|
# Display machine's uptime
|
|
|
|
@{PROC}/uptime r,
|
|
|
|
|
|
|
|
# Get the number of CPU cores
|
|
|
|
@{sys}/devices/system/cpu/present r,
|
|
|
|
|
|
|
|
# Get the current frequency of the CPU
|
2023-08-18 18:09:53 +02:00
|
|
|
@{sys}/devices/system/cpu/cpufreq/policy@{int}/scaling_cur_freq r,
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
# Get load average values for 1, 5 and 15 minutes
|
|
|
|
@{PROC}/loadavg r,
|
|
|
|
|
|
|
|
# Display processes' status
|
|
|
|
@{PROC}/ r,
|
|
|
|
# Get the PID value
|
|
|
|
@{PROC}/@{pid}/stat r,
|
|
|
|
# Get the name, %CPU and %RAM values
|
|
|
|
@{PROC}/@{pid}/cmdline r,
|
|
|
|
owner @{PROC}/@{pid}/io r,
|
|
|
|
# Not needed
|
|
|
|
deny capability sys_ptrace,
|
|
|
|
deny ptrace (trace, read),
|
|
|
|
|
|
|
|
# Display the hard disk model name
|
2023-12-08 18:46:05 +01:00
|
|
|
@{sys}/devices/@{pci}/{usb,ata}[0-9]/**/model r,
|
2021-12-01 00:18:38 +01:00
|
|
|
@{sys}/block/{s,v}d[a-z]/device/model r,
|
2020-09-12 17:19:23 +02:00
|
|
|
# Display the disk write/read speed
|
|
|
|
@{PROC}/diskstats r,
|
|
|
|
# Get the mount point names
|
|
|
|
owner @{PROC}/@{pid}/mounts r,
|
|
|
|
# /etc/mtab r,
|
|
|
|
|
|
|
|
# Display WiFi network status, which includes the following:
|
|
|
|
# ESSID, AP's MAC, bitrate, signal strength, IP address and down/up speed
|
|
|
|
@{PROC}/@{pid}/net/dev r,
|
|
|
|
# Display IPv6 address of an interface
|
|
|
|
@{PROC}/@{pid}/net/if_inet6 r,
|
|
|
|
|
|
|
|
# Display the number of active TCP/TCP6 connections
|
|
|
|
@{PROC}/@{pid}/net/tcp{,6} r,
|
|
|
|
|
|
|
|
# Xserver auth cookie for clients
|
|
|
|
owner @{HOME}/.Xauthority r,
|
|
|
|
|
2023-08-17 21:01:53 +02:00
|
|
|
/dev/shm/#@{int} rw,
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
# Temperatures and Fans
|
2023-07-09 15:23:22 +02:00
|
|
|
@{bin}/sensors rPUx,
|
2024-02-26 22:10:53 +01:00
|
|
|
@{sys}/devices/**/hwmon@{int}/temp@{int}_input r,
|
|
|
|
@{sys}/devices/**/hwmon/hwmon@{int}/temp@{int}_input r,
|
2020-09-12 17:19:23 +02:00
|
|
|
@{sys}/class/hwmon/ r,
|
|
|
|
@{PROC}/acpi/ibm/fan r,
|
|
|
|
|
|
|
|
# Display network data transfer status
|
2023-07-09 15:23:22 +02:00
|
|
|
@{bin}/vnstat rPUx,
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
# Display Secure Boot status
|
2023-07-09 15:23:22 +02:00
|
|
|
@{bin}/mokutil rPUx,
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
@{PROC}/@{pid}/net/route r,
|
|
|
|
|
2024-02-26 22:10:53 +01:00
|
|
|
owner /tmp/xauth-@{int}-_[0-9] r,
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
/usr/share/X11/XErrorDB r,
|
|
|
|
|
|
|
|
# file_inherit
|
2023-08-18 18:09:53 +02:00
|
|
|
owner /dev/tty@{int} rw,
|
2020-09-12 17:19:23 +02:00
|
|
|
owner @{HOME}/.xsession-errors w,
|
|
|
|
|
|
|
|
|
|
|
|
profile browse {
|
2020-12-10 22:33:39 +01:00
|
|
|
include <abstractions/base>
|
|
|
|
include <abstractions/consoles>
|
|
|
|
include <abstractions/nameservice-strict>
|
|
|
|
include <abstractions/ssl_certs>
|
|
|
|
|
2022-02-27 02:22:35 +01:00
|
|
|
network inet dgram,
|
|
|
|
network inet6 dgram,
|
|
|
|
network inet stream,
|
|
|
|
network inet6 stream,
|
|
|
|
network netlink raw,
|
2020-09-12 17:19:23 +02:00
|
|
|
|
2023-07-09 15:23:22 +02:00
|
|
|
@{bin}/wget mr,
|
|
|
|
@{bin}/curl mr,
|
|
|
|
@{bin}/lynx mr,
|
|
|
|
@{bin}/w3m mr,
|
2020-09-12 17:19:23 +02:00
|
|
|
|
2024-02-11 15:34:46 +01:00
|
|
|
@{sh_path} rix,
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
/etc/mime.types r,
|
|
|
|
/etc/mailcap r,
|
|
|
|
|
|
|
|
/etc/lynx/* r,
|
|
|
|
/etc/wgetrc r,
|
|
|
|
/etc/w3m/config r,
|
|
|
|
/etc/w3m/mailcap r,
|
|
|
|
|
|
|
|
owner @{HOME}/.wget-hsts rwk,
|
|
|
|
owner @{HOME}/.w3m/ rw,
|
|
|
|
owner @{HOME}/.w3m/** rw,
|
|
|
|
|
|
|
|
owner @{HOME}/.conky/** rw,
|
|
|
|
|
|
|
|
/usr/share/publicsuffix/public_suffix_list.* r,
|
|
|
|
|
|
|
|
# file_inherit
|
2023-08-18 18:09:53 +02:00
|
|
|
owner /dev/tty@{int} rw,
|
2020-09-12 17:19:23 +02:00
|
|
|
deny @{PROC}/@{pids}/net/dev r,
|
|
|
|
deny @{PROC}/@{pids}/net/tcp r,
|
|
|
|
deny @{PROC}/@{pids}/net/tcp6 r,
|
|
|
|
deny @{PROC}/@{pids}/net/if_inet6 r,
|
|
|
|
deny @{PROC}/@{pids}/stat r,
|
|
|
|
deny @{PROC}/diskstats r,
|
|
|
|
deny @{PROC}/uptime r,
|
|
|
|
deny @{PROC}/loadavg r,
|
|
|
|
deny @{PROC}/@{pids}/cmdline r,
|
|
|
|
deny @{PROC}/@{pids}/io r,
|
|
|
|
deny @{PROC}/@{pid}/net/route r,
|
|
|
|
deny @{sys}/devices/**/hwmon/**/temp*_input r,
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2020-12-10 22:33:39 +01:00
|
|
|
include if exists <local/conky>
|
2020-09-12 17:19:23 +02:00
|
|
|
}
|