apparmor.d/profiles/repo

92 lines
2.1 KiB
Plaintext
Raw Normal View History

# vim:syntax=apparmor
# ------------------------------------------------------------------
#
2021-01-10 16:35:07 +01:00
# 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.
#
# ------------------------------------------------------------------
2020-12-10 22:33:39 +01:00
abi <abi/3.0>,
2020-12-10 22:33:39 +01:00
include <tunables/global>
2021-03-21 17:04:10 +01:00
@{ANDROID_SOURCE_DIR} = /media/Android/
@{exec_path} = /{usr/,}bin/repo
2020-12-10 22:33:39 +01:00
profile repo @{exec_path} {
include <abstractions/base>
include <abstractions/python>
include <abstractions/nameservice-strict>
include <abstractions/openssl>
include <abstractions/ssl_certs>
include <abstractions/deny-root-dir-access>
network inet dgram,
network inet6 dgram,
network inet stream,
network inet6 stream,
@{exec_path} r,
/{usr/,}bin/python3.[0-9]* rix,
/{usr/,}bin/python2.[0-9]* rix,
/{usr/,}bin/ r,
/{usr/,}bin/env rix,
2020-12-09 10:30:52 +01:00
/{usr/,}bin/{,ba,da}sh rix,
/{usr/,}bin/uname rix,
/{usr/,}bin/git rix,
/{usr/,}lib/git-core/git rix,
/{usr/,}lib/git-core/git-* rix,
/{usr/,}bin/curl rCx -> curl,
/{usr/,}bin/gpg rCx -> gpg,
# Android source dir
2021-03-21 17:04:10 +01:00
owner @{ANDROID_SOURCE_DIR}/** rwkl -> @{ANDROID_SOURCE_DIR}/**,
owner @{ANDROID_SOURCE_DIR}/**/.repo/repo/main.py rix,
owner @{HOME}/.repoconfig/{,**} rw,
owner @{HOME}/.repo_.gitconfig.json rw,
owner @{HOME}/.config/git/config r,
owner @{HOME}/.gitconfig r,
/usr/share/git-core/{,**} r,
owner /tmp/.git_vtag_tmp* rw,
owner @{PROC}/@{pid}/fd/ r,
owner @{PROC}/@{pid}/mounts r,
owner /dev/shm/* rw,
owner /dev/shm/sem.mp* rwl -> /dev/shm/*,
2020-12-10 22:33:39 +01:00
profile curl {
include <abstractions/base>
include <abstractions/nameservice-strict>
include <abstractions/openssl>
include <abstractions/ssl_certs>
/{usr/,}bin/curl mr,
}
2020-12-10 22:33:39 +01:00
profile gpg {
include <abstractions/base>
/{usr/,}bin/gpg mr,
owner @{HOME}/.repoconfig/gnupg/** rwkl -> @{HOME}/.repoconfig/gnupg/**,
2020-12-10 22:33:39 +01:00
owner /tmp/.git_vtag_tmp* r,
}
2020-12-10 22:33:39 +01:00
include if exists <local/repo>
}