2010-07-30 01:47:57 +04:00
/*
* AppArmor security module
*
2017-01-16 11:42:13 +03:00
* This file contains AppArmor basic global
2010-07-30 01:47:57 +04:00
*
* Copyright ( C ) 1998 - 2008 Novell / SUSE
2017-06-09 18:14:28 +03:00
* Copyright 2009 - 2017 Canonical Ltd .
2010-07-30 01:47:57 +04:00
*
* This program is free software ; you can redistribute it and / or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation , version 2 of the
* License .
*/
# ifndef __APPARMOR_H
# define __APPARMOR_H
2017-01-16 11:42:13 +03:00
# include <linux/types.h>
2010-07-30 01:47:57 +04:00
2012-02-16 19:07:53 +04:00
/*
* Class of mediation types in the AppArmor policy db
*/
# define AA_CLASS_ENTRY 0
# define AA_CLASS_UNKNOWN 1
# define AA_CLASS_FILE 2
# define AA_CLASS_CAP 3
2017-07-19 09:18:33 +03:00
# define AA_CLASS_DEPRECATED 4
2012-02-16 19:07:53 +04:00
# define AA_CLASS_RLIMITS 5
# define AA_CLASS_DOMAIN 6
apparmor: add mount mediation
Add basic mount mediation. That allows controlling based on basic
mount parameters. It does not include special mount parameters for
apparmor, super block labeling, or any triggers for apparmor namespace
parameter modifications on pivot root.
default userspace policy rules have the form of
MOUNT RULE = ( MOUNT | REMOUNT | UMOUNT )
MOUNT = [ QUALIFIERS ] 'mount' [ MOUNT CONDITIONS ] [ SOURCE FILEGLOB ]
[ '->' MOUNTPOINT FILEGLOB ]
REMOUNT = [ QUALIFIERS ] 'remount' [ MOUNT CONDITIONS ]
MOUNTPOINT FILEGLOB
UMOUNT = [ QUALIFIERS ] 'umount' [ MOUNT CONDITIONS ] MOUNTPOINT FILEGLOB
MOUNT CONDITIONS = [ ( 'fstype' | 'vfstype' ) ( '=' | 'in' )
MOUNT FSTYPE EXPRESSION ]
[ 'options' ( '=' | 'in' ) MOUNT FLAGS EXPRESSION ]
MOUNT FSTYPE EXPRESSION = ( MOUNT FSTYPE LIST | MOUNT EXPRESSION )
MOUNT FSTYPE LIST = Comma separated list of valid filesystem and
virtual filesystem types (eg ext4, debugfs, etc)
MOUNT FLAGS EXPRESSION = ( MOUNT FLAGS LIST | MOUNT EXPRESSION )
MOUNT FLAGS LIST = Comma separated list of MOUNT FLAGS.
MOUNT FLAGS = ( 'ro' | 'rw' | 'nosuid' | 'suid' | 'nodev' | 'dev' |
'noexec' | 'exec' | 'sync' | 'async' | 'remount' |
'mand' | 'nomand' | 'dirsync' | 'noatime' | 'atime' |
'nodiratime' | 'diratime' | 'bind' | 'rbind' | 'move' |
'verbose' | 'silent' | 'loud' | 'acl' | 'noacl' |
'unbindable' | 'runbindable' | 'private' | 'rprivate' |
'slave' | 'rslave' | 'shared' | 'rshared' |
'relatime' | 'norelatime' | 'iversion' | 'noiversion' |
'strictatime' | 'nouser' | 'user' )
MOUNT EXPRESSION = ( ALPHANUMERIC | AARE ) ...
PIVOT ROOT RULE = [ QUALIFIERS ] pivot_root [ oldroot=OLD PUT FILEGLOB ]
[ NEW ROOT FILEGLOB ]
SOURCE FILEGLOB = FILEGLOB
MOUNTPOINT FILEGLOB = FILEGLOB
eg.
mount,
mount /dev/foo,
mount options=ro /dev/foo -> /mnt/,
mount options in (ro,atime) /dev/foo -> /mnt/,
mount options=ro options=atime,
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Seth Arnold <seth.arnold@canonical.com>
2017-07-19 09:04:47 +03:00
# define AA_CLASS_MOUNT 7
2017-06-10 00:22:14 +03:00
# define AA_CLASS_PTRACE 9
2017-07-19 08:56:22 +03:00
# define AA_CLASS_SIGNAL 10
2017-07-19 09:18:33 +03:00
# define AA_CLASS_NET 14
2017-06-09 18:14:28 +03:00
# define AA_CLASS_LABEL 16
2012-02-16 19:07:53 +04:00
2017-06-09 18:14:28 +03:00
# define AA_CLASS_LAST AA_CLASS_LABEL
2012-02-16 19:07:53 +04:00
2010-07-30 01:47:57 +04:00
/* Control parameters settable through module/boot flags */
extern enum audit_mode aa_g_audit ;
2012-01-13 03:02:20 +04:00
extern bool aa_g_audit_header ;
extern bool aa_g_debug ;
2014-10-24 20:16:14 +04:00
extern bool aa_g_hash_policy ;
2012-01-13 03:02:20 +04:00
extern bool aa_g_lock_policy ;
extern bool aa_g_logsyscall ;
extern bool aa_g_paranoid_load ;
2010-07-30 01:47:57 +04:00
extern unsigned int aa_g_path_max ;
# endif /* __APPARMOR_H */