225 lines
No EOL
7.2 KiB
Text
225 lines
No EOL
7.2 KiB
Text
# apparmor.d - Full set of apparmor profiles
|
|
# Copyright (C) 2022-2024 Alexandre Pujol <alexandre@pujol.io>
|
|
# SPDX-License-Identifier: GPL-2.0-only
|
|
|
|
# Default profile for steam games
|
|
|
|
# TODO:
|
|
# Split this profile in three:
|
|
# - steam-game-native for native linux games
|
|
# - steam-runtime for all runtime related task up to the creation of the sandbox
|
|
# - steam-game-proton for the sandboxed proton games
|
|
#
|
|
# Tasks:
|
|
# - AppArmor supports for {*^} regex, or find an alternative
|
|
# - AppArmor supports change profile from pivot_root
|
|
# - Stack steam//&game to bypass no-new-privs issue
|
|
#
|
|
# The current version of this profile is not very useful as it is very similar
|
|
# to the main steam profile.
|
|
|
|
abi <abi/3.0>,
|
|
|
|
include <tunables/global>
|
|
|
|
@{share_dirs} = @{user_share_dirs}/Steam
|
|
@{lib_dirs} = @{share_dirs}/ubuntu@{int}_{32,64}
|
|
@{runtime_dirs} = @{share_dirs}/steamapps/common/SteamLinuxRuntime_sniper
|
|
|
|
@{exec_path} = @{share_dirs}/steamapps/common/*/**
|
|
@{exec_path} += @{lib_dirs}/steam-runtime-sniper/*entry-point
|
|
profile steam-game @{exec_path} flags=(attach_disconnected) {
|
|
include <abstractions/base>
|
|
include <abstractions/audio-client>
|
|
include <abstractions/common/bwrap>
|
|
include <abstractions/desktop>
|
|
include <abstractions/devices-usb>
|
|
include <abstractions/fontconfig-cache-write>
|
|
include <abstractions/graphics>
|
|
include <abstractions/nameservice-strict>
|
|
include <abstractions/python>
|
|
include <abstractions/ssl_certs>
|
|
|
|
capability dac_override,
|
|
capability dac_read_search,
|
|
|
|
network inet dgram,
|
|
network inet6 dgram,
|
|
network inet stream,
|
|
network inet6 stream,
|
|
network netlink raw,
|
|
|
|
signal (receive) peer=steam,
|
|
|
|
unix (receive) type=stream,
|
|
|
|
@{exec_path} mrix,
|
|
|
|
@{sh_path} rix,
|
|
@{bin}/bwrap rix,
|
|
@{bin}/env rix,
|
|
@{bin}/getopt rix,
|
|
@{bin}/gzip rix,
|
|
@{bin}/localedef rix,
|
|
@{bin}/python3.@{int} rix,
|
|
@{bin}/readlink rix,
|
|
@{bin}/steam-runtime-launcher-interface-* rix,
|
|
@{bin}/steam-runtime-system-info rix,
|
|
@{bin}/timeout rix,
|
|
@{bin}/true rix,
|
|
@{bin}/uname rix,
|
|
@{bin}/xdg-open rPx,
|
|
|
|
@{lib}/pressure-vessel/from-host/@{bin}/* rix,
|
|
@{lib}/pressure-vessel/from-host/@{lib}/** rix,
|
|
@{lib}/steam-runtime-tools*/* mrix,
|
|
|
|
@{lib_dirs}/{,**} r,
|
|
@{lib_dirs}/**.so* mr,
|
|
@{lib_dirs}/reaper rix,
|
|
@{lib_dirs}/steam-launch-wrapper rm,
|
|
@{lib_dirs}/steam-runtime/@{lib}/** mrix,
|
|
|
|
@{runtime_dirs}/pressure-vessel/@{bin}/ r,
|
|
@{runtime_dirs}/pressure-vessel/@{bin}/* rix,
|
|
@{runtime_dirs}/pressure-vessel/@{lib}/ r,
|
|
@{runtime_dirs}/pressure-vessel/@{lib}/** mrix,
|
|
@{runtime_dirs}/run rix,
|
|
|
|
@{share_dirs}/@{bin}/ r,
|
|
@{share_dirs}/@{bin}/* mr,
|
|
@{share_dirs}/d3ddriverquery64.dxvk-cache rw,
|
|
@{share_dirs}/legacycompat/ r,
|
|
@{share_dirs}/legacycompat/** mr,
|
|
@{share_dirs}/linux{32,64}/ r,
|
|
@{share_dirs}/linux{32,64}/**.so* mr,
|
|
@{share_dirs}/standalone_installscript_progress_@{int}.vdf rw,
|
|
@{share_dirs}/steamapps/common/*/* mr,
|
|
@{share_dirs}/steamapps/common/Proton*/ r,
|
|
@{share_dirs}/steamapps/common/Proton*/files/@{bin}/* mrix,
|
|
@{share_dirs}/steamapps/common/Proton*/files/@{lib}/** mrix,
|
|
@{share_dirs}/steamapps/common/Proton*/proton rix,
|
|
@{share_dirs}/steamapps/compatdata/@{int}/pfx/**.dll rm,
|
|
|
|
@{user_games_dirs}/*/* mr,
|
|
@{user_games_dirs}/*/**.dll mr,
|
|
|
|
@{run}/host/usr/bin/ldconfig rix,
|
|
@{run}/host/usr/lib{,32,64}/**.so* rm,
|
|
@{run}/host/usr/bin/localedef rix,
|
|
|
|
/usr/share/terminfo/** r,
|
|
|
|
/etc/machine-id r,
|
|
/etc/udev/udev.conf r,
|
|
/var/lib/dbus/machine-id r,
|
|
|
|
/ r,
|
|
/{usr/,}{local/,} r,
|
|
/{usr/,}{local/,}lib{,32,64}/ r,
|
|
/bindfile@{rand6} rw,
|
|
/home/ r,
|
|
/tmp/ r,
|
|
|
|
owner /var/pressure-vessel/** rw,
|
|
owner /var/cache/ldconfig/aux-cache* rw,
|
|
|
|
owner @{HOME}/ r,
|
|
owner @{HOME}/.steam/steam.pid r,
|
|
owner @{HOME}/.steam/steam.pipe r,
|
|
|
|
owner @{user_games_dirs}/{,*/} r,
|
|
owner @{user_games_dirs}/*/{,**} rwkl,
|
|
|
|
owner @{user_config_dirs}/unity3d/{,**} rwk,
|
|
|
|
owner @{share_dirs}/ r,
|
|
owner @{share_dirs}/* r,
|
|
owner @{share_dirs}/*log* rw,
|
|
owner @{share_dirs}/config/config.vdf* rw,
|
|
owner @{share_dirs}/logs/{,*} rw,
|
|
owner @{share_dirs}/shader_cache_temp*/fozpipelinesv*/{,**} rw,
|
|
owner @{share_dirs}/steamapps/ r,
|
|
owner @{share_dirs}/steamapps/common/ r,
|
|
owner @{share_dirs}/steamapps/common/*/ r,
|
|
owner @{share_dirs}/steamapps/common/*/** rwkl,
|
|
owner @{share_dirs}/steamapps/common/Proton*/files/share/{,**} r,
|
|
owner @{share_dirs}/steamapps/compatdata/{,**} rwk,
|
|
owner @{share_dirs}/steamapps/shadercache/{,**} rwk,
|
|
owner @{share_dirs}/userdata/**/remotecache.vdf rw,
|
|
|
|
@{run}/host/ r,
|
|
@{run}/host/container-manager r,
|
|
@{run}/host/fonts/{,**} r,
|
|
@{run}/host/share/{,**} r,
|
|
@{run}/host/usr/{,**} r,
|
|
owner @{run}/pressure-vessel/{,**} rw,
|
|
owner @{run}/user/@{uid}/ r,
|
|
owner @{run}/user/@{uid}/orcexec.* mrw, # gstreamer
|
|
|
|
owner /dev/shm/#@{int} rw,
|
|
owner /dev/shm/mono.* rw,
|
|
owner /dev/shm/u@{uid}-Shm_@{hex} rw,
|
|
owner /dev/shm/u@{uid}-ValveIPCSharedObj-Steam rwk,
|
|
owner /dev/shm/ValveIPCSHM_@{uid} rw,
|
|
owner /dev/shm/wine-*-fsync rw,
|
|
|
|
owner @{tmp}/ r,
|
|
owner @{tmp}/.wine-@{int}/ rw,
|
|
owner @{tmp}/.wine-@{int}/** rwk,
|
|
owner @{tmp}/.wine-@{uid}/server-*/* rwk,
|
|
owner @{tmp}/#@{int} rw,
|
|
owner @{tmp}/CASESENSITIVETEST@{hex32} rw,
|
|
owner @{tmp}/miles_image_* mr,
|
|
owner @{tmp}/pressure-vessel-*/{,**} rwl,
|
|
owner @{tmp}/vdpau-drivers-@{rand6}/{,**} rw,
|
|
|
|
@{run}/udev/data/+input:input@{int} r, # for mouse, keyboard, touchpad
|
|
|
|
@{run}/udev/data/c13:@{int} r, # for /dev/input/*
|
|
@{run}/udev/data/c116:@{int} r, # for ALSA
|
|
@{run}/udev/data/c@{dynamic}:@{int} r, # For dynamic assignment range 234 to 254, 384 to 511
|
|
|
|
@{sys}/ r,
|
|
@{sys}/bus/ r,
|
|
@{sys}/class/ r,
|
|
@{sys}/class/hidraw/ r,
|
|
@{sys}/class/input/ r,
|
|
@{sys}/devices/**/input@{int}/ r,
|
|
@{sys}/devices/**/input@{int}/**/{vendor,product} r,
|
|
@{sys}/devices/**/input@{int}/capabilities/* r,
|
|
@{sys}/devices/**/input/input@{int}/ r,
|
|
@{sys}/devices/**/uevent r,
|
|
@{sys}/devices/@{pci}/sound/card@{int}/** r,
|
|
@{sys}/devices/@{pci}/usb@{int}/{manufacturer,product,bcdDevice,bInterfaceNumber} r,
|
|
@{sys}/devices/system/clocksource/clocksource@{int}/current_clocksource r,
|
|
@{sys}/devices/system/cpu/** r,
|
|
@{sys}/devices/system/node/node[0-9]/cpumap r,
|
|
@{sys}/devices/system/node/online r,
|
|
@{sys}/devices/virtual/dmi/id/* r,
|
|
@{sys}/kernel/ r,
|
|
|
|
@{PROC}/@{pids}/net/dev r,
|
|
@{PROC}/@{pids}/net/route r,
|
|
@{PROC}/sys/net/core/bpf_jit_enable r,
|
|
@{PROC}/uptime r,
|
|
@{PROC}/version r,
|
|
owner @{PROC}/@{pid}/cmdline r,
|
|
owner @{PROC}/@{pid}/fd/ r,
|
|
owner @{PROC}/@{pid}/mounts r,
|
|
owner @{PROC}/@{pid}/pagemap r,
|
|
owner @{PROC}/@{pid}/stat r,
|
|
owner @{PROC}/@{pid}/task/ r,
|
|
owner @{PROC}/@{pid}/task/@{tid}/comm rw,
|
|
owner @{PROC}/@{pid}/task/@{tid}/stat r,
|
|
|
|
/dev/hidraw@{int} rw,
|
|
/dev/input/ r,
|
|
/dev/input/* rw,
|
|
/dev/tty rw,
|
|
/dev/uinput rw,
|
|
|
|
deny owner @{user_share_dirs}/gvfs-metadata/{,*} r,
|
|
|
|
include if exists <local/steam-game>
|
|
} |