- Mar 11, 2015
-
-
Stephen Smalley authored
Implement the booleans test in sepolicy-analyze so that we can move the no-booleans check from the SELinuxTest to the SELinuxHostTest along with the other policy checks. Change-Id: I95d7ad34da10c354470f43734d34a6ec631a7b4e Signed-off-by:
Stephen Smalley <sds@tycho.nsa.gov>
-
- Feb 24, 2015
-
-
Stephen Smalley authored
SELinux policy booleans are prohibited in AOSP, so we can drop the support for the sebool= input selector. Change-Id: I5ae31247b2f68d90f6ae4c8830458f22c4ffc854 Signed-off-by:
Stephen Smalley <sds@tycho.nsa.gov>
-
Stephen Smalley authored
Presently it ignores duplicate keys in seapp_contexts entries, e.g. if you were to specify: user=system seinfo=platform user=bluetooth domain=system_app type=system_app_data_file checkseapp would ignore the duplicate and libselinux would end up using the last value defined for the key in each line. Change-Id: I18cadb0c1bf5a907e6fc6513df65aafed91d76fe Signed-off-by:
Stephen Smalley <sds@tycho.nsa.gov>
-
- Feb 13, 2015
-
-
Stephen Smalley authored
Presently it only detects complete duplicates if you specify -s (strict), which is not used in the external/sepolicy Makefile, and it allows overriding earlier entries that have the same input selectors (e.g. user=, seinfo=) with different values for the output selectors (e.g. domain=, type=). Thus, a device/<vendor>/<board>/sepolicy/seapp_contexts file can override the external/sepolicy definitions, and even a single seapp_contexts file can contain duplicated or conflicting definitions. Make it always check strictly, and prohibit either duplicates on the input selectors (i.e. overrides) or complete duplicates (redundant). Change-Id: Id1e38133cbe31b796253101cfe3b111d1826bc8c Signed-off-by:
Stephen Smalley <sds@tycho.nsa.gov>
-
- Feb 06, 2015
-
-
dcashman authored
Also, divide each sepolicy-analyze function into its own component for simplified command-line parsing and potentially eventual modularization. Bug: 18005561 Cherry-pick of commit: ef4fd306 with commit: 47c14611 squashed in. Bug: 19191637 Change-Id: Id66cad549b7311a6bbd92fd64b6ec2c60d0433a4
-
- Feb 05, 2015
-
-
Stephen Smalley authored
See NEVERALLOW CHECKING in tools/README for documentation. Depends on change I45b3502ff96b1d093574e1fecff93a582f8d00bd for libsepol to support reporting all neverallow failures. Cherry-pick of commit: 59906bf8 with build-fix from commit: 74bbf703 added manually. Bug: 19191637 Change-Id: I1c18fa854b3c5f5e05d5dc42d9006c5fdacebdc3 Signed-off-by:
Stephen Smalley <sds@tycho.nsa.gov>
-
- Dec 22, 2014
-
-
dcashman authored
Commit dc0ab516f11d8e2c413315e733e25a41ba468e4f changed the libsepol structures on which sepolicy-analyze relies so that it could be compiled as a C++ library. Reflect this change in sepolicy-analyze. Change-Id: I7da601767c3a4ebed7274e33304d8b589a9115fe
-
- Dec 01, 2014
-
-
William Roberts authored
host C: sepolicy-analyze <= external/sepolicy/tools/sepolicy-analyze/sepolicy-analyze.c external/sepolicy/tools/sepolicy-analyze/sepolicy-analyze.c: In function 'usage': external/sepolicy/tools/sepolicy-analyze/sepolicy-analyze.c:30:5: error: 'for' loop initial declarations are only allowed in C99 mode external/sepolicy/tools/sepolicy-analyze/sepolicy-analyze.c:30:5: note: use option -std=c99 or -std=gnu99 to compile your code make: *** [out/host/linux-x86/obj/EXECUTABLES/sepolicy-analyze_intermediates/sepolicy-analyze.o] Error 1 Change-Id: I9222e447b032d051c251c9718e2b8d5ffb9e9c35
-
- Nov 20, 2014
-
-
Narayan Kamath authored
Just remove unused variables instead of making them refer to the wrong statics. Change-Id: I314bfe91b7912f7d8c9cba7dd55a76d72c879a51
-
Narayan Kamath authored
Introduced by the merge conflict resolution for 3a1eb33b. Change-Id: Iddbc9e4d83c513d7003102f881793b5b7945566c
-
- Nov 19, 2014
-
-
dcashman authored
Also, divide each sepolicy-analyze function into its own component for simplified command-line parsing and potentially eventual modularization. Bug: 18005561 Cherry-pick from: https://android-review.googlesource.com/#/c/111626/ Change-Id: I751a99feffe820308ec58514fdba4cdef184d964
-
- Nov 13, 2014
-
-
Stephen Smalley authored
See NEVERALLOW CHECKING in tools/README for documentation. Depends on change I45b3502ff96b1d093574e1fecff93a582f8d00bd for libsepol to support reporting all neverallow failures. Change-Id: I47c16ccb910ac730c092cb3ab977c59cb8197ce0 Signed-off-by:
Stephen Smalley <sds@tycho.nsa.gov>
-
- Oct 31, 2014
-
-
dcashman authored
Also, divide each sepolicy-analyze function into its own component for simplified command-line parsing and potentially eventual modularization. Bug: 18005561 Change-Id: I45fa07d776cf1bec7d60dba0c03ee05142b86c19
-
- Oct 15, 2014
-
-
Nick Kralevich authored
1 warning generated. external/sepolicy/tools/sepolicy-analyze.c:446:27: error: implicit declaration of function 'isspace' is invalid in C99 [-Werror,-Wimplicit-function-declaration] while (p < end && isspace(*p)) ^ 1 error generated. make: *** [out/host/darwin-x86/obj32/EXECUTABLES/sepolicy-analyze_intermediates/sepolicy-analyze.o] Error 1 make: *** Waiting for unfinished jobs.... Change-Id: I250dcef7c726d5b66835dc51c057e472b801aa2c
-
- Oct 14, 2014
-
-
Stephen Smalley authored
See NEVERALLOW CHECKING in tools/README for documentation. Depends on change I45b3502ff96b1d093574e1fecff93a582f8d00bd for libsepol to support reporting all neverallow failures. Change-Id: I47c16ccb910ac730c092cb3ab977c59cb8197ce0 Signed-off-by:
Stephen Smalley <sds@tycho.nsa.gov>
-
- Sep 15, 2014
-
-
Stephen Smalley authored
Enable labeling apps differently depending on whether they are running for the primary user / owner or for a secondary user. Change-Id: I37aa5b183a7a617cce68ccf14510c31dfee4e04d Signed-off-by:
Stephen Smalley <sds@tycho.nsa.gov>
-
- Aug 27, 2014
-
-
dcashman authored
Also enable global reading of kernel policy file. Motivation for this is to allow read access to the kernel version of the binary selinux policy. Bug: 17288791 Change-Id: I1eefb457cea1164a8aa9eeb7683b3d99ee56ca99
-
- Aug 22, 2014
-
-
dcashman authored
Also enable global reading of kernel policy file. Motivation for this is to allow read access to the kernel version of the binary selinux policy. Change-Id: I1eefb457cea1164a8aa9eeb7683b3d99ee56ca99
-
- Jun 17, 2014
-
-
Stephen Smalley authored
We were incorrectly reporting overlapping rules as duplicates. Only report cases where an attribute-based rule is a superset of type-based rule. Also omit self rules as they are often due to expansion of domain self rules by checkpolicy. Change-Id: I27f33cdf9467be5fdb6ce148aa0006d407291833 Signed-off-by:
Stephen Smalley <sds@tycho.nsa.gov>
-
- Apr 04, 2014
-
-
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:
Stephen Smalley <sds@tycho.nsa.gov>
-
- Apr 01, 2014
-
-
Robert Craig authored
When running the post_process_mac_perms script an unneeded newline is appended to modified mac_permissions.xml file. Use sys.stdout.write instead which avoids any formatting when printing. Change-Id: Ib662dab1566299467371389dc236619aec40f5ac Signed-off-by:
rpcraig <rpcraig@tycho.ncsc.mil>
-
- Mar 25, 2014
-
-
Robert Craig authored
Change-Id: Iabda448d252d3b1ce19809c7f5de0dca3942f60c Signed-off-by:
rpcraig <rpcraig@tycho.ncsc.mil>
-
- Mar 12, 2014
-
-
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:
rpcraig <rpcraig@tycho.ncsc.mil>
-
- Feb 19, 2014
-
-
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:
Stephen Smalley <sds@tycho.nsa.gov>
-
- Nov 19, 2013
-
-
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:
Stephen Smalley <sds@tycho.nsa.gov>
-
- Nov 01, 2013
-
-
Robert Craig authored
Also add attribute for a potential unused function argument when dealing with darwin SDK builds. Change-Id: Iefdbecb050cc5fff6036f15413566e10cefa3813
-
- Oct 31, 2013
-
-
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
-
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:
Stephen Smalley <sds@tycho.nsa.gov>
-
- Oct 16, 2013
-
-
William Roberts authored
Change-Id: If4839218b200a0d90bdf7779d2e039719fae85a5
-
William Roberts authored
Modify check_seapp.c to verify that a packagname (name) must be specified with a signing key (seinfo). This will help thwart spoof attacks on the packagename. Change-Id: I8f1aa8a479cb5beb5c3522d85e3181604931ea72
-
- Oct 15, 2013
-
-
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
-
- Oct 14, 2013
-
-
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
-
- Oct 10, 2013
-
-
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
-
- Oct 08, 2013
-
-
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
-
- Sep 12, 2013
-
-
Stephen Smalley authored
$ sepolicy-check -s untrusted_app -t mediaserver -c binder -p call -P out/target/product/manta/root/sepolicy Match found! Also removed loading of initial SIDs as that is not required for this functionality and it leaks memory as it is never freed. valgrind now reports no leaks. Change-Id: Ic7a26fd01c57914e4e96db504d669f5367542a35 Signed-off-by:
Stephen Smalley <sds@tycho.nsa.gov>
-
- Aug 23, 2013
-
-
Geremy Condra authored
This is based on Joshua Brindle's sepolicy-inject. Change-Id: Ie75bd56a2996481592dcfe7ad302b52f381d5b18
-
- Aug 08, 2013
-
-
Richard Haines authored
Currently a path to a key in keys.conf must be fully qualified or have the -d option appended. This fix will allow paths to have environment variables that will be expanded. This will give portability to the entries. For example the following entry will now be resolved correctly: [@NET_APPS] ALL : $ANDROID_BUILD_TOP/device/demo_vendor/demo_dev/security/net_apps.x509.pem Change-Id: If4f169d9ed4f37b6ebd062508de058f3baeafead Signed-off-by:
Richard Haines <richard_c_haines@btinternet.com>
-
- Apr 29, 2013
-
-
William Roberts authored
Change-Id: I3bb4755b86a90414a3912c8099dd7a4389249b24
-
- Apr 20, 2013
-
-
William Roberts authored
Change-Id: Ic040af5cfcd1be22074a691ecdd01e890866bc19
-
- Mar 29, 2013
-
-
Geremy Condra authored
This allows us to better integrate key selection with our existing build process. Change-Id: I6e3eb5fbbfffb8e31c5edcf16f74df7c38abe537
-