2010-07-30 05:47:57 +08:00
|
|
|
/*
|
|
|
|
* AppArmor security module
|
|
|
|
*
|
2017-01-16 16:42:13 +08:00
|
|
|
* This file contains AppArmor basic global
|
2010-07-30 05:47:57 +08:00
|
|
|
*
|
|
|
|
* Copyright (C) 1998-2008 Novell/SUSE
|
2017-06-09 23:14:28 +08:00
|
|
|
* Copyright 2009-2017 Canonical Ltd.
|
2010-07-30 05:47:57 +08: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 16:42:13 +08:00
|
|
|
#include <linux/types.h>
|
2010-07-30 05:47:57 +08:00
|
|
|
|
2012-02-16 23:07:53 +08: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 14:18:33 +08:00
|
|
|
#define AA_CLASS_DEPRECATED 4
|
2012-02-16 23:07:53 +08: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 14:04:47 +08:00
|
|
|
#define AA_CLASS_MOUNT 7
|
2017-06-10 05:22:14 +08:00
|
|
|
#define AA_CLASS_PTRACE 9
|
2017-07-19 13:56:22 +08:00
|
|
|
#define AA_CLASS_SIGNAL 10
|
2017-07-19 14:18:33 +08:00
|
|
|
#define AA_CLASS_NET 14
|
2017-06-09 23:14:28 +08:00
|
|
|
#define AA_CLASS_LABEL 16
|
2012-02-16 23:07:53 +08:00
|
|
|
|
2017-06-09 23:14:28 +08:00
|
|
|
#define AA_CLASS_LAST AA_CLASS_LABEL
|
2012-02-16 23:07:53 +08:00
|
|
|
|
2010-07-30 05:47:57 +08:00
|
|
|
/* Control parameters settable through module/boot flags */
|
|
|
|
extern enum audit_mode aa_g_audit;
|
2012-01-13 07:02:20 +08:00
|
|
|
extern bool aa_g_audit_header;
|
|
|
|
extern bool aa_g_debug;
|
2014-10-25 00:16:14 +08:00
|
|
|
extern bool aa_g_hash_policy;
|
2012-01-13 07:02:20 +08:00
|
|
|
extern bool aa_g_lock_policy;
|
|
|
|
extern bool aa_g_logsyscall;
|
|
|
|
extern bool aa_g_paranoid_load;
|
2010-07-30 05:47:57 +08:00
|
|
|
extern unsigned int aa_g_path_max;
|
|
|
|
|
|
|
|
#endif /* __APPARMOR_H */
|