From 4cfdf53921842b1b59fa5fd77777fb6065f6e977 Mon Sep 17 00:00:00 2001 From: Silvino Date: Wed, 12 Jun 2019 23:51:18 +0000 Subject: apparmor added profiles --- core/apparmor.html | 51 +++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 47 insertions(+), 4 deletions(-) (limited to 'core') diff --git a/core/apparmor.html b/core/apparmor.html index 5c9b541..0052a68 100644 --- a/core/apparmor.html +++ b/core/apparmor.html @@ -11,7 +11,7 @@

2.6.1. AppArmor

Check kernel configuration or - use the provided with linux-gnu port + use the provided with linux-gnu port to support apparmor. AppArmor enforce rules on applications based on security policies. User space tools are provided by apparmor port and its dependencies, install them;

@@ -48,7 +48,20 @@ aa-decode aa-exec aa-remove-unknown -

apparmor_parser options;

+

Profiles

+ +

Profiles are located at /etc/apparmor.d/ and + /usr/share/apparmor/extra-profiles contain profiles + that require testing; + +

+        # cp -r /usr/share/apparmor/extra-profiles/* /etc/apparmor.d/
+        # sudo rm /etc/apparmor.d/README
+        # bash /etc/rc.d/apparmor restart
+        
+ +

Profiles are parsed using + apparmor_parser;

 	Usage: apparmor_parser [options] [profile]
@@ -93,11 +106,41 @@
 	--skip-bad-cache-rebuild Do not try rebuilding the cache if it is rejected by the kernel
 	--warn n                Enable warnings (see --help=warn)
 	
- # + +

Create profile with audit

+ +

Create profile manually

+ +

To create a new profile, let's say for lynx, + first find where the application is;

+ +
+        $ whereis lynx
+        lynx: /usr/bin/lynx /usr/etc/lynx.lss /usr/etc/lynx.cfg /usr/etc/lynx.cfg~ /usr/share/man/man1/lynx.1.gz
+        
+ +

Now create a file with path to executable in + /etc/apparmor.d;

+ +
+        # vim /etc/apparmor.d/usr.bin.lynx
+        
+ +

Create basic profile template;

+ +
+        #include <tunables/global>
+
+        profile lynx /usr/bin/lynx {
+          #include <abstractions/base>
+        }
+        
+ + Core OS Index

This is part of the Hive System Documentation. - Copyright (C) 2018 + Copyright (C) 2019 Hive Team. See the file Gnu Free Documentation License for copying conditions.

-- cgit 1.4.1-2-gfad0