Skip to content
Snippets Groups Projects
  1. Jun 17, 2014
  2. Apr 04, 2014
    • Stephen Smalley's avatar
      Treat seinfo=default name=<anything> as an error. · f4fa7567
      Stephen Smalley authored
      
      check_app already checks for usage of name= entries
      in seapp_contexts with no seinfo= specification to
      link it back to a signer in mac_permissions.xml.
      However, one can avoid this error by specifying
      a seinfo=default which merely matches the default
      stanza of mac_permissions.xml without actually ensuring
      that it is tied to a specific certificate.  Catch
      that error case too.
      
      Change-Id: If33cf21501e8bfee44d31c92b6341dfa583552b2
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      f4fa7567
  3. Apr 01, 2014
  4. Mar 25, 2014
  5. Mar 12, 2014
    • Robert Craig's avatar
      Introduce post_process_mac_perms script. · 3e70d479
      Robert Craig authored
      
      usage: post_process_mac_perms [-h] -s SEINFO -d DIR -f POLICY
      
      Tool to help modify an existing mac_permissions.xml with additional app certs
      not already found in that policy. This becomes useful when a directory
      containing apps is searched and the certs from those apps are added to the
      policy not already explicitly listed.
      
      optional arguments:
        -h, --help            show this help message and exit
        -s SEINFO, --seinfo SEINFO
                              seinfo tag for each generated stanza
        -d DIR, --dir DIR     Directory to search for apks
        -f POLICY, --file POLICY
                              mac_permissions.xml policy file
      
      Change-Id: Ifbaca3b3120874a567d3f22eb487de1aa8bda796
      Signed-off-by: default avatarrpcraig <rpcraig@tycho.ncsc.mil>
      3e70d479
  6. Feb 19, 2014
    • Stephen Smalley's avatar
      Add support for and use new path= specifier in seapp_contexts. · 6139de50
      Stephen Smalley authored
      
      Extend check_seapp to accept the use of the new path= specifier
      in seapp_contexts and use it to ensure proper labeling of the cache
      subdirectory of com.android.providers.downloads for restorecon.
      
      After this change, restorecon /data/data/com.android.providers.downloads/cache
      does not change the context, leaving it in download_file rather than
      relabeling it to platform_app_data_file.
      
      Depends on Iddaa3931cfd4ddd5b9f62cd66989e1f26553baa1.
      
      Change-Id: Ief65b8c8dcb44ec701d53e0b58c52d6688cc2a14
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      6139de50
  7. Nov 19, 2013
    • Stephen Smalley's avatar
      Add support for duplicate allow rule detection (-D / --dups). · bec54f42
      Stephen Smalley authored
      
      Usage:
      sepolicy-analyze -D -P out/target/product/<board>/root/sepolicy
      
      Displays duplicate allow rules, i.e. pairs of allow rules that grant
      the same permissions where one allow rule is written directly in terms
      of individual types and the other is written in terms of attributes
      associated with those same types.  The rule with individual types is
      a candidate for removal.  The rule with individual types may be directly
      represented in the source policy or may be a result of expansion of
      a type negation (e.g. domain -foo -bar is expanded to individual allow
      rules by the policy compiler).  Domains with unconfineddomain will
      typically have such duplicate rules as a natural side effect and can
      be ignored.
      
      Also add a tools/README with a description of all of the tools.
      
      Change-Id: I07838dbd22c5cc8a4a65b57003ccae38129050f5
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      bec54f42
  8. Nov 01, 2013
  9. Oct 31, 2013
    • Nick Kralevich's avatar
      Revert -Wall -Werror · 2d8a4237
      Nick Kralevich authored
      Temporarily revert -Wall -Werror on checkseapp.
      This is causing a compiler error on darwin SDK builds.
      
      cc1: warnings being treated as errors
      external/sepolicy/tools/check_seapp.c: In function 'rule_map_free':
      external/sepolicy/tools/check_seapp.c:439: warning: unused parameter 's'
      make: *** [out/host/darwin-x86/obj/EXECUTABLES/checkseapp_intermediates/check_seapp.o] Error 1
      
      Change-Id: I9776777a751f16d5ca0d90e731482c31dac813f9
      2d8a4237
    • Stephen Smalley's avatar
      Add sepolicy-analyze tool. · 7b2bee99
      Stephen Smalley authored
      
      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: default avatarStephen Smalley <sds@tycho.nsa.gov>
      7b2bee99
  10. Oct 16, 2013
  11. Oct 15, 2013
    • William Roberts's avatar
      tools: drop unused field in struct · d1f1070a
      William Roberts authored
      check_seapp at one point in time switch from a home implementation
      of a hash table to using GLIBC search.h routines. A struct in one
      of the fields was never removed during this transition.
      
      Change-Id: I65c028103ffe90fa52e0b3c9fce28124ed9c7ff9
      d1f1070a
  12. Oct 14, 2013
    • William Roberts's avatar
      tools: Strengthen BEGIN/END CERTIFICATE checks · 14138335
      William Roberts authored
      insertkeys.py used beginswith() when checking that the BEGIN
      and END CERTIFICATE clauses in PEM files were correct. It should
      have done an explicit check on equality.
      
      Change-Id: I5efb48d180bc674e6281a26a955acd248588b8bd
      14138335
  13. Oct 10, 2013
    • Mike Palmiotto's avatar
      tools: Don't error out of insertkeys script on whitespace · 070c01f8
      Mike Palmiotto authored
      Many keys end with whitespace or otherwise have whitespace separating the
      certificates.  If insertkeys is intended to support multiple certificates, we
      should also support blank line separators.
      
      Change-Id: I5fd17be5785ad1b89a6191e9ba33bbc7c5a4e8e9
      070c01f8
  14. Oct 08, 2013
    • William Roberts's avatar
      tools: Correct insert keys behavior on pem files · 1ecb4e8a
      William Roberts authored
      Insert keys would erroneously process pem files
      with openssl headers in them. Also, the tool would
      be fooled into attempting to use pem files that
      had private keys and other things in the format.
      This patch strengthens the formatting requirements
      and increases the verboseness of error messages
      when processing pem files.
      
      Change-Id: I03353faaa641233a000d1a18943024ae47c63e0f
      1ecb4e8a
  15. Sep 12, 2013
  16. Aug 23, 2013
  17. Aug 08, 2013
  18. Apr 29, 2013
  19. Apr 20, 2013
  20. Mar 29, 2013
  21. Mar 28, 2013
  22. Mar 27, 2013
  23. Mar 26, 2013
  24. Mar 20, 2013
    • Stephen Smalley's avatar
      Generalize levelFromUid support. · 38084146
      Stephen Smalley authored
      
      Introduce a levelFrom=none|app|user|all syntax for specifying
      per-app, per-user, or per-combination level assignment.
      levelFromUid=true|false remains valid syntax but is deprecated.
      levelFromUid=true is equivalent to levelFrom=app.
      
      Update check_seapp to accept the new syntax.
      Update seapp_contexts to document the new syntax and switch
      from levelFromUid=true to levelFrom=app.  No change in behavior.
      
      Change-Id: Ibaddeed9bc3e2586d524efc2f1faa5ce65dea470
      Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
      38084146
  25. Mar 19, 2013
  26. Dec 08, 2012
  27. Nov 27, 2012
  28. Nov 01, 2012
Loading