apparmor.d/apparmor.d/profiles-a-f/appstreamcli
2022-07-03 20:27:48 +01:00

71 lines
1.8 KiB
Text

# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2019-2022 Mikhail Morfikov
# Copyright (C) 2022 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = /{usr/,}bin/appstreamcli
profile appstreamcli @{exec_path} flags=(complain) {
include <abstractions/base>
include <abstractions/consoles>
include <abstractions/nameservice-strict>
capability dac_read_search,
@{exec_path} mr,
/{usr/,}bin/curl rCx -> curl,
/{usr/,}bin/gzip rix,
/{usr/,}bin/tar rix,
/usr/share/appdata/ r,
/usr/share/applications/{,*.desktop} r,
/usr/share/metainfo/ r,
/usr/share/metainfo/*.{metainfo,appdata}.xml r,
/usr/share/mime/mime.cache r,
/etc/appstream.conf r,
owner @{user_cache_dirs}/ rw,
owner @{user_cache_dirs}/appstream-cache-*.mdb rw,
owner @{user_cache_dirs}/appstream/ rw,
owner @{user_cache_dirs}/appstream/appcache-*.mdb rw,
owner @{user_share_dirs}/mime/mime.cache r,
/var/lib/app-info/ w,
/var/lib/app-info/yaml/ r,
/var/lib/app-info/yaml/*.yml.gz w,
/var/lib/apt/lists/ r,
/var/lib/apt/lists/*.gz r,
/var/lib/flatpak/appstream/{,**} r,
/var/lib/swcatalog/ rw,
/var/lib/swcatalog/icons/{,**} rw,
/var/lib/swcatalog/yaml/ rw,
/var/lib/swcatalog/yaml/*_Components-*.yml.gz w,
/var/cache/swcatalog/cache/{,**} rw,
owner /var/cache/app-info/{,**} rw,
owner /var/cache/swcatalog/{,**} rw,
owner /tmp/appstream-cache-*.mdb rw,
owner /tmp/appstream/ rw,
owner /tmp/appstream/appcache-*.mdb rw,
/var/log/cron-apt/temp w,
owner @{PROC}/@{pid}/fd/ r,
profile curl {
include <abstractions/base>
include <abstractions/nameservice-strict>
include <abstractions/openssl>
include <abstractions/ssl_certs>
/{usr/,}bin/curl mr,
}
include if exists <local/appstreamcli>
}