You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
E.g. /tmp/**, /var/tmp/**, @{tmp}/**, /etc/**, /dev/shm/**, @{run}/user/@{uid}/**
Check for unrestricted profile transition:
Such as @{bin}/** rPx,, @{lib}/** rPx,, rUx, or rux.
Needs to be ignored when it is done on purpose.
Check for missing dbus peer label in dbus rules.
Check for unrestricted access to @{HOME}
E.g. @{HOME}/** rw,,
Check for mount rule too large (not restrictive enough):
Mounting anything requires the sys_admin cap, access to the source and mountpoint directories and the required mount rule. If the mount rule is too large (such as allowing to mount /etc in rw), sys_admin is not restricted and is equivalent to full root access.
E.g. mount,, umount,, mount -> /new/path/**,
Check for the use of some dangerous capabilities:
E.g. mac_admin if not in apparmor_parser, or apparmor.systemd
This issue aims to discuss the creation of a linter for apparmor profiles.
Ideally, it should
apparmor.d
centric: enforce security and style rules defined by this projectapparmor.d
's abstraction & tunable are not available.We should provide a cli tool
aa-lint
that use an architecture similar to existing linter in python such as yamllint.Rules set
Open discussion of the initial list of considered of convention, style, and security checks.
Convention
Most of them are already implemented by
make check
, and therefore are less of a priorityprofile <filename>
.Warning
Check for missing
abstractions/base
abstractionCheck for missing variable.
Check for missing directory mark (variable that are directories but that are not marked as it (no dirs suffix)).
@{HOME}
instead of@{HOME}/
.@{MOUNTS}
,@{bin}
,@{lib}
,@{tmp}
and all user directories (*_dirs
,*_DIR
).Check for missing profile entrypoint:
@{exec_path} mr,
Check for rule without effect. E.g. a rule already included in an abstraction, or in another more global rule in the profile.
Check for lock permission on directory:
/path/to/dir/{,**} rwlk,
as it is useless.Check for rules too restrictive that would break on
/usr/share/terminfo/x/*
instead of/usr/share/terminfo/**
,Security
Check for dangerous abstraction used:
user-tmp
: full access to/tmp/
dbus-session
,dbus-system
,dbus-accessibility
: full access to a dbus bus.Check for deprecated abstraction
nameservice
->nameservice-strict
bash
->shell
X
->X-strict
dbus-accessibility-strict
->bus-accessibility
dbus-session-strict
->bus-session
dbus-system-strict
->bus-system
dbus-network-manager-strict
->bus/org.freedesktop.NetworkManager
Check for rule too wide on shared directory:
/tmp/**
,/var/tmp/**
,@{tmp}/**
,/etc/**
,/dev/shm/**
,@{run}/user/@{uid}/**
Check for unrestricted profile transition:
@{bin}/** rPx,
,@{lib}/** rPx,
,rUx,
orrux
.Check for missing dbus peer label in dbus rules.
Check for unrestricted access to
@{HOME}
@{HOME}/** rw,
,Check for mount rule too large (not restrictive enough):
sys_admin
cap, access to the source and mountpoint directories and the required mount rule. If the mount rule is too large (such as allowing to mount /etc inrw
),sys_admin
is not restricted and is equivalent to full root access.mount,
,umount,
,mount -> /new/path/**,
Check for the use of some dangerous capabilities:
mac_admin
if not inapparmor_parser
, orapparmor.systemd
Related work
Special thanks to @nobody43 for they work on it (#607)
The text was updated successfully, but these errors were encountered: