# vim:syntax=apparmor # ------------------------------------------------------------------ # # Copyright (C) 2019-2021 Mikhail Morfikov # # This program is free software; you can redistribute it and/or # modify it under the terms of version 2 of the GNU General Public # License published by the Free Software Foundation. # # ------------------------------------------------------------------ abi , include @{exec_path} = /{usr/,}bin/adequate profile adequate @{exec_path} flags=(complain) { include include include include #capability sys_tty_config, @{exec_path} r, /{usr/,}bin/perl r, /{usr/,}sbin/ldconfig rix, # It wants to ldd all binaries/libs in packages. /{usr/,}bin/ldd rCx -> ldd, # Think what to do about this (#FIXME#) /usr/share/debconf/frontend rPx, #/usr/share/debconf/frontend rCx -> frontend, /{usr/,}bin/pkg-config rCx -> pkg-config, /{usr/,}bin/dpkg rPx -> child-dpkg, # Do not strip env to avoid errors like the following: # ERROR: ld.so: object 'libfakeroot-sysv.so' from LD_PRELOAD cannot be preloaded (cannot open # shared object file): ignored. /{usr/,}bin/dpkg-query rpx, # /{usr/,}bin/update-alternatives rPx, /var/lib/adequate/pending rwk, /etc/shadow r, /usr/share/python{,3}/debian_defaults r, /usr/share/doc/*/copyright r, /usr/share/**/__pycache__/ r, /usr/**/*.py r, profile ldd flags=(complain) { include include /{usr/,}bin/ldd mr, /{usr/,}bin/* mr, /{usr/,}sbin/* mr, /usr/games/* mr, /{usr/,}lib{,x}{,32,64}/** mr, /{usr/,}lib/@{multiarch}/** mr, /usr/share/** r, /opt/google/chrome{,-beta,-unstable}/google-chrome{,-beta,-unstable} mr, /{usr/,}lib/@{multiarch}/ld-*.so rix, /{usr/,}lib{,x}32/ld-*.so rix, } profile frontend flags=(complain) { include include include include /usr/share/debconf/frontend r, /{usr/,}bin/perl r, /{usr/,}bin/adequate rPx, /{usr/,}bin/{,ba,da}sh rix, /{usr/,}bin/stty rix, /{usr/,}bin/locale rix, /etc/debconf.conf r, owner /var/cache/debconf/{config,passwords,templates}.dat{,-new,-old} rwk, /usr/share/debconf/templates/adequate.templates r, # The following is needed when debconf uses GUI frontends. include include include include capability dac_read_search, /{usr/,}bin/lsb_release rPx -> child-lsb_release, /{usr/,}bin/hostname rix, owner @{PROC}/@{pid}/mounts r, @{HOME}/.Xauthority r, /etc/shadow r, } profile pkg-config flags=(complain) { include /{usr/,}bin/pkg-config mr, } include if exists }