mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-03-22 12:42:21 +01:00
Remove overly permissive blanket `capability,` rule (grants ALL Linux capabilities) from 107 addon AppArmor profiles. Replace with only the specific capabilities each addon needs based on its config.yaml `privileged` field. Base capabilities for all addons: setuid, setgid, chown, fowner, dac_override Additional capabilities mapped from config.yaml privileged list: - SYS_ADMIN -> sys_admin - DAC_READ_SEARCH -> dac_read_search - NET_ADMIN -> net_admin - NET_RAW -> net_raw - SYS_RAWIO -> sys_rawio - SYS_TIME -> sys_time - SYS_RESOURCE -> sys_resource Addons with full_access: true (portainer_agent) retain blanket capability. Co-authored-by: alexbelgium <44178713+alexbelgium@users.noreply.github.com>
91 lines
1.8 KiB
Plaintext
91 lines
1.8 KiB
Plaintext
#include <tunables/global>
|
|
|
|
profile omni-tools flags=(attach_disconnected,mediate_deleted) {
|
|
#include <abstractions/base>
|
|
|
|
# Capabilities
|
|
capability chown,
|
|
capability dac_override,
|
|
capability fowner,
|
|
capability setgid,
|
|
capability setuid,
|
|
file,
|
|
signal (send) set=(kill,term,int,hup,cont),
|
|
|
|
# S6-Overlay
|
|
/init ix,
|
|
/bin/** ix,
|
|
/usr/bin/** ix,
|
|
/run/{s6,s6-rc*,service}/** ix,
|
|
/package/** ix,
|
|
/command/** ix,
|
|
/etc/services.d/** rwix,
|
|
/etc/cont-init.d/** rwix,
|
|
/etc/cont-finish.d/** rwix,
|
|
/run/{,**} rwk,
|
|
/dev/tty rw,
|
|
|
|
# Bashio
|
|
/usr/lib/bashio/** ix,
|
|
/tmp/** rwk,
|
|
|
|
# Access to options.json and other files within your addon
|
|
/data/** rw,
|
|
|
|
# Start new profile for service
|
|
/usr/bin/omni-tools cx -> omni-tools,
|
|
|
|
profile omni-tools flags=(attach_disconnected,mediate_deleted) {
|
|
#include <abstractions/base>
|
|
|
|
# Receive signals from S6-Overlay
|
|
signal (receive) set=(kill,term,int,hup,cont),
|
|
|
|
# Access to options.json and other files within your addon
|
|
/data/** rw,
|
|
/usr/bin/omni-tools r,
|
|
|
|
# Access to mapped volumes
|
|
/share/** rw,
|
|
/config/** rw,
|
|
|
|
# Network access
|
|
network inet dgram,
|
|
network inet stream,
|
|
network inet6 dgram,
|
|
network inet6 stream,
|
|
network netlink raw,
|
|
|
|
# System directories
|
|
/etc/passwd r,
|
|
/etc/group r,
|
|
/etc/nsswitch.conf r,
|
|
/etc/hosts r,
|
|
/etc/resolv.conf r,
|
|
/etc/ssl/openssl.cnf r,
|
|
/etc/ssl/certs/ r,
|
|
/etc/ssl/certs/** r,
|
|
/usr/share/ca-certificates/ r,
|
|
/usr/share/ca-certificates/** r,
|
|
|
|
# Library access
|
|
/lib/** rm,
|
|
/usr/lib/** rm,
|
|
/usr/local/lib/** rm,
|
|
|
|
# Proc and sys access
|
|
/proc/ r,
|
|
/proc/** r,
|
|
/sys/fs/cgroup/** r,
|
|
|
|
# Tmp access
|
|
/tmp/** rwk,
|
|
/var/tmp/** rwk,
|
|
|
|
# Device access
|
|
/dev/null rw,
|
|
/dev/zero rw,
|
|
/dev/random r,
|
|
/dev/urandom r,
|
|
}
|
|
} |