blob: d8d224038188409bd36c9b21e14ff86e73dc9063 [file] [log] [blame]
Nick Kralevich4be31902014-07-01 13:59:50 -07001# Input selectors:
Stephen Smalley2dd4e512012-01-04 12:33:27 -05002# isSystemServer (boolean)
Stephen Smalleyff4db912014-09-15 15:16:06 -04003# isOwner (boolean)
Stephen Smalley2dd4e512012-01-04 12:33:27 -05004# user (string)
5# seinfo (string)
6# name (string)
Stephen Smalley6139de52014-02-19 10:54:41 -05007# path (string)
Jeff Vander Stoepee9c0b52015-10-05 09:15:04 -07008# isPrivApp (boolean)
Stephen Smalley2dd4e512012-01-04 12:33:27 -05009# isSystemServer=true can only be used once.
Stephen Smalleydd31ddf2012-07-27 17:08:21 -040010# An unspecified isSystemServer defaults to false.
Stephen Smalleyff4db912014-09-15 15:16:06 -040011# isOwner=true will only match for the owner/primary user.
12# isOwner=false will only match for secondary users.
13# If unspecified, the entry can match either case.
Stephen Smalley2dd4e512012-01-04 12:33:27 -050014# An unspecified string selector will match any value.
15# A user string selector that ends in * will perform a prefix match.
Stephen Smalley3ac1d262012-09-24 10:16:03 -040016# user=_app will match any regular app UID.
17# user=_isolated will match any isolated service UID.
Jeff Vander Stoepee9c0b52015-10-05 09:15:04 -070018# isPrivApp=true will only match for applications preinstalled in
19# /system/priv-app.
Stephen Smalley2dd4e512012-01-04 12:33:27 -050020# All specified input selectors in an entry must match (i.e. logical AND).
21# Matching is case-insensitive.
Nick Kralevich4be31902014-07-01 13:59:50 -070022#
Stephen Smalley2dd4e512012-01-04 12:33:27 -050023# Precedence rules:
24# (1) isSystemServer=true before isSystemServer=false.
Stephen Smalleyff4db912014-09-15 15:16:06 -040025# (2) Specified isOwner= before unspecified isOwner= boolean.
26# (3) Specified user= string before unspecified user= string.
27# (4) Fixed user= string before user= prefix (i.e. ending in *).
28# (5) Longer user= prefix before shorter user= prefix.
29# (6) Specified seinfo= string before unspecified seinfo= string.
Jeff Vander Stoepee9c0b52015-10-05 09:15:04 -070030# ':' character is reserved and may not be used.
Stephen Smalleyff4db912014-09-15 15:16:06 -040031# (7) Specified name= string before unspecified name= string.
32# (8) Specified path= string before unspecified path= string.
Jeff Vander Stoepee9c0b52015-10-05 09:15:04 -070033# (9) Specified isPrivApp= before unspecified isPrivApp= boolean.
Stephen Smalley2dd4e512012-01-04 12:33:27 -050034#
35# Outputs:
36# domain (string)
37# type (string)
Stephen Smalley38084142012-11-28 10:46:18 -050038# levelFrom (string; one of none, all, app, or user)
Stephen Smalley2dd4e512012-01-04 12:33:27 -050039# level (string)
40# Only entries that specify domain= will be used for app process labeling.
41# Only entries that specify type= will be used for app directory labeling.
Stephen Smalley38084142012-11-28 10:46:18 -050042# levelFrom=user is only supported for _app or _isolated UIDs.
43# levelFrom=app or levelFrom=all is only supported for _app UIDs.
Nick Kralevich4be31902014-07-01 13:59:50 -070044# level may be used to specify a fixed level for any UID.
Stephen Smalley2dd4e512012-01-04 12:33:27 -050045#
William Roberts81e1f902015-06-03 21:57:47 -070046#
47# Neverallow Assertions
48# Additional compile time assertion checks can be added as well. The assertion
49# rules are lines beginning with the keyword neverallow. Full support for PCRE
50# regular expressions exists on all input and output selectors. Neverallow
51# rules are never output to the built seapp_contexts file. Like all keywords,
52# neverallows are case-insensitive. A neverallow is asserted when all key value
53# inputs are matched on a key value rule line.
54#
55
56# only the system server can be in system_server domain
57neverallow isSystemServer=false domain=system_server
58neverallow isSystemServer="" domain=system_server
59
60# system domains should never be assigned outside of system uid
61neverallow user=((?!system).)* domain=system_app
62neverallow user=((?!system).)* type=system_app_data_file
63
64# anything with a non-known uid with a specified name should have a specified seinfo
65neverallow user=_app name=.* seinfo=""
66neverallow user=_app name=.* seinfo=default
67
68# neverallow shared relro to any other domain
69# and neverallow any other uid into shared_relro
70neverallow user=shared_relro domain=((?!shared_relro).)*
71neverallow user=((?!shared_relro).)* domain=shared_relro
72
73# neverallow non-isolated uids into isolated_app domain
74# and vice versa
75neverallow user=_isolated domain=((?!isolated_app).)*
76neverallow user=((?!_isolated).)* domain=isolated_app
77
78# uid shell should always be in shell domain, however non-shell
79# uid's can be in shell domain
80neverallow user=shell domain=((?!shell).)*
81
Alex Klyubin1fdee112013-09-13 15:59:04 -070082isSystemServer=true domain=system_server
William Roberts92dfa312014-09-29 10:29:48 -070083user=system seinfo=platform domain=system_app type=system_app_data_file
84user=bluetooth seinfo=platform domain=bluetooth type=bluetooth_data_file
85user=nfc seinfo=platform domain=nfc type=nfc_data_file
86user=radio seinfo=platform domain=radio type=radio_data_file
Nick Kralevichb5ffbb72015-01-07 13:52:43 -080087user=shared_relro domain=shared_relro
William Roberts92dfa312014-09-29 10:29:48 -070088user=shell seinfo=platform domain=shell type=shell_data_file
Stephen Smalleya8337632014-09-11 14:07:28 -040089user=_isolated domain=isolated_app levelFrom=user
90user=_app seinfo=platform domain=platform_app type=app_data_file levelFrom=user
Jeff Vander Stoepee9c0b52015-10-05 09:15:04 -070091user=_app isPrivApp=true domain=priv_app type=app_data_file levelFrom=user
Stephen Smalleya8337632014-09-11 14:07:28 -040092user=_app domain=untrusted_app type=app_data_file levelFrom=user