mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-22 01:57:43 +00:00
Compare commits
6 Commits
feffab8ff9
...
0c26459cfa
Author | SHA1 | Date | |
---|---|---|---|
|
0c26459cfa | ||
|
0e755d24bb | ||
|
db74dda3c6 | ||
|
6f5a4219d7 | ||
|
0e58e3d7fb | ||
|
262d305660 |
@ -42,6 +42,10 @@ profile curl /usr/bin/curl {
|
|||||||
network inet6 stream,
|
network inet6 stream,
|
||||||
network inet6 dgram,
|
network inet6 dgram,
|
||||||
|
|
||||||
|
# Allow access to the snap socket until we can revisit it with delegation
|
||||||
|
# or profile refactoring
|
||||||
|
file rw @{run}/snapd.socket,
|
||||||
|
|
||||||
# Site-specific additions and overrides. See local/README for details.
|
# Site-specific additions and overrides. See local/README for details.
|
||||||
include if exists <local/curl>
|
include if exists <local/curl>
|
||||||
}
|
}
|
||||||
|
@ -30,6 +30,9 @@ profile unix-chkpwd /{,usr/}{,s}bin/unix_chkpwd {
|
|||||||
/run/host/userdb/*.user r,
|
/run/host/userdb/*.user r,
|
||||||
/run/host/userdb/*.user-privileged r,
|
/run/host/userdb/*.user-privileged r,
|
||||||
|
|
||||||
|
# authd socket for PAM
|
||||||
|
@{run}/authd.sock rw,
|
||||||
|
|
||||||
# file_inherit
|
# file_inherit
|
||||||
owner /dev/tty[0-9]* rw,
|
owner /dev/tty[0-9]* rw,
|
||||||
|
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
#
|
#
|
||||||
# ------------------------------------------------------------------
|
# ------------------------------------------------------------------
|
||||||
|
|
||||||
|
import os
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
import apparmor.aa as aa
|
import apparmor.aa as aa
|
||||||
@ -25,12 +26,22 @@ class TestFoo(AATest):
|
|||||||
def test_active_profiles(self):
|
def test_active_profiles(self):
|
||||||
aa.read_profiles()
|
aa.read_profiles()
|
||||||
|
|
||||||
self.assertGreaterEqual(len(aa.active_profiles.profile_names), 42)
|
# when using system apparmor then we haven't necessarily installed all
|
||||||
|
# the profiles so checking against a specific number may fail - instead
|
||||||
|
# it is sufficient that profiles were read without an exception being
|
||||||
|
# thrown above
|
||||||
|
if os.getenv("USE_SYSTEM", "0") != "1":
|
||||||
|
self.assertGreaterEqual(len(aa.active_profiles.profile_names), 42)
|
||||||
|
|
||||||
def test_extra_profiles(self):
|
def test_extra_profiles(self):
|
||||||
aa.read_inactive_profiles()
|
aa.read_inactive_profiles()
|
||||||
|
|
||||||
self.assertGreaterEqual(len(aa.extra_profiles.profile_names), 100)
|
# when using system apparmor then we haven't necessarily installed all
|
||||||
|
# the profiles so checking against a specific number may fail - instead
|
||||||
|
# it is sufficient that profiles were read without an exception being
|
||||||
|
# thrown above
|
||||||
|
if os.getenv("USE_SYSTEM", "0") != "1":
|
||||||
|
self.assertGreaterEqual(len(aa.extra_profiles.profile_names), 100)
|
||||||
|
|
||||||
|
|
||||||
setup_aa(aa)
|
setup_aa(aa)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user