feat(profile): tweak the new msedge profiles a bit.

This commit is contained in:
Alexandre Pujol 2024-05-01 12:11:43 +01:00
parent fd590e9199
commit a1d6d318cc
No known key found for this signature in database
GPG key ID: C5469996F0DF68EC
4 changed files with 10 additions and 6 deletions

View file

@ -0,0 +1,41 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2022-2024 Alexandre Pujol <alexandre@pujol.io>
# Copyright (C) 2022-2024 Jose Maldonado <josemald89@gmail.com>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{name} = msedge{,-beta,-dev}
@{domain} = com.microsoft.Edge
@{lib_dirs} = /opt/microsoft/@{name}
@{config_dirs} = @{user_config_dirs}/microsoft-edge{,-beta,-dev}
@{cache_dirs} = @{user_cache_dirs}/microsoft-edge{,-beta,-dev}
@{exec_path} = @{lib_dirs}/@{name}
profile msedge @{exec_path} {
include <abstractions/base>
include <abstractions/app/chromium>
@{exec_path} mrix,
@{bin}/man rPUx, # For "chrome --help"
@{lib_dirs}/xdg-mime rix, #-> xdg-mime,
@{lib_dirs}/xdg-settings rix, #-> xdg-settings,
@{lib_dirs}/microsoft-edge{,beta,-dev} rPx,
@{lib_dirs}/msedge_crashpad_handler rPx,
@{lib_dirs}/*.so* mr,
@{lib_dirs}/WidevineCdm/_platform_specific/linux_*/libwidevinecdm.so mr,
owner @{user_cache_dirs}/Microsoft/ rw,
owner @{user_cache_dirs}/Microsoft/** rwk,
owner /tmp/.ses rw,
owner /tmp/cv_debug.log rw,
include if exists <local/msedge>
}

View file

@ -0,0 +1,36 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2022-2024 Alexandre Pujol <alexandre@pujol.io>
# Copyright (C) 2022-2024 Jose Maldonado <josemald89@gmail.com>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{lib_dirs} = /opt/microsoft/msedge{,-beta,-dev}
@{config_dirs} = @{user_config_dirs}/microsoft-edge{,-beta,-dev}
@{exec_path} = @{lib_dirs}/msedge_crashpad_handler
profile msedge-crashpad-handler @{exec_path} {
include <abstractions/base>
capability sys_ptrace,
ptrace peer=msedge,
signal (send) peer=msedge,
@{exec_path} mrix,
owner "@{config_dirs}/Crash Reports/**" rwk,
@{PROC}/sys/kernel/yama/ptrace_scope r,
owner @{PROC}/@{pid}/fd/ r,
owner @{PROC}/@{pids}/mem r,
owner @{PROC}/@{pids}/stat r,
owner @{PROC}/@{pids}/task/ r,
@{sys}/devices/system/cpu/cpufreq/policy@{int}/scaling_cur_freq r,
@{sys}/devices/system/cpu/cpufreq/policy@{int}/scaling_max_freq r,
include if exists <local/msedge-crashpad-handler>
}

View file

@ -0,0 +1,32 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2022-2024 Alexandre Pujol <alexandre@pujol.io>
# Copyright (C) 2022-2024 Jose Maldonado <josemald89@gmail.com>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{lib_dirs} = /opt/microsoft/msedge{,-beta,-dev}
@{exec_path} = @{lib_dirs}/msedge-sandbox
profile msedge-sandbox @{exec_path} {
include <abstractions/base>
capability setgid,
capability setuid,
capability sys_admin,
capability sys_chroot,
capability sys_resource,
@{exec_path} mr,
@{lib_dirs}/msedge{,-beta,-dev} rPx,
@{PROC} r,
@{PROC}/@{pids}/ r,
owner @{PROC}/@{pid}/fd/ r,
owner @{PROC}/@{pid}/oom_{,score_}adj rw,
include if exists <local/msedge-sandbox>
}

View file

@ -0,0 +1,40 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2022-2024 Alexandre Pujol <alexandre@pujol.io>
# Copyright (C) 2022-2024 Jose Maldonado <josemald89@gmail.com>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{lib_dirs} = /opt/microsoft/msedge{,-beta,-dev}
@{exec_path} = @{lib_dirs}/microsoft-edge{,-beta,-dev}
profile msedge-wrapper @{exec_path} flags=(attach_disconnected) {
include <abstractions/base>
include <abstractions/consoles>
@{exec_path} r,
@{sh_path} rix,
@{bin}/cat rix,
@{bin}/dirname rix,
@{bin}/mkdir rix,
@{bin}/readlink rix,
@{bin}/touch rix,
@{bin}/which{,.debianutils} rix,
@{lib_dirs}/msedge rPx,
owner @{user_config_dirs}/msedge-flags.conf r,
owner @{PROC}/@{pid}/fd/* rw,
# File Inherit
owner @{HOME}/.xsession-errors w,
# Silencer
deny @{user_share_dirs}/gvfs-metadata/* r,
include if exists <local/msedge-wrapper>
}