1*2d543d20SAndroid Build Coastguard Worker(type bin_t) 2*2d543d20SAndroid Build Coastguard Worker(type kernel_t) 3*2d543d20SAndroid Build Coastguard Worker(type security_t) 4*2d543d20SAndroid Build Coastguard Worker(type unlabeled_t) 5*2d543d20SAndroid Build Coastguard Worker 6*2d543d20SAndroid Build Coastguard Worker(policycap open_perms) 7*2d543d20SAndroid Build Coastguard Worker(sensitivity s0) 8*2d543d20SAndroid Build Coastguard Worker(sensitivity s1) 9*2d543d20SAndroid Build Coastguard Worker(sensitivityalias s0 sens0) 10*2d543d20SAndroid Build Coastguard Worker(dominance (s0 s1)) 11*2d543d20SAndroid Build Coastguard Worker 12*2d543d20SAndroid Build Coastguard Worker(category c0) 13*2d543d20SAndroid Build Coastguard Worker(category c1) 14*2d543d20SAndroid Build Coastguard Worker(category c2) 15*2d543d20SAndroid Build Coastguard Worker(categoryalias c0 cat0) 16*2d543d20SAndroid Build Coastguard Worker(categoryset cats01 (c0 c1)) 17*2d543d20SAndroid Build Coastguard Worker(categoryorder (c0 c1 c2)) 18*2d543d20SAndroid Build Coastguard Worker(categoryrange catrng02 (c0 c2)) 19*2d543d20SAndroid Build Coastguard Worker 20*2d543d20SAndroid Build Coastguard Worker(sensitivitycategory s0 (catrng02)) 21*2d543d20SAndroid Build Coastguard Worker(sensitivitycategory s1 cats01) 22*2d543d20SAndroid Build Coastguard Worker(sensitivitycategory s1 (c2)) 23*2d543d20SAndroid Build Coastguard Worker 24*2d543d20SAndroid Build Coastguard Worker(level low (s0 (c0))) 25*2d543d20SAndroid Build Coastguard Worker(level high (s1 (c0 c1))) 26*2d543d20SAndroid Build Coastguard Worker(levelrange low_high (low high)) 27*2d543d20SAndroid Build Coastguard Worker 28*2d543d20SAndroid Build Coastguard Worker(permissionset file_perms (execute_no_trans entrypoint execmod open 29*2d543d20SAndroid Build Coastguard Worker audit_access)) 30*2d543d20SAndroid Build Coastguard Worker(class file (execute_no_trans entrypoint execmod open audit_access)) 31*2d543d20SAndroid Build Coastguard Worker(class process (open)) 32*2d543d20SAndroid Build Coastguard Worker(common file (ioctl read write create getattr setattr lock relabelfrom 33*2d543d20SAndroid Build Coastguard Worker relabelto append unlink link rename execute swapon 34*2d543d20SAndroid Build Coastguard Worker quotaon mounton)) 35*2d543d20SAndroid Build Coastguard Worker(classcommon file file) 36*2d543d20SAndroid Build Coastguard Worker 37*2d543d20SAndroid Build Coastguard Worker(classpermissionset file_rw (file (read write getattr setattr lock append))) 38*2d543d20SAndroid Build Coastguard Worker 39*2d543d20SAndroid Build Coastguard Worker(class char (foo transition)) 40*2d543d20SAndroid Build Coastguard Worker(classcommon char file) 41*2d543d20SAndroid Build Coastguard Worker 42*2d543d20SAndroid Build Coastguard Worker(classpermissionset char_w (char (write setattr))) 43*2d543d20SAndroid Build Coastguard Worker 44*2d543d20SAndroid Build Coastguard Worker(classmap files (read)) 45*2d543d20SAndroid Build Coastguard Worker(classmapping files read 46*2d543d20SAndroid Build Coastguard Worker (file (open read getattr)) 47*2d543d20SAndroid Build Coastguard Worker char_w) 48*2d543d20SAndroid Build Coastguard Worker 49*2d543d20SAndroid Build Coastguard Worker(type auditadm_t) 50*2d543d20SAndroid Build Coastguard Worker(type console_t) 51*2d543d20SAndroid Build Coastguard Worker(type console_device_t) 52*2d543d20SAndroid Build Coastguard Worker(type user_tty_device_t) 53*2d543d20SAndroid Build Coastguard Worker(type device_t) 54*2d543d20SAndroid Build Coastguard Worker(type getty_t) 55*2d543d20SAndroid Build Coastguard Worker(type exec_t) 56*2d543d20SAndroid Build Coastguard Worker 57*2d543d20SAndroid Build Coastguard Worker(allow console_t console_device_t file_rw) 58*2d543d20SAndroid Build Coastguard Worker(allow console_t console_device_t (files (read))) 59*2d543d20SAndroid Build Coastguard Worker 60*2d543d20SAndroid Build Coastguard Worker(boolean secure_mode false) 61*2d543d20SAndroid Build Coastguard Worker(boolean console_login true) 62*2d543d20SAndroid Build Coastguard Worker 63*2d543d20SAndroid Build Coastguard Worker 64*2d543d20SAndroid Build Coastguard Worker(sid kernel) 65*2d543d20SAndroid Build Coastguard Worker(sid security) 66*2d543d20SAndroid Build Coastguard Worker(sid unlabeled) 67*2d543d20SAndroid Build Coastguard Worker 68*2d543d20SAndroid Build Coastguard Worker(typeattribute exec_type) 69*2d543d20SAndroid Build Coastguard Worker(typeattribute foo_type) 70*2d543d20SAndroid Build Coastguard Worker(typeattribute bar_type) 71*2d543d20SAndroid Build Coastguard Worker(typeattribute baz_type) 72*2d543d20SAndroid Build Coastguard Worker(typeattributeset exec_type (or bin_t kernel_t)) 73*2d543d20SAndroid Build Coastguard Worker(typeattributeset foo_type (and exec_type kernel_t)) 74*2d543d20SAndroid Build Coastguard Worker(typeattributeset bar_type (xor exec_type foo_type)) 75*2d543d20SAndroid Build Coastguard Worker(typeattributeset baz_type (not bin_t)) 76*2d543d20SAndroid Build Coastguard Worker(typealias bin_t sbin_t) 77*2d543d20SAndroid Build Coastguard Worker(typepermissive device_t) 78*2d543d20SAndroid Build Coastguard Worker(typebounds device_t bin_t) 79*2d543d20SAndroid Build Coastguard Worker(typemember device_t bin_t file exec_t) 80*2d543d20SAndroid Build Coastguard Worker(typetransition device_t console_t file console_device_t) 81*2d543d20SAndroid Build Coastguard Worker 82*2d543d20SAndroid Build Coastguard Worker(rangetransition device_t console_t file low_high) 83*2d543d20SAndroid Build Coastguard Worker 84*2d543d20SAndroid Build Coastguard Worker(nametypetransition some_file device_t console_t file getty_t) 85*2d543d20SAndroid Build Coastguard Worker 86*2d543d20SAndroid Build Coastguard Worker(allow foo_type self (file (execute))) 87*2d543d20SAndroid Build Coastguard Worker(allow bin_t device_t (file (execute))) 88*2d543d20SAndroid Build Coastguard Worker 89*2d543d20SAndroid Build Coastguard Worker(booleanif secure_mode 90*2d543d20SAndroid Build Coastguard Worker (true 91*2d543d20SAndroid Build Coastguard Worker (auditallow device_t exec_t (file (read write))) 92*2d543d20SAndroid Build Coastguard Worker ) 93*2d543d20SAndroid Build Coastguard Worker) 94*2d543d20SAndroid Build Coastguard Worker 95*2d543d20SAndroid Build Coastguard Worker(booleanif console_login 96*2d543d20SAndroid Build Coastguard Worker (true 97*2d543d20SAndroid Build Coastguard Worker (typechange auditadm_t console_device_t file user_tty_device_t) 98*2d543d20SAndroid Build Coastguard Worker (allow getty_t console_device_t (file (getattr open read write append))) 99*2d543d20SAndroid Build Coastguard Worker ) 100*2d543d20SAndroid Build Coastguard Worker (false 101*2d543d20SAndroid Build Coastguard Worker (dontaudit getty_t console_device_t (file (getattr open read write append))) 102*2d543d20SAndroid Build Coastguard Worker ) 103*2d543d20SAndroid Build Coastguard Worker) 104*2d543d20SAndroid Build Coastguard Worker 105*2d543d20SAndroid Build Coastguard Worker(booleanif (not (xor (eq secure_mode console_login) 106*2d543d20SAndroid Build Coastguard Worker (and (or secure_mode console_login) secure_mode ) ) ) 107*2d543d20SAndroid Build Coastguard Worker (true 108*2d543d20SAndroid Build Coastguard Worker (allow bin_t exec_t (file (execute))) 109*2d543d20SAndroid Build Coastguard Worker ) 110*2d543d20SAndroid Build Coastguard Worker) 111*2d543d20SAndroid Build Coastguard Worker 112*2d543d20SAndroid Build Coastguard Worker(tunable allow_execfile true) 113*2d543d20SAndroid Build Coastguard Worker(tunable allow_userexec false) 114*2d543d20SAndroid Build Coastguard Worker 115*2d543d20SAndroid Build Coastguard Worker(tunableif (not (xor (eq allow_execfile allow_userexec) 116*2d543d20SAndroid Build Coastguard Worker (and (or allow_execfile allow_userexec) 117*2d543d20SAndroid Build Coastguard Worker (and allow_execfile allow_userexec) ) ) ) 118*2d543d20SAndroid Build Coastguard Worker (true 119*2d543d20SAndroid Build Coastguard Worker (allow bin_t exec_t (file (execute))) 120*2d543d20SAndroid Build Coastguard Worker ) 121*2d543d20SAndroid Build Coastguard Worker) 122*2d543d20SAndroid Build Coastguard Worker 123*2d543d20SAndroid Build Coastguard Worker(optional allow_rules 124*2d543d20SAndroid Build Coastguard Worker (allow user_t exec_t (bins (execute))) 125*2d543d20SAndroid Build Coastguard Worker) 126*2d543d20SAndroid Build Coastguard Worker 127*2d543d20SAndroid Build Coastguard Worker(dontaudit device_t auditadm_t (file (read))) 128*2d543d20SAndroid Build Coastguard Worker(auditallow device_t auditadm_t (file (open))) 129*2d543d20SAndroid Build Coastguard Worker 130*2d543d20SAndroid Build Coastguard Worker(user system_u) 131*2d543d20SAndroid Build Coastguard Worker(user user_u) 132*2d543d20SAndroid Build Coastguard Worker(userprefix user_u user) 133*2d543d20SAndroid Build Coastguard Worker(userprefix system_u user) 134*2d543d20SAndroid Build Coastguard Worker 135*2d543d20SAndroid Build Coastguard Worker(selinuxuser name user_u low_high) 136*2d543d20SAndroid Build Coastguard Worker(selinuxuserdefault user_u low_high) 137*2d543d20SAndroid Build Coastguard Worker 138*2d543d20SAndroid Build Coastguard Worker(role system_r) 139*2d543d20SAndroid Build Coastguard Worker(role user_r) 140*2d543d20SAndroid Build Coastguard Worker 141*2d543d20SAndroid Build Coastguard Worker(roletype system_r bin_t) 142*2d543d20SAndroid Build Coastguard Worker(roletype system_r kernel_t) 143*2d543d20SAndroid Build Coastguard Worker(roletype system_r security_t) 144*2d543d20SAndroid Build Coastguard Worker(roletype system_r unlabeled_t) 145*2d543d20SAndroid Build Coastguard Worker(roleallow system_r user_r) 146*2d543d20SAndroid Build Coastguard Worker(rolebounds system_r user_r) 147*2d543d20SAndroid Build Coastguard Worker(roletransition system_r bin_t process user_r) 148*2d543d20SAndroid Build Coastguard Worker 149*2d543d20SAndroid Build Coastguard Worker(userrole system_u system_r) 150*2d543d20SAndroid Build Coastguard Worker(userlevel system_u low) 151*2d543d20SAndroid Build Coastguard Worker(userrange system_u low_high) 152*2d543d20SAndroid Build Coastguard Worker(userbounds system_u user_u) 153*2d543d20SAndroid Build Coastguard Worker(userrole user_u user_r) 154*2d543d20SAndroid Build Coastguard Worker(userlevel user_u low) 155*2d543d20SAndroid Build Coastguard Worker(userrange user_u (low low)) 156*2d543d20SAndroid Build Coastguard Worker 157*2d543d20SAndroid Build Coastguard Worker(sidcontext kernel (system_u system_r kernel_t (low high))) 158*2d543d20SAndroid Build Coastguard Worker(sidcontext security (system_u system_r security_t (low high))) 159*2d543d20SAndroid Build Coastguard Worker(sidcontext unlabeled (system_u system_r unlabeled_t (low high))) 160*2d543d20SAndroid Build Coastguard Worker 161*2d543d20SAndroid Build Coastguard Worker(context system_u_bin_t_l2h (system_u system_r bin_t (low high))) 162*2d543d20SAndroid Build Coastguard Worker 163*2d543d20SAndroid Build Coastguard Worker(ipaddr ip_v4 192.25.35.200) 164*2d543d20SAndroid Build Coastguard Worker(ipaddr netmask 192.168.1.1) 165*2d543d20SAndroid Build Coastguard Worker(ipaddr ip_v6 2001:0DB8:AC10:FE01::) 166*2d543d20SAndroid Build Coastguard Worker(ipaddr netmask_v6 2001:0DE0:DA88:2222::) 167*2d543d20SAndroid Build Coastguard Worker 168*2d543d20SAndroid Build Coastguard Worker(filecon "/usr/bin/" "foo" file system_u_bin_t_l2h) 169*2d543d20SAndroid Build Coastguard Worker(filecon "/usr/bin/" "bar" file ()) 170*2d543d20SAndroid Build Coastguard Worker(filecon "/usr/bin/" "baz" any ()) 171*2d543d20SAndroid Build Coastguard Worker(nodecon ip_v4 netmask system_u_bin_t_l2h) 172*2d543d20SAndroid Build Coastguard Worker(nodecon ip_v6 netmask_v6 system_u_bin_t_l2h) 173*2d543d20SAndroid Build Coastguard Worker(portcon udp 25 system_u_bin_t_l2h) 174*2d543d20SAndroid Build Coastguard Worker(portcon tcp 22 system_u_bin_t_l2h) 175*2d543d20SAndroid Build Coastguard Worker(genfscon - "/usr/bin" system_u_bin_t_l2h) 176*2d543d20SAndroid Build Coastguard Worker(netifcon eth0 system_u_bin_t_l2h system_u_bin_t_l2h) ;different contexts? 177*2d543d20SAndroid Build Coastguard Worker(fsuse xattr ext3 system_u_bin_t_l2h) 178*2d543d20SAndroid Build Coastguard Worker 179*2d543d20SAndroid Build Coastguard Worker; XEN 180*2d543d20SAndroid Build Coastguard Worker(pirqcon 256 system_u_bin_t_l2h) 181*2d543d20SAndroid Build Coastguard Worker(iomemcon (0 255) system_u_bin_t_l2h) 182*2d543d20SAndroid Build Coastguard Worker(ioportcon (22 22) system_u_bin_t_l2h) 183*2d543d20SAndroid Build Coastguard Worker(pcidevicecon 345 system_u_bin_t_l2h) 184*2d543d20SAndroid Build Coastguard Worker 185*2d543d20SAndroid Build Coastguard Worker(constrain (files (read)) (not (or (and (eq t1 exec_t) (eq t2 bin_t)) (eq r1 r2)))) 186*2d543d20SAndroid Build Coastguard Worker(constrain char_w (not (or (and (eq t1 exec_t) (eq t2 bin_t)) (eq r1 r2)))) 187*2d543d20SAndroid Build Coastguard Worker 188*2d543d20SAndroid Build Coastguard Worker(constrain (file (read)) (or (and (eq t1 exec_t) (neq t2 bin_t) ) (eq u1 u2) ) ) 189*2d543d20SAndroid Build Coastguard Worker(constrain (file (open)) (dom r1 r2)) 190*2d543d20SAndroid Build Coastguard Worker(constrain (file (open)) (domby r1 r2)) 191*2d543d20SAndroid Build Coastguard Worker(constrain (file (open)) (incomp r1 r2)) 192*2d543d20SAndroid Build Coastguard Worker 193*2d543d20SAndroid Build Coastguard Worker(validatetrans file (eq t1 exec_t)) 194*2d543d20SAndroid Build Coastguard Worker 195*2d543d20SAndroid Build Coastguard Worker(mlsconstrain (file (open)) (not (or (and (eq l1 l2) (eq u1 u2)) (eq r1 r2)))) 196*2d543d20SAndroid Build Coastguard Worker(mlsconstrain (file (open)) (or (and (eq l1 l2) (eq u1 u2)) (neq r1 r2))) 197*2d543d20SAndroid Build Coastguard Worker(mlsconstrain (file (open)) (dom h1 l2)) 198*2d543d20SAndroid Build Coastguard Worker(mlsconstrain (file (open)) (domby l1 h2)) 199*2d543d20SAndroid Build Coastguard Worker(mlsconstrain (file (open)) (incomp l1 l2)) 200*2d543d20SAndroid Build Coastguard Worker 201*2d543d20SAndroid Build Coastguard Worker(mlsvalidatetrans file (domby l1 h2)) 202*2d543d20SAndroid Build Coastguard Worker 203*2d543d20SAndroid Build Coastguard Worker(macro all ((type x)) 204*2d543d20SAndroid Build Coastguard Worker (allow x bin_t (file (execute))) 205*2d543d20SAndroid Build Coastguard Worker) 206*2d543d20SAndroid Build Coastguard Worker(call all (bin_t)) 207*2d543d20SAndroid Build Coastguard Worker 208*2d543d20SAndroid Build Coastguard Worker(type a_t) 209*2d543d20SAndroid Build Coastguard Worker(type b_t) 210*2d543d20SAndroid Build Coastguard Worker(boolean b1 false) 211*2d543d20SAndroid Build Coastguard Worker(tunable tun1 true) 212*2d543d20SAndroid Build Coastguard Worker(macro m ((boolean b)) 213*2d543d20SAndroid Build Coastguard Worker (tunableif tun1 214*2d543d20SAndroid Build Coastguard Worker (true 215*2d543d20SAndroid Build Coastguard Worker (allow a_t b_t (file (write)))) 216*2d543d20SAndroid Build Coastguard Worker (false 217*2d543d20SAndroid Build Coastguard Worker (allow a_t b_t (file (execute))))) 218*2d543d20SAndroid Build Coastguard Worker (booleanif b 219*2d543d20SAndroid Build Coastguard Worker (true 220*2d543d20SAndroid Build Coastguard Worker (allow a_t b_t (file (read)))))) 221*2d543d20SAndroid Build Coastguard Worker 222*2d543d20SAndroid Build Coastguard Worker(call m (b1)) 223*2d543d20SAndroid Build Coastguard Worker 224