2012-02-16 08:14:46 -08:00
|
|
|
/*
|
|
|
|
* Copyright 2012 Canonical Ltd.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __AA_POLICYDB_H
|
|
|
|
#define __AA_POLICYDB_H
|
|
|
|
|
|
|
|
/*
|
Move public mediation class types and perms to apparmor.h
Now that the parser links against libapparmor, it makes sense to move
all public permission types and flags to libapparmor's apparmor.h. This
prevents duplication across header files for the parser and libapparmor.
Additionally, this patch breaks the connection between
AA_DBUS_{SEND,RECEIVE,BIND} and AA_MAY_{WRITE,READ,BIND} by using raw
values when defining the AA_DBUS_{SEND,RECEIVE,BIND} macros. This makes
sense because the two sets of permission flags are from two distinctly
different mediation types (AA_CLASS_DBUS and AA_CLASS_FILE). While it is
nice that they share some of the same values, the macros don't need to
be linked together. In other words, when you're creating a D-Bus rule,
it would be incorrect to use permission flags from the AA_CLASS_FILE
type.
The change mentioned above allows the AA_MAY_{WRITE,READ,BIND} macros
to be removed from public-facing apparmor.h header.
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Seth Arnold <seth.arnold@canonical.com>
2013-12-06 11:20:06 -08:00
|
|
|
* Class of private mediation types in the AppArmor policy db
|
|
|
|
*
|
|
|
|
* See libapparmor's apparmor.h for public mediation types
|
2012-02-16 08:14:46 -08:00
|
|
|
*/
|
|
|
|
#define AA_CLASS_COND 0
|
|
|
|
#define AA_CLASS_UNKNOWN 1
|
|
|
|
#define AA_CLASS_FILE 2
|
|
|
|
#define AA_CLASS_CAP 3
|
|
|
|
#define AA_CLASS_NET 4
|
|
|
|
#define AA_CLASS_RLIMITS 5
|
|
|
|
#define AA_CLASS_DOMAIN 6
|
|
|
|
#define AA_CLASS_MOUNT 7
|
|
|
|
#define AA_CLASS_NS_DOMAIN 8
|
|
|
|
#define AA_CLASS_PTRACE 9
|
2014-04-23 11:35:29 -07:00
|
|
|
#define AA_CLASS_SIGNAL 10
|
2018-07-24 04:40:25 -07:00
|
|
|
#define AA_CLASS_NETV8 14
|
2014-04-23 11:02:25 -07:00
|
|
|
#define AA_CLASS_LABEL 16
|
2022-02-07 19:15:11 -03:00
|
|
|
#define AA_CLASS_POSIX_MQUEUE 17
|
|
|
|
#define AA_CLASS_SYSV_MQUEUE 18
|
2022-09-29 17:40:18 -03:00
|
|
|
#define AA_CLASS_NS 21
|
2012-02-16 08:14:46 -08:00
|
|
|
|
2014-04-23 11:02:25 -07:00
|
|
|
/* defined in libapparmor's apparmor.h #define AA_CLASS_DBUS 32 */
|
2012-02-16 08:14:46 -08:00
|
|
|
#define AA_CLASS_X 33
|
|
|
|
|
|
|
|
#endif /* __AA_POLICYDB_H */
|