Busted by constraints.
Auditing of constraint failures sucks. We are putting out incorrect error messages. Or at least not informative enough to help the user/policy writer to figure out what is wrong.
Yesterday, Another engineer and I spent a lot of time trying to figure out why setfscreatecon was failing. The only indication was the the application was not allowed to created a directory. Of course the allow rule was present in the policy. Eventually we figured out we needed
the privowner priv to get by a constraint. Shouldn't the kernel be reporting a constraint failure. Isn't this going to become a lot more
important with MLS?
Dan
Signature · 4 lines
-- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 11 lines · Daniel J Walsh
Auditing of constraint failures sucks. We are putting out incorrect error messages. Or at least not informative enough to help the user/policy writer to figure out what is wrong.
Yesterday, Another engineer and I spent a lot of time trying to figure out why setfscreatecon was failing. The only indication was the the application was not allowed to created a directory. Of course the allow rule was present in the policy. Eventually we figured out we needed
the privowner priv to get by a constraint. Shouldn't the kernel be
reporting a constraint failure. Isn't this going to become a lot more important with MLS?
The AVC just sees that a given permission was denied, not what component of the policy engine denied it. See "Flask architecture", "policy- flexibility", ...
But nothing prevents you from creating a simple tool linked against libsepol that takes an avc denial and determines which part of the policy caused it. I'd expect that to be part of an audit analysis tool like seaudit, not a change to the kernel.
Signature · 8 lines
Stephen Smalley National Security Agency -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 12 lines · Stephen Smalley
Quoted 8 lines · Daniel J Walsh
Auditing of constraint failures sucks. We are putting out incorrect error messages. Or at least not informative enough to help the user/policy writer to figure out what is wrong.
Yesterday, Another engineer and I spent a lot of time trying to figure out why setfscreatecon was failing. The only indication was the the application was not allowed to created a directory. Of course the allow rule was present in the policy. Eventually we figured out we needed
the privowner priv to get by a constraint. Shouldn't the kernel be reporting a constraint failure. Isn't this going to become a lot more
important with MLS?
Quoted 11 lines
The AVC just sees that a given permission was denied, not what component of the policy engine denied it. See "Flask architecture", "policy- flexibility", ...
But nothing prevents you from creating a simple tool linked against libsepol that takes an avc denial and determines which part of the policy caused it. I'd expect that to be part of an audit analysis tool like seaudit, not a change to the kernel.
Well I would have no idea how to do it, but it is going to be increasingly needed as constraints grow.
Something to tell me the failure is caused by a missing role or constraint would be great. audit2why :^)
Dan
Signature · 4 lines
-- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 7 lines · Daniel J Walsh
Well I would have no idea how to do it, but it is going to be increasingly needed
as constraints grow.Something to tell me the failure is caused by a missing role or constraint would be great.
audit2why :^)
Ok, just committed the two attached patches for libsepol and policycoreutils to introduce an audit2why utility. A sample of the output of audit2why is below from running:
$ /usr/sbin/audit2why < /var/log/audit/audit.log
type=KERNEL msg=audit(1115316525.803:399552): avc: denied { getattr } for path=/home/sds dev=hda5 ino=1175041 scontext=root:secadm_r:secadm_t:s0-s9:c0.c127 tcontext=user_u:object_r:user_home_dir_t:s0 tclass=dir
Was caused by:
Missing TE allow rule for the type pair (use audit2allow).
type=KERNEL msg=audit(1115320071.648:606858): avc: denied { append } for name=.bash_history dev=hda5 ino=1175047 scontext=user_u:user_r:user_t:s1-s9:c0.c127 tcontext=user_u:object_r:user_home_t:s0 tclass=file
Was caused by:
Constraint violation (add type attribute to domain to satisfy constraints or alter constraint).
Signature · 2 lines
Stephen Smalley National Security Agency
Index: selinux-usr/libsepol/ChangeLog
libsepol/ChangeLog renamed from libsepol/ChangeLog:1.27 +3 -0
@@ -1,3 +1,6 @@ +1.5.7 2005-05-13 + * Added sepol_compute_av_reason() for audit2why. + 1.5.6 2005-04-25 * Fixed bug in role hierarchy checker.
Index: selinux-usr/libsepol/VERSION
libsepol/VERSION renamed from libsepol/VERSION:1.22 +1 -1
@@ -1 +1 @@ -1.5.6 +1.5.7
Index: selinux-usr/libsepol/libsepol.spec
libsepol/libsepol.spec renamed from libsepol/libsepol.spec:1.24 +1 -1
@@ -1,6 +1,6 @@ Summary: SELinux binary policy manipulation library Name: libsepol -Version: 1.5.6 +Version: 1.5.7 Release: 1 License: GPL Group: System Environment/Libraries
Index: selinux-usr/libsepol/include/sepol/services.h
libsepol/include/sepol/services.h renamed from libsepol/include/sepol/services.h:1.3 +12 -0
@@ -40,6 +40,18 @@access_vector_t requested,/* IN */ struct av_decision *avd); /* OUT */ +/* Same as above, but also return the reason(s) for any +denials of the requested permissions. */ +#define SEPOL_COMPUTEAV_TE 1 +#define SEPOL_COMPUTEAV_CONS 2 +#define SEPOL_COMPUTEAV_RBAC 4 +int sepol_compute_av_reason (security_id_t ssid, +security_id_t tsid, +security_class_t tclass, +access_vector_t requested, +struct av_decision *avd, +unsigned int *reason); +/* * Compute a SID to use for labeling a new object in the * class `tclass' based on a SID pair.
Index: selinux-usr/libsepol/src/services.c
libsepol/src/services.c renamed from libsepol/src/services.c:1.10 +40 -13
120 lines not on this page · raw message
Index: selinux-usr/policycoreutils/ChangeLog
policycoreutils/ChangeLog renamed from policycoreutils/ChangeLog:1.112 +3 -0
@@ -1,3 +1,6 @@ +1.23.8 2005-05-13 + * Added audit2why utility. + 1.23.7 2005-04-29 * Merged patch for fixfiles from Dan Walsh. Allow passing -F to force reset of customizable contexts.
Index: selinux-usr/policycoreutils/Makefile
policycoreutils/Makefile renamed from policycoreutils/Makefile:1.6 +1 -1
@@ -1,4 +1,4 @@ -SUBDIRS=setfiles load_policy newrole run_init restorecon audit2allow scripts po sestatus +SUBDIRS=setfiles load_policy newrole run_init restorecon audit2allow audit2why scripts po sestatus all install relabel clean: @for subdir in $(SUBDIRS); do \
Index: selinux-usr/policycoreutils/VERSION
policycoreutils/VERSION renamed from policycoreutils/VERSION:1.51 +1 -1
@@ -1 +1 @@ -1.23.7 +1.23.8
Index: selinux-usr/policycoreutils/policycoreutils.spec
policycoreutils/policycoreutils.spec renamed from policycoreutils/policycoreutils.spec:1.74 +2 -1
@@ -1,6 +1,6 @@ Summary: SELinux policy core utilities. Name: policycoreutils -Version: 1.23.7 +Version: 1.23.8 Release: 1 License: GPL Group: System Environment/Base
@@ -68,6 +68,7 @@ %{_sbindir}/load_policy %{_bindir}/newrole %{_bindir}/audit2allow +%{_sbindir}/audit2why %{_mandir}/man1/newrole.1.gz %{_mandir}/man1/audit2allow.1.gz %config %{_sysconfdir}/pam.d/newrole
Index: selinux-usr/policycoreutils/audit2why/Makefile
policycoreutils/audit2why/Makefile new file +24 -0
@@ -0,0 +1,24 @@ +# Installation directories. +PREFIX ?= ${DESTDIR}/usr +BINDIR ?= $(PREFIX)/sbin +LIBDIR ?= ${PREFIX}/lib +MANDIR ?= $(PREFIX)/share/man +LOCALEDIR ?= /usr/share/locale + + +CFLAGS = -Werror +override CFLAGS += -Wall -W +LDLIBS += ${LIBDIR}/libsepol.a -lselinux + +TARGETS=audit2why + +all: $(TARGETS) + +install: all + -mkdir -p $(BINDIR) + install -m 755 $(TARGETS) $(SBINDIR) + +clean: + rm -f $(TARGETS) *.o + +relabel:
Index: selinux-usr/policycoreutils/audit2why/audit2why.c
policycoreutils/audit2why/audit2why.c new file +239 -0
239 lines not on this page · raw message
Index: selinux-usr/policycoreutils/load_policy/Makefile
policycoreutils/load_policy/Makefile renamed from policycoreutils/load_policy/Makefile:1.13 +1 -0
@@ -2,6 +2,7 @@ PREFIX ?= ${DESTDIR}/usr SBINDIR ?= $(PREFIX)/sbin MANDIR ?= $(PREFIX)/share/man +LIBDIR ?= ${PREFIX}/lib LOCALEDIR ?= /usr/share/locale CFLAGS = -Werror
Quoted 2 lines · Stephen Smalley
Ok, just committed the two attached patches for libsepol and policycoreutils to introduce an audit2why utility.
In creating audit2why, I ran into the known namespace collision between libsepol and libselinux; they both define the base set of Flask types, with the one set of definitions for security-aware applications running on SELinux and the other set of definitions for the binary policy and the userspace security server code (the latter is only exported by the static libsepol, not the shared library). I worked around the collision temporarily in audit2why.c by not including selinux.h and manually defining function prototypes for the functions from libselinux, but I think we should eliminate the collision by applying the attached script to all *.[chy] files in libsepol and checkpolicy and then applying the attached patch to audit2why. I don't think we want to actually fold the types together, as the libsepol definitions need to stay consistent with the binary policy format whereas the libselinux ones don't need to be fixed size (and in the case of security_id_t we cannot fold them since one is an integer and the other is a struct). Seem reasonable?
Signature · 2 lines
Stephen Smalley National Security Agency
Index: policycoreutils/audit2why/audit2why.c
===================================================================
RCS file: /nfshome/pal/CVS/selinux-usr/policycoreutils/audit2why/audit2why.c,v retrieving revision 1.1
audit2why/audit2why.c +5 -14
@@ -8,22 +8,13 @@#include <limits.h> #include <sepol/sepol.h> #include <sepol/services.h> +#include <selinux/selinux.h> #define AVCPREFIX "avc: denied { "#define SCONTEXT "scontext="#define TCONTEXT "tcontext="#define TCLASS "tclass=" -/* Copied from selinux/selinux.h. -Should be replaced with #include <selinux/selinux.h>, -but first requires elimination of namespace collisions -between libselinux and libsepol. */ -extern const char *selinux_binary_policy_path (void ); -extern security_class_t string_to_security_class (const char *name); -extern access_vector_t string_to_av_perm (security_class_t tclass,const char *name); -extern int security_policyvers (void ); -extern int is_selinux_enabled (void ); -void usage (char *progname,int rc) {fprintf (stderr,"usage: %s [-p policy] < /var/log/audit/audit.log\n" , progname);
@@ -39,10 +30,10 @@ int main(int argc, char **argv)FILE *fp;int opt, rc, set_path =0 ;char *p, *scon, *tcon, *tclassstr, *permstr; -security_id_t ssid, tsid; -security_class_t tclass; -access_vector_t perm, av; -struct av_decision avd; +sepol_security_id_t ssid, tsid; +sepol_security_class_t tclass; +sepol_access_vector_t perm, av; +struct sepol_av_decision avd;unsigned int reason;int vers =0 ;
Quoted 7 lines · Stephen Smalley
In creating audit2why, I ran into the known namespace collision between libsepol and libselinux; they both define the base set of Flask types, with the one set of definitions for security-aware applications running on SELinux and the other set of definitions for the binary policy and the userspace security server code (the latter is only exported by the static libsepol, not the shared library). I worked around the collision temporarily in
audit2why.cby not includingselinux.hand manually
Quoted 8 lines
defining function prototypes for the functions from libselinux, but I think we should eliminate the collision by applying the attached script to all *.[chy] files in libsepol and checkpolicy and then applying the attached patch to audit2why. I don't think we want to actually fold the types together, as the libsepol definitions need to stay consistent with the binary policy format whereas the libselinux ones don't need to be fixed size (and in the case of
security_id_twe cannot fold them since one is an integer and the other is a struct). Seem reasonable?
Ah, there was one duplicated expression in the sed script, but otherwise it yielded the expected result, and the resulting libsepol, checkpolicy, and audit2why all build as expected. Committed to sourceforge CVS.
Signature · 8 lines
Stephen Smalley National Security Agency -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 5 lines · Stephen Smalley
Ok, just committed the two attached patches for libsepol and policycoreutils to introduce an audit2why utility. A sample of the output of audit2why is below from running:
$ /usr/sbin/audit2why < /var/log/audit/audit.log
Quoted 7 lines
type=KERNEL msg=audit(1115316525.803:399552): avc: denied { getattr } for path=/home/sds dev=hda5 ino=1175041 scontext=root:secadm_r:secadm_t:s0-s9:c0.c127 tcontext=user_u:object_r:user_home_dir_t:s0 tclass=dir
Was caused by:
Missing TE allow rule for the type pair (use audit2allow).type=KERNEL msg=audit(1115320071.648:606858): avc: denied { append } for name=.bash_history dev=hda5 ino=1175047 scontext=user_u:user_r:user_t:s1-s9:c0.c127 tcontext=user_u:object_r:user_home_t:s0 tclass=file
Was caused by:
Constraint violation (add type attribute to domain to satisfy constraints or alter constraint).
Further patches to libsepol and audit2why so that audit2why can handle boolean settings and local user definitions properly.
Signature · 2 lines
Stephen Smalley National Security Agency
Index: libsepol/ChangeLog
===================================================================
RCS file: /nfshome/pal/CVS/selinux-usr/libsepol/ChangeLog,v retrieving revision 1.29
ChangeLog +4 -0
@@ -1,3 +1,7 @@ +1.5.9 2005-05-16 + * Added sepol_genbools_policydb and sepol_genusers_policydb for + audit2why. + 1.5.8 2005-05-13 * Added sepol_ prefix to Flask types to avoid namespace collision with libselinux.
Index: libsepol/VERSION
===================================================================
RCS file: /nfshome/pal/CVS/selinux-usr/libsepol/VERSION,v retrieving revision 1.24
VERSION +1 -1
@@ -1 +1 @@ -1.5.8 +1.5.9
Index: libsepol/libsepol.spec
===================================================================
RCS file: /nfshome/pal/CVS/selinux-usr/libsepol/libsepol.spec,v retrieving revision 1.26
libsepol.spec +1 -1
@@ -1,6 +1,6 @@ Summary: SELinux binary policy manipulation library Name: libsepol -Version: 1.5.8 +Version: 1.5.9 Release: 1 License: GPL Group: System Environment/Libraries
Index: libsepol/include/sepol/policydb.h
===================================================================
RCS file: /nfshome/pal/CVS/selinux-usr/libsepol/include/sepol/policydb.h,v retrieving revision 1.8
include/sepol/policydb.h +2 -0
@@ -263,6 +263,8 @@ extern int policydb_index_bools(policydbextern int policydb_index_others (policydb_t * p,unsigned int verbose); +extern int policydb_reindex_users (policydb_t * p); +extern int constraint_expr_destroy (constraint_expr_t * expr);extern void policydb_destroy (policydb_t * p);
Index: libsepol/include/sepol/services.h
===================================================================
RCS file: /nfshome/pal/CVS/selinux-usr/libsepol/include/sepol/services.h,v retrieving revision 1.5
include/sepol/services.h +7 -0
@@ -25,6 +25,13 @@extern int sepol_set_policydb (policydb_t *p);extern int sepol_set_sidtab (sidtab_t *s); +/* Modify a policydb for boolean settings. */ +int sepol_genbools_policydb (policydb_t *policydb,const char *booleans); + +/* Modify a policydb for user settings. */ +int sepol_genusers_policydb (policydb_t *policydb, +const char *usersdir); +/* Load the security policy. This initializes the policydb and sidtab based on the provided binary policy. */ int sepol_load_policy (void * data,size_t len);
Index: libsepol/src/genbools.c
===================================================================
RCS file: /nfshome/pal/CVS/selinux-usr/libsepol/src/genbools.c,v retrieving revision 1.13
src/genbools.c +15 -2
@@ -52,7 +52,7 @@ static int process_boolean(char *buffer,return 1 ; } -static int load_booleans (struct policydb *policydb,char *path) { +static int load_booleans (struct policydb *policydb,const char *path) {FILE *boolf;char *buffer=NULL ;size_t size=0 ;
@@ -64,7 +64,7 @@ static int load_booleans(struct policydb boolf =fopen (path,"r" );if (boolf ==NULL ) -return -1 ; + goto localbool;while (getline (&buffer, &size, boolf) >0 ) {int ret=process_boolean (buffer, name,sizeof (name), &val);
@@ -81,6 +81,7 @@ static int load_booleans(struct policydb } }fclose (boolf); +localbool:snprintf (localbools,sizeof (localbools),"%s.local" , path); boolf =fopen (localbools,"r" );if (boolf !=NULL ) {
@@ -157,6 +158,18 @@ int sepol_genbools(void *data, size_t lereturn -1 ; } +int sepol_genbools_policydb (policydb_t *policydb,const char *booleans) +{ +int rc; + + rc =load_booleans (policydb, booleans); +if (!rc) + rc =evaluate_conds (policydb); +if (rc) + errno =EINVAL ; +return rc; +} +int sepol_genbools_array (void *data,size_t len,char **names,int *values,int nel) {struct policydb policydb;
Index: libsepol/src/genusers.c
===================================================================
RCS file: /nfshome/pal/CVS/selinux-usr/libsepol/src/genusers.c,v retrieving revision 1.11
src/genusers.c +31 -0
@@ -444,3 +444,34 @@ err:policydb_destroy (&policydb);return -1 ; } + +int sepol_genusers_policydb (policydb_t *policydb, +const char *usersdir) +{ +char path[PATH_MAX ]; + +/* Load base set of system users from the policy package. */ +snprintf (path,sizeof path,"%s/system.users" , usersdir); +if (load_users (policydb, path) <0 ) { +__sepol_debug_printf ("%s: Can't load system.users: %s\n" , + __FUNCTION__,strerror (errno)); +return -1 ; + } + +/* Load locally defined users. */ +snprintf (path,sizeof path,"%s/local.users" , usersdir); +if (load_users (policydb, path) <0 ) { +__sepol_debug_printf ("%s: Can't load local.users: %s\n" , + __FUNCTION__,strerror (errno)); +return -1 ; + } + +if (policydb_reindex_users (policydb) <0 ) { +__sepol_debug_printf ("%s: Can't reindex users: %s\n" , + __FUNCTION__,strerror (errno)); +return -1 ; + + } + +return 0 ; +}
Index: libsepol/src/policydb.c
===================================================================
RCS file: /nfshome/pal/CVS/selinux-usr/libsepol/src/policydb.c,v retrieving revision 1.8
src/policydb.c +25 -1
@@ -440,7 +440,6 @@ int policydb_index_others(policydb_t * preturn 0 ; } -/* * The following *_destroy functions are used to * free any memory allocated for each kind of
@@ -1733,5 +1732,30 @@ bad:return -1 ; } +int policydb_reindex_users (policydb_t * p) +{ +unsigned int i =SYM_USERS ; + +if (p->user_val_to_struct) +free (p->user_val_to_struct); +if (p->sym_val_to_name[i]) +free (p->sym_val_to_name[i]); + + p->user_val_to_struct = (user_datum_t **) +malloc (p->p_users.nprim *sizeof (user_datum_t *)); +if (!p->user_val_to_struct) +return -1 ; + + p->sym_val_to_name[i] = (char **) +malloc (p->symtab[i].nprim *sizeof (char *)); +if (!p->sym_val_to_name[i]) +return -1 ; + +if (hashtab_map (p->symtab[i].table, index_f[i], p)) +return -1 ; + +return 0 ; +} +
Index: policycoreutils/ChangeLog
===================================================================
RCS file: /nfshome/pal/CVS/selinux-usr/policycoreutils/ChangeLog,v retrieving revision 1.114
ChangeLog +4 -0
@@ -1,3 +1,7 @@ +1.23.10 2005-05-16 + * Extended audit2why to incorporate booleans and local user + settings when analyzing audit messages. + 1.23.9 2005-05-13 * Updated audit2why for sepol_ prefixes on Flask types to avoid namespace collision with libselinux, and to
Index: policycoreutils/VERSION
===================================================================
RCS file: /nfshome/pal/CVS/selinux-usr/policycoreutils/VERSION,v retrieving revision 1.53
VERSION +1 -1
@@ -1 +1 @@ -1.23.9 +1.23.10
Index: policycoreutils/policycoreutils.spec
===================================================================
RCS file: /nfshome/pal/CVS/selinux-usr/policycoreutils/policycoreutils.spec,v retrieving revision 1.76
policycoreutils.spec +1 -1
@@ -1,6 +1,6 @@ Summary: SELinux policy core utilities. Name: policycoreutils -Version: 1.23.9 +Version: 1.23.10 Release: 1 License: GPL Group: System Environment/Base
Index: policycoreutils/audit2why/audit2why.c
===================================================================
RCS file: /nfshome/pal/CVS/selinux-usr/policycoreutils/audit2why/audit2why.c,v retrieving revision 1.2
audit2why/audit2why.c +66 -14
108 lines not on this page · raw message
I think, this patch is needed to export symbols of newly added libsepol functions.
Also policycoreutils-rhat.patch needed to build on 64 bit platforms, plus some other stuff.
Dan
src/libsepol.map +1 -1
@@ -1,4 +1,4 @@ { - global: sepol_genbools*; sepol_set_policydb_from_file; sepol_check_context; sepol_genusers; sepol_debug; sepol_set_delusers; + global: sepol_genbools*; sepol_set_policydb_from_file; sepol_check_context; sepol_genusers; sepol_debug; sepol_set_delusers; sepol_context_to_sid; sepol_compute_av_reason; local: *; };
audit2why/audit2why.1 +62 -0
62 lines not on this page · raw message
audit2why/Makefile +4 -2
@@ -1,6 +1,6 @@ # Installation directories. PREFIX ?= ${DESTDIR}/usr -BINDIR ?= $(PREFIX)/sbin +BINDIR ?= $(PREFIX)/bin LIBDIR ?= ${PREFIX}/lib MANDIR ?= $(PREFIX)/share/man LOCALEDIR ?= /usr/share/locale
@@ -8,7 +8,7 @@ CFLAGS = -Werror override CFLAGS += -Wall -W -LDLIBS += ${LIBDIR}/libsepol.a -lselinux +LDLIBS += -lsepol -lselinux TARGETS=audit2why
@@ -17,6 +17,8 @@ install: all -mkdir -p $(BINDIR) install -m 755 $(TARGETS) $(BINDIR) + -mkdir -p $(MANDIR)/man1 + install -m 644 audit2why.1 $(MANDIR)/man1/ clean: rm -f $(TARGETS) *.o
scripts/fixfiles +1 -1
@@ -164,7 +164,7 @@ fi # See how we were called. -while getopts "C:Fo:R:l:" i; do +while getopts "C:Ffo:R:l:" i; do case "$i" in f) fullFlag=1
Quoted 2 lines · Daniel J Walsh
I think, this patch is needed to export symbols of newly added libsepol functions.
No. These particular functions are _only_ for the static library and programs that link with it, as they expose too much of the internals of libsepol. Note that audit2why is linked with libsepol.a, not the shared library (prior to your policycoreutils patch). We will not _export_ these symbols via the shared library.
Signature · 8 lines
Stephen Smalley National Security Agency -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 9 lines · Stephen Smalley
Quoted 2 lines · Daniel J Walsh
I think, this patch is needed to export symbols of newly added libsepol functions.
No. These particular functions are _only_ for the static library and programs that link with it, as they expose too much of the internals of libsepol. Note that audit2why is linked with libsepol.a, not the shared library (prior to your policycoreutils patch). We will not _export_ these symbols via the shared library.
Note btw that this is no different than checkpolicy, which also links with the static libsepol.
Signature · 8 lines
Stephen Smalley National Security Agency -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 7 lines · Stephen Smalley
Quoted 3 lines · Daniel J Walsh
I think, this patch is needed to export symbols of newly added libsepol functions.
Quoted 8 lines
No. These particular functions are _only_ for the static library and programs that link with it, as they expose too much of the internals of libsepol. Note that audit2why is linked with libsepol.a, not the shared library (prior to your policycoreutils patch). We will not _export_ these symbols via the shared library.
Ok libdir needs to be passed in via spec file.
Dan
Signature · 4 lines
-- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 5 lines · Daniel J Walsh
I think, this patch is needed to export symbols of newly added libsepol functions.
Also policycoreutils-rhat.patch needed to build on 64 bit platforms, plus some other stuff.
Also, I specifically put it into sbin rather than bin because you need to be able to read the policy and the audit log in order to use it effectively, so it didn't seem overly useful to put it into bin.
Note that the output has changed somewhat with my last patch from the sample messages I posted earlier (that you included into the man page).
Signature · 8 lines
Stephen Smalley National Security Agency -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 3 lines · Stephen Smalley
The AVC just sees that a given permission was denied, not what component of the policy engine denied it. See "Flask architecture", "policy- flexibility", ...
BTW, to elaborate on this point, when a permission check is first made for a given (subject security context, object security context, object security class) triple, the AVC gets a complete access vector (all permission decisions) for that triple from the security server, so the security server does the complete policy computation at that time and never sees subsequent permission checks on the same triple as long as the cache entry isn't evicted. Hence, even if we modified the kernel security server to log a message about the cause when it receives a request for a computation and one of the requested permissions is denied, we'd still never see the causes for denials that are handled
entirely by the AVC using the cached access vector. To support that in
the kernel (vs. creating a utility like audit2why), we'd have to have the kernel security server return a vector of _reasons_ for each denied permission in the access vector to the AVC and have the AVC interpret that vector when generating the audit message. In addition to being rather painful, that also tends to break the desired encapsulation of policy logic within the security server in the kernel (vs. having some policy-aware applications like audit2why).
Signature · 8 lines
Stephen Smalley National Security Agency -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.