mirror of
https://github.com/roddhjav/apparmor.d.git
synced 2025-02-28 20:54:43 +01:00
190 lines
4.7 KiB
Text
190 lines
4.7 KiB
Text
# apparmor.d - Full set of apparmor profiles
|
|
# Copyright (C) 2020-2021 Mikhail Morfikov
|
|
# Copyright (C) 2021 Alexandre Pujol <alexandre@pujol.io>
|
|
# SPDX-License-Identifier: GPL-2.0-only
|
|
|
|
abi <abi/3.0>,
|
|
|
|
include <tunables/global>
|
|
|
|
@{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/*
|
|
profile git @{exec_path} {
|
|
include <abstractions/base>
|
|
include <abstractions/consoles>
|
|
include <abstractions/nameservice-strict>
|
|
include <abstractions/openssl>
|
|
include <abstractions/ssl_certs>
|
|
|
|
network inet dgram,
|
|
network inet6 dgram,
|
|
network inet stream,
|
|
network inet6 stream,
|
|
network netlink raw,
|
|
|
|
@{exec_path} mrix,
|
|
|
|
# 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/{s,}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,
|
|
|
|
/{usr/,}bin/{,ba,da}sh rix,
|
|
/{usr/,}bin/{,e}grep rix,
|
|
/{usr/,}bin/cat rix,
|
|
/{usr/,}bin/dirname rix,
|
|
|
|
/{usr/,}bin/mv rix,
|
|
/{usr/,}bin/whoami rix,
|
|
/{usr/,}bin/hostname rix,
|
|
/{usr/,}bin/rm rix,
|
|
/{usr/,}bin/cat rix,
|
|
/{usr/,}bin/date 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,
|
|
|
|
/{usr/,}bin/sensible-editor rCx -> editor,
|
|
/{usr/,}bin/vim rCx -> editor,
|
|
/{usr/,}bin/vim.* rCx -> editor,
|
|
|
|
/{usr/,}lib/code/extensions/git/dist/askpass.sh rPx,
|
|
/usr/share/aurpublish/*.hook rPx,
|
|
|
|
owner @{HOME}/.gitconfig r,
|
|
owner @{HOME}/.netrc r,
|
|
owner @{user_config_dirs}/git/{,*} rw,
|
|
|
|
/usr/share/git-core/{,**} r,
|
|
/usr/share/terminfo/x/xterm-256color r,
|
|
|
|
# For diffs
|
|
owner /tmp/git-difftool.*/ rw,
|
|
owner /tmp/git-difftool.*/right/{,**} rw,
|
|
owner /tmp/git-difftool.*/left/{,**} rw,
|
|
owner /tmp/* rw,
|
|
# For TWRP-device-tree-generator
|
|
owner /tmp/tmp*/ rw,
|
|
owner /tmp/tmp*/** rwkl -> /tmp/tmp*/**,
|
|
|
|
# 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 /tmp/** rwkl -> /tmp/**,
|
|
owner /tmp/**/bin/* rCx -> exec,
|
|
|
|
/etc/mailname r,
|
|
|
|
profile gpg {
|
|
include <abstractions/base>
|
|
include <abstractions/consoles>
|
|
|
|
/{usr/,}bin/gpg mr,
|
|
|
|
owner @{HOME}/@{XDG_GPG_DIR}/ rw,
|
|
owner @{HOME}/@{XDG_GPG_DIR}/** rwkl -> @{HOME}/@{XDG_GPG_DIR}/**,
|
|
|
|
owner /tmp/.git_vtag_tmp* r,
|
|
|
|
}
|
|
|
|
profile ssh {
|
|
include <abstractions/base>
|
|
include <abstractions/nameservice-strict>
|
|
include <abstractions/openssl>
|
|
|
|
network inet dgram,
|
|
network inet6 dgram,
|
|
network inet stream,
|
|
network inet6 stream,
|
|
network netlink raw,
|
|
|
|
/{usr/,}bin/ssh mr,
|
|
|
|
/etc/ssh/ssh_config.d/{,*} r,
|
|
/etc/ssh/ssh_config r,
|
|
|
|
owner @{HOME}/@{XDG_SSH_DIR}/* r,
|
|
owner @{HOME}/@{XDG_SSH_DIR}/known_hosts{,.*} rw,
|
|
owner @{HOME}/@{XDG_SSH_DIR}/known_hosts.old rwl,
|
|
|
|
owner @{PROC}/@{pid}/fd/ r,
|
|
|
|
owner /tmp/git@*:[0-9]* rwl -> /tmp/git@*:[0-9]*.*,
|
|
|
|
}
|
|
|
|
profile exec {
|
|
include <abstractions/base>
|
|
|
|
owner @{user_build_dirs}/**/bin/* mr,
|
|
|
|
}
|
|
|
|
profile editor {
|
|
include <abstractions/base>
|
|
include <abstractions/nameservice-strict>
|
|
|
|
/{usr/,}bin/sensible-editor mr,
|
|
/{usr/,}bin/vim mrix,
|
|
/{usr/,}bin/vim.* mrix,
|
|
/{usr/,}bin/{,ba,da}sh rix,
|
|
/{usr/,}bin/which{,.debianutils} rix,
|
|
|
|
owner @{HOME}/.selected_editor r,
|
|
|
|
/usr/share/terminfo/x/xterm-256color r,
|
|
|
|
/usr/share/vim/{,**} r,
|
|
/etc/vimrc r,
|
|
/etc/vim/{,**} r,
|
|
owner @{user_cache_dirs}/vim/{,**} rw,
|
|
owner @{user_config_dirs}/vim/{,**} r,
|
|
owner @{HOME}/.viminfo{,.tmp} rw,
|
|
|
|
owner @{HOME}/.fzf/plugin/ r,
|
|
owner @{HOME}/.fzf/plugin/fzf.vim r,
|
|
|
|
# The git repository files
|
|
owner @{user_build_dirs}/ r,
|
|
owner @{user_build_dirs}/** rw,
|
|
|
|
}
|
|
|
|
include if exists <local/git>
|
|
}
|