2020-09-12 17:19:23 +02:00
|
|
|
# vim:syntax=apparmor
|
|
|
|
# ------------------------------------------------------------------
|
|
|
|
#
|
2021-01-10 16:35:07 +01:00
|
|
|
# Copyright (C) 2020-2021 Mikhail Morfikov
|
2020-09-12 17:19:23 +02:00
|
|
|
#
|
|
|
|
# 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-09-12 17:19:23 +02:00
|
|
|
|
2020-12-10 22:33:39 +01:00
|
|
|
include <tunables/global>
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
@{BUILD_DIR} = /media/debuilder/
|
|
|
|
|
2021-03-21 17:04:10 +01:00
|
|
|
@{exec_path} = /{usr/,}bin/git
|
|
|
|
@{exec_path} += /{usr/,}bin/git-*
|
|
|
|
@{exec_path} += /{usr/,}lib/git-core/git
|
|
|
|
@{exec_path} += /{usr/,}lib/git-core/git-*
|
|
|
|
@{exec_path} += /usr/libexec/git-core/git
|
|
|
|
@{exec_path} += /usr/libexec/git-core/git-*
|
|
|
|
@{exec_path} += /usr/libexec/git-core/mergetools/*
|
|
|
|
|
2020-09-12 17:19:23 +02:00
|
|
|
profile git @{exec_path} {
|
2020-12-10 22:33:39 +01:00
|
|
|
include <abstractions/base>
|
|
|
|
include <abstractions/consoles>
|
|
|
|
include <abstractions/ssl_certs>
|
|
|
|
include <abstractions/nameservice-strict>
|
|
|
|
|
|
|
|
network inet dgram,
|
|
|
|
network inet6 dgram,
|
|
|
|
network inet stream,
|
|
|
|
network inet6 stream,
|
|
|
|
|
2021-03-21 17:04:10 +01:00
|
|
|
@{exec_path} mrix,
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
# When you mistype a command, git checks the $PATH variable and search its exec dirs to give you
|
|
|
|
# the most similar commands, which it thinks can be used instead. Git binaries are all under
|
|
|
|
# /usr/bin/ , so allow only this location.
|
|
|
|
/{usr/,}bin/ r,
|
|
|
|
deny /{usr/,}sbin/ r,
|
|
|
|
deny /usr/local/bin/ r,
|
|
|
|
deny /usr/games/ r,
|
|
|
|
deny /usr/local/games/ r,
|
|
|
|
|
|
|
|
# These are needed for "git submodule update"
|
|
|
|
/{usr/,}bin/basename rix,
|
|
|
|
/{usr/,}bin/sed rix,
|
|
|
|
/{usr/,}bin/gettext.sh rix,
|
|
|
|
/{usr/,}bin/uname rix,
|
|
|
|
/{usr/,}bin/envsubst rix,
|
|
|
|
/{usr/,}bin/gettext rix,
|
|
|
|
|
2020-12-09 10:30:52 +01:00
|
|
|
/{usr/,}bin/{,ba,da}sh rix,
|
2020-09-12 17:19:23 +02:00
|
|
|
/{usr/,}bin/{,e}grep rix,
|
|
|
|
|
|
|
|
/{usr/,}bin/pager rPx -> child-pager,
|
|
|
|
/{usr/,}bin/less rPx -> child-pager,
|
|
|
|
/{usr/,}bin/more rPx -> child-pager,
|
|
|
|
|
|
|
|
/{usr/,}bin/man rPx,
|
|
|
|
|
|
|
|
# For signing commits
|
|
|
|
/{usr/,}bin/gpg rCx -> gpg,
|
|
|
|
|
|
|
|
# For SSH support
|
|
|
|
/{usr/,}bin/ssh rCx -> ssh,
|
|
|
|
|
|
|
|
# Difftools
|
|
|
|
/{usr/,}bin/meld rPUx,
|
|
|
|
|
2020-09-18 20:05:47 +02:00
|
|
|
/{usr/,}bin/sensible-editor rCx -> editor,
|
|
|
|
/{usr/,}bin/vim.* rCx -> editor,
|
|
|
|
|
2020-09-12 17:19:23 +02:00
|
|
|
owner @{HOME}/.config/git/ rw,
|
|
|
|
owner @{HOME}/.config/git/config rw,
|
|
|
|
|
|
|
|
/usr/share/git-core/{,**} r,
|
|
|
|
|
|
|
|
# For diffs
|
|
|
|
owner /tmp/git-difftool.*/ rw,
|
|
|
|
owner /tmp/git-difftool.*/right/{,**} rw,
|
|
|
|
owner /tmp/git-difftool.*/left/{,**} rw,
|
|
|
|
owner /tmp/* rw,
|
|
|
|
|
|
|
|
# For git log --show-signature
|
|
|
|
owner /tmp/.git_vtag_tmp* rw,
|
|
|
|
|
|
|
|
# For android studio
|
|
|
|
owner /tmp/git-commit-msg-.txt rw,
|
|
|
|
|
|
|
|
# For package building
|
|
|
|
owner @{HOME}/*/ rw,
|
|
|
|
owner @{HOME}/*/** rwkl -> @{HOME}/*/**,
|
|
|
|
owner @{BUILD_DIR}/** rwkl -> @{BUILD_DIR}/**,
|
|
|
|
owner @{BUILD_DIR}/**/bin/* rCx -> exec,
|
|
|
|
|
|
|
|
/etc/mailname r,
|
|
|
|
|
|
|
|
|
|
|
|
profile gpg {
|
2020-12-10 22:33:39 +01:00
|
|
|
include <abstractions/base>
|
|
|
|
include <abstractions/consoles>
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
/{usr/,}bin/gpg mr,
|
|
|
|
|
|
|
|
owner @{HOME}/.gnupg/ rw,
|
|
|
|
owner @{HOME}/.gnupg/** rwkl -> @{HOME}/.gnupg/**,
|
|
|
|
|
|
|
|
owner /tmp/.git_vtag_tmp* r,
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
profile ssh {
|
2020-12-10 22:33:39 +01:00
|
|
|
include <abstractions/base>
|
|
|
|
include <abstractions/nameservice-strict>
|
|
|
|
include <abstractions/openssl>
|
2020-09-12 17:19:23 +02:00
|
|
|
|
2020-12-18 11:12:55 +01:00
|
|
|
network inet dgram,
|
|
|
|
network inet6 dgram,
|
|
|
|
network inet stream,
|
|
|
|
network inet6 stream,
|
|
|
|
|
2020-09-12 17:19:23 +02:00
|
|
|
/{usr/,}bin/ssh mr,
|
|
|
|
|
|
|
|
/etc/ssh/ssh_config.d/{,*} r,
|
|
|
|
/etc/ssh/ssh_config r,
|
|
|
|
|
|
|
|
owner @{HOME}/.ssh/* r,
|
|
|
|
owner @{HOME}/.ssh/known_hosts rw,
|
|
|
|
|
|
|
|
owner @{PROC}/@{pid}/fd/ r,
|
|
|
|
|
|
|
|
owner /tmp/git@*:[0-9]* rwl -> /tmp/git@*:[0-9]*.*,
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
profile exec {
|
2020-12-10 22:33:39 +01:00
|
|
|
include <abstractions/base>
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
owner @{BUILD_DIR}/**/bin/* mr,
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2020-12-10 22:33:39 +01:00
|
|
|
profile editor {
|
|
|
|
include <abstractions/base>
|
|
|
|
include <abstractions/nameservice-strict>
|
2020-09-18 20:05:47 +02:00
|
|
|
|
|
|
|
/{usr/,}bin/sensible-editor mr,
|
|
|
|
/{usr/,}bin/vim.* mrix,
|
2020-12-09 10:30:52 +01:00
|
|
|
/{usr/,}bin/{,ba,da}sh rix,
|
2020-09-18 20:05:47 +02:00
|
|
|
/{usr/,}bin/which rix,
|
|
|
|
|
|
|
|
owner @{HOME}/.selected_editor r,
|
|
|
|
|
|
|
|
/usr/share/vim/{,**} r,
|
|
|
|
/etc/vim/{,**} r,
|
|
|
|
owner @{HOME}/.viminfo{,.tmp} rw,
|
|
|
|
|
|
|
|
owner @{HOME}/.fzf/plugin/ r,
|
|
|
|
owner @{HOME}/.fzf/plugin/fzf.vim r,
|
|
|
|
|
|
|
|
# The git repository files
|
2021-03-21 17:04:10 +01:00
|
|
|
owner @{BUILD_DIR}/ r,
|
|
|
|
owner @{BUILD_DIR}/** rw,
|
2020-09-18 20:05:47 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2020-12-10 22:33:39 +01:00
|
|
|
include if exists <local/git>
|
2020-09-12 17:19:23 +02:00
|
|
|
}
|