Skip to content
Snippets Groups Projects

Fix apparmor's tests

Merged Frederic Danis requested to merge wip/fdanis/8668-apparmor-warnings into apertis/v2023dev2
All threads resolved!
3 files
+ 12
7
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 8
3
@@ -28,8 +28,13 @@ usr_binary_profile_ARGS="-c1 localhost"
lib_binary_no_profile=/usr/lib/ssl/misc/c_issuer
lib_binary_profile=/usr/lib/telepathy/telepathy-gabble
# 'ls' is provided by coreutils
coreutils=`which coreutils`
# 'ping' is provided by busybox
busybox=`which busybox`
# Generate a profile including chaiwala-base + permission to exec $usr_binary_no_profile
genprofile abstraction:chaiwala-base "$usr_binary_no_profile:Pix"
genprofile abstraction:chaiwala-base "$usr_binary_no_profile:Pix" "$coreutils:Pix"
# $usr_binary_no_profile passes for the inherit rule (Pix), since it can exec
# the binary and access ARGS.
runchecktest "EXEC $usr_binary_no_profile (no profile, but inherit)" pass $usr_binary_no_profile $usr_binary_no_profile_ARGS
@@ -42,10 +47,10 @@ runchecktest "EXEC $usr_binary_no_profile (no profile, no inherit)" fail $usr_bi
# NOTE: We need to pass -T to disable tunables because tunables are automatically
# included with abstractions, and that leads to a duplicate include, and an
# AppArmor parser error.
genprofile abstraction:chaiwala-base "$usr_binary_profile:Pix" -- image="$usr_binary_profile" abstraction:nameservice network:raw capability:net_raw -T
genprofile abstraction:chaiwala-base "$usr_binary_profile:Pix" "$busybox:Pix" -- image="$busybox" abstraction:nameservice network:raw capability:net_raw -T
runchecktest "EXEC $usr_binary_profile (profiled)" pass $usr_binary_profile $usr_binary_profile_ARGS
runchecktest "EXEC $lib_binary_no_profile (no profile, out of traditional bin paths)" fail $lib_binary_no_profile
runchecktest "EXEC $lib_binary_profile (profiled, out of traditional bin paths)" fail $lib_binary_profile
genprofile abstraction:chaiwala-base "$usr_binary_no_profile:Pix" -- image=$usr_binary_no_profile /:r /*:r
genprofile abstraction:chaiwala-base "$usr_binary_no_profile:Pix" "$coreutils:Pix" -- image="$coreutils" /:r /*:r /proc/**/maps:r /tmp/apparmor-chaiwala-system*/*:rw
runchecktest "EXEC $usr_binary_no_profile with sibling profile (profiled and profiles allows resource)" pass $usr_binary_no_profile /
Loading