platform_system_sepolicy/tools
Stephen Smalley 7b2bee99c1 Add sepolicy-analyze tool.
And also remove the unnecessary references to libselinux for
sepolicy-check, as it has no dependencies on libselinux.
Also enable -Wall -Werror on building all of these tools and
fix up all such errors.

Usage:
$ sepolicy-analyze -e -P out/target/product/<device>/root/sepolicy
or
$ sepolicy-analyze -d -P out/target/product/<device>/root/sepolicy

The first form will display all type pairs that are "equivalent", i.e.
they are identical with respect to allow rules, including indirect allow
rules via attributes and default-enabled conditional rules (i.e. default
boolean values yield a true conditional expression).

Equivalent types are candidates for being coalesced into a single type.
However, there may be legitimate reasons for them to remain separate,
for example:
- the types may differ in a respect not included in the current
analysis, such as default-disabled conditional rules, audit-related
rules (auditallow or dontaudit), default type transitions, or
constraints (e.g. mls), or
- the current policy may be overly permissive with respect to one or the
other of the types and thus the correct action may be to tighten access
to one or the other rather than coalescing them together, or
- the domains that would in fact have different accesses to the types
may not yet be defined or may be unconfined in the policy you are
analyzing (e.g. in AOSP policy).

The second form will display type pairs that differ and the first
difference found between the two types.  This output can be long.

We have plans to explore further enhancements to this tool, including
support for identifying isomorphic types.  That will be required to
identify similar domains since all domains differ in at least their
entrypoint type and in their tmpfs type and thus will never show up as
equivalent even if they are in all other respects identical to each other.

Change-Id: If0ee00188469d2a1e165fdd52f235c705d22cd4e
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2013-10-31 15:12:32 -04:00
..
Android.mk Add sepolicy-analyze tool. 2013-10-31 15:12:32 -04:00
check_seapp.c Add sepolicy-analyze tool. 2013-10-31 15:12:32 -04:00
checkfc.c property_contexts checks added to checkfc. 2013-03-19 22:28:46 +00:00
insertkeys.py tools: Strengthen BEGIN/END CERTIFICATE checks 2013-10-14 15:54:42 -07:00
sepolicy-analyze.c Add sepolicy-analyze tool. 2013-10-31 15:12:32 -04:00
sepolicy-check.c Add sepolicy-analyze tool. 2013-10-31 15:12:32 -04:00