selinux/libsepol/include/sepol
Richard Haines 9eefe11b3a libsepol: V1 Allow constraint denials to be determined.
Adds policy source defined 'type' or 'typeattribute' names to
constraints by adding additional structures (->type_names->types) to a
binary policy.
Before this change all typeattributes were expanded to lists of types
and added to the constraint under ->names. This made it difficult for
system admins to determine from the policy source what attribute
needed to be updated. To facilitate analysis of constraint failures
a new function has also been added, see sepol_compute_av_reason_buffer.

As additional structures have been added to policy, the policy version
is also updated (POLICYDB_VERSION_CONSTRAINT_NAMES). There is also a
corresponding kernel patch to handle the additional structures.

sepol_compute_av_reason_buffer is an extended version of
sepol_compute_av_reason. This will return a buffer with constraint
expression information, containing the constrain type, class, perms,
keywords etc.. It will also contain which constraint expr failed plus
the final outcome. The buffer MUST be free'd with free(3).

The type information output by sepol_compute_av_reason_buffer depends on
the policy version:
If >= POLICYDB_VERSION_CONSTRAINT_NAMES, then the output will be
whatever was in the original policy (type or attribute names).
If < POLICYDB_VERSION_CONSTRAINT_NAMES, then the output will be
the types listed in the constraint (as no attribute information is
available in these versions).
For users and roles whatever policy version, only the names are listed
(as role attributes are not currently held in the constraint).

Also added are two functions that obtain the class and permissions
from a binary policy file that has been loaded for testing:
sepol_string_to_security_class
sepol_string_to_av_perm

Signed-off-by: Richard Haines <richard_c_haines@btinternet.com>
2013-10-29 08:49:51 -04:00
..
policydb libsepol: V1 Allow constraint denials to be determined. 2013-10-29 08:49:51 -04:00
boolean_record.h initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
booleans.h initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
context_record.h initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
context.h initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
debug.h initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
errcodes.h initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
handle.h libsepol: libsemanage: policycoreutils: Create a new preserve_tunables flag in sepol_handle_t. 2011-09-16 11:54:02 -04:00
iface_record.h initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
interfaces.h initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
module.h initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
node_record.h initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
nodes.h initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
policydb.h initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
port_record.h initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
ports.h initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
roles.h initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
sepol.h initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
user_record.h initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
users.h initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00