From: Joshua Brindle <jbrindle@tresys.com>
To: Luke Kenneth Casson Leighton <lkcl@lkcl.net>
Cc: SE-Linux <selinux@tycho.nsa.gov>
Subject: Re: wish-list item for selinux policy analyss
Date: Thu, 30 Jun 2005 08:53:38 -0400 [thread overview]
Message-ID: <42C3EB52.4000208@tresys.com> (raw)
In-Reply-To: <20050629021349.GA10219@lkcl.net>
Luke Kenneth Casson Leighton wrote:
>dear selinux people,
>
>on my wish-list for selinux is a means to tell, at runtime,
>which avc messages have been utilised. not when - if.
>
>the equivalent of code coverage analysis tools.
>
>i envisage this to be implemented - hand-waving - by a single
>bit which is marked in the in-kernel-memory store of selinux avc
>policy, for reasons of minimising impact on run-time performance
>(i believe that tying something into the avc audit logging
>system, would be too slow).
>
>the reason for this is to be able to fire up a system, run
>it for a while (live) say oh a few months, and then determine
>which bits of the selinux policy.conf have never ever actually
>been used.
>
>track them down, and remove them from the selinux source policy.
>
>... via analysis of the policy.conf, back to the macros from
>whence they came.
>
>l
>
>
Not that I think this is a good idea; many rules are only there for
corner case situations or errors but if you really want to do it you
don't even need a new tool, the existing ones will do just fine.
First add an auditallow * * for all object classes and permissions, then
reload that policy
wait until you have the data you want (6 months should yield a few tb of
logs)
grep granted /wherever/log | sed -e s/granted/denied/ | audit2allow >
somefile
then sediff /etc/selinux/strict/policy/policy.18 somefile
you'll want to diff against the binary since the audit messages will be
the equivalent of an expanded policy
Have fun, you'll probably get 100,000's of rules
you could use apol at this point to track down the rules in the
policy.conf.. tracing back to the macro call that made it will be very
challenging though
Joshua Brindle
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
prev parent reply other threads:[~2005-06-30 12:54 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-29 2:13 wish-list item for selinux policy analyss Luke Kenneth Casson Leighton
2005-06-29 15:27 ` Ivan Gyurdiev
2005-06-29 16:56 ` Casey Schaufler
2005-06-29 17:38 ` Ron Kuris
2005-06-30 1:05 ` Luke Kenneth Casson Leighton
2005-06-30 1:04 ` Casey Schaufler
2005-06-30 11:49 ` Luke Kenneth Casson Leighton
2005-06-30 1:08 ` Luke Kenneth Casson Leighton
2005-06-30 1:10 ` Casey Schaufler
2005-06-30 11:47 ` Luke Kenneth Casson Leighton
2005-06-30 0:37 ` Luke Kenneth Casson Leighton
2005-06-30 7:05 ` Ivan Gyurdiev
2005-06-30 12:16 ` Stephen Smalley
2005-06-30 20:51 ` Luke Kenneth Casson Leighton
2005-06-30 12:53 ` Joshua Brindle [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=42C3EB52.4000208@tresys.com \
--to=jbrindle@tresys.com \
--cc=lkcl@lkcl.net \
--cc=selinux@tycho.nsa.gov \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.