README 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. This directory contains a number of tools related to policy, some of
  2. which are used in building and validating the policy and others are
  3. available for help in auditing and analyzing policy. The tools are
  4. described further below.
  5. build_policies.sh
  6. A tool to build SELinux policy for multiple targets in parallel.
  7. This is useful for quickly testing a new test or neverallow rule
  8. on multiple targets.
  9. Usage:
  10. ./build_policies.sh ~/android/master ~/tmp/build_policies
  11. ./build_policies.sh ~/android/master ~/tmp/build_policies sailfish-eng walleye-eng
  12. checkfc
  13. A utility for checking the validity of a file_contexts or a
  14. property_contexts configuration file. Used as part of the policy
  15. build to validate both files. Requires the sepolicy file as an
  16. argument in order to check the validity of the security contexts
  17. in the file_contexts or property_contexts file.
  18. Usage1:
  19. checkfc sepolicy file_contexts
  20. checkfc -p sepolicy property_contexts
  21. Also used to compare two file_contexts or file_contexts.bin files.
  22. Displays one of subset, equal, superset, or incomparable.
  23. Usage2:
  24. checkfc -c file_contexts1 file_contexts2
  25. Example:
  26. $ checkfc -c out/target/product/shamu/system/etc/general_file_contexts out/target/product/shamu/root/file_contexts.bin
  27. subset
  28. checkseapp
  29. A utility for merging together the main seapp_contexts
  30. configuration and the device-specific one, and simultaneously
  31. checking the validity of the configurations. Used as part of the
  32. policy build process to merge and validate the configuration.
  33. Usage:
  34. checkseapp -p sepolicy input_seapp_contexts0 [input_seapp_contexts1...] -o seapp_contexts
  35. insertkeys.py
  36. A helper script for mapping tags in the signature stanzas of
  37. mac_permissions.xml to public keys found in pem files. This
  38. script is described further in the top-level sepolicy/README.
  39. post_process_mac_perms
  40. A tool to help modify an existing mac_permissions.xml with additional app
  41. certs not already found in that policy. This becomes useful when a directory
  42. containing apps is searched and the certs from those apps are added to the
  43. policy not already explicitly listed.
  44. Usage:
  45. post_process_mac_perms [-h] -s SEINFO -d DIR -f POLICY
  46. -s SEINFO, --seinfo SEINFO seinfo tag for each generated stanza
  47. -d DIR, --dir DIR Directory to search for apks
  48. -f POLICY, --file POLICY mac_permissions.xml policy file
  49. sepolicy-check
  50. A tool for auditing a sepolicy file for any allow rule that grants
  51. a given permission.
  52. Usage:
  53. sepolicy-check -s <domain> -t <type> -c <class> -p <permission> -P out/target/product/<board>/root/sepolicy
  54. sepolicy-analyze
  55. A tool for performing various kinds of analysis on a sepolicy
  56. file.