feat(profile): add pycompile.
This commit is contained in:
parent
a9303e82bb
commit
6650f45ee0
2 changed files with 55 additions and 0 deletions
54
apparmor.d/profiles-m-r/pycompile
Normal file
54
apparmor.d/profiles-m-r/pycompile
Normal file
|
|
@ -0,0 +1,54 @@
|
||||||
|
# apparmor.d - Full set of apparmor profiles
|
||||||
|
# Copyright (C) 2025 Alexandre Pujol <alexandre@pujol.io>
|
||||||
|
# SPDX-License-Identifier: GPL-2.0-only
|
||||||
|
|
||||||
|
abi <abi/4.0>,
|
||||||
|
|
||||||
|
include <tunables/global>
|
||||||
|
|
||||||
|
@{exec_path} = @{bin}/py{,3}compile @{bin}/py{,3}clean
|
||||||
|
profile pycompile @{exec_path} flags=(attach_disconnected,complain) {
|
||||||
|
include <abstractions/base>
|
||||||
|
include <abstractions/common/apt>
|
||||||
|
include <abstractions/consoles>
|
||||||
|
# include <abstractions/python>
|
||||||
|
|
||||||
|
capability dac_override,
|
||||||
|
capability dac_read_search,
|
||||||
|
|
||||||
|
@{exec_path} mr,
|
||||||
|
@{python_path} rix,
|
||||||
|
|
||||||
|
@{bin}/dpkg rCx -> dpkg,
|
||||||
|
|
||||||
|
@{lib}/@{python_name}/dist-packages/__pycache__/ w,
|
||||||
|
@{lib}/@{python_name}/dist-packages/__pycache__/*.pyc w,
|
||||||
|
@{lib}/@{python_name}/dist-packages/__pycache__/*.pyc.* w,
|
||||||
|
@{lib}/@{python_name}/dist-packages/**/__pycache__/ w,
|
||||||
|
@{lib}/@{python_name}/dist-packages/**/__pycache__/*.pyc w,
|
||||||
|
@{lib}/@{python_name}/dist-packages/**/__pycache__/*.pyc.* w,
|
||||||
|
|
||||||
|
/usr/share/python3/{,**} r,
|
||||||
|
|
||||||
|
/ r,
|
||||||
|
|
||||||
|
profile dpkg {
|
||||||
|
include <abstractions/base>
|
||||||
|
include <abstractions/consoles>
|
||||||
|
include <abstractions/common/apt>
|
||||||
|
|
||||||
|
capability dac_read_search,
|
||||||
|
|
||||||
|
@{bin}/dpkg mr,
|
||||||
|
@{bin}/dpkg-query rpx,
|
||||||
|
|
||||||
|
/etc/dpkg/dpkg.cfg.d/{,*} r,
|
||||||
|
/etc/dpkg/dpkg.cfg r,
|
||||||
|
|
||||||
|
include if exists <local/pycompile_dpkg>
|
||||||
|
}
|
||||||
|
|
||||||
|
include if exists <local/pycompile>
|
||||||
|
}
|
||||||
|
|
||||||
|
# vim:syntax=apparmor
|
||||||
|
|
@ -264,6 +264,7 @@ plymouthd complain
|
||||||
polkit-kde-authentication-agent attach_disconnected,complain,mediate_deleted
|
polkit-kde-authentication-agent attach_disconnected,complain,mediate_deleted
|
||||||
ptyxis complain
|
ptyxis complain
|
||||||
ptyxis-agent complain
|
ptyxis-agent complain
|
||||||
|
pycompile complain
|
||||||
qdbus complain
|
qdbus complain
|
||||||
remmina complain
|
remmina complain
|
||||||
run-parts complain
|
run-parts complain
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue