• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1;; Test anonymous args
2
3(mls true)
4(class CLASS (PERM))
5(classorder (CLASS))
6(sid SID)
7(sidorder (SID))
8(user USER)
9(role ROLE)
10(type TYPE)
11(category CAT)
12(categoryorder (CAT))
13(sensitivity SENS)
14(sensitivityorder (SENS))
15(sensitivitycategory SENS (CAT))
16(allow TYPE self (CLASS (PERM)))
17(roletype ROLE TYPE)
18(userrole USER ROLE)
19(userlevel USER (SENS))
20(userrange USER ((SENS)(SENS (CAT))))
21(sidcontext SID (USER ROLE TYPE ((SENS)(SENS))))
22
23(category c0)
24(category c1)
25(category c2)
26(category c3)
27(categoryorder (CAT c0 c1 c2 c3))
28(categoryset cs01 (c0 c1))
29(categoryset cs03 (range c0 c3))
30
31(sensitivity s0)
32(sensitivity s1)
33(sensitivity s2)
34(sensitivity s3)
35(sensitivityorder (SENS s0 s1 s2 s3))
36
37(sensitivitycategory s0 (cs01 c2 c3))
38(sensitivitycategory s1 (c0 c1 c2 c3))
39(sensitivitycategory s2 (c0 c1 c2 c3))
40(sensitivitycategory s3 (range c0 c3))
41
42(level lvl (s0 (c0)))
43(level lvl0 (s0))
44(level lvl3 (s3 (range c0 c3)))
45
46(levelrange rng ((s0) (s3 (c0 c1 c2 c3))))
47
48(user u1)
49(user u2)
50(user u3)
51(user u4)
52
53(userrole u1 ROLE)
54(userrole u2 ROLE)
55(userrole u3 ROLE)
56(userrole u4 ROLE)
57
58; Test categoryset
59(macro m1 ((user u)(sensitivity s)(categoryset cs))
60  (userlevel u (s (cs)))
61)
62(call m1 (u1 s1 (c0 c1)))
63(call m1 (u2 s2 cs01))
64
65; Test level
66(macro m2 ((user u)(level l))
67  (userlevel u l)
68)
69(call m2 (u3 (s3 (c2))))
70(call m2 (u4 lvl))
71
72; Test levelrange
73(macro m3 ((user u)(levelrange lr))
74  (userrange u lr)
75)
76(call m3 (u1 ((s0) (s3 (range c0 c3)))))
77(call m3 (u2 (lvl0 (s3 (cs03)))))
78(call m3 (u3 (lvl0 lvl3)))
79(call m3 (u4 rng))
80
81; Test ipaddr
82(macro m4 ((user u)(ipaddr nm)(ipaddr ip))
83  (nodecon ip nm (u ROLE TYPE ((s0) (s0))))
84)
85(ipaddr nm1 255.255.255.0)
86(ipaddr ip4 1.2.3.4)
87(call m4 (u1 nm1 192.25.35.200))
88(call m4 (u2 255.255.255.0 ip4))
89
90; Test classpermission
91(type t1)
92(type t2)
93(type t3)
94
95(classpermission cp1)
96(classpermissionset cp1 (CLASS (PERM)))
97
98(classmap cm1 (cm1p))
99(classmapping cm1 cm1p (CLASS (PERM)))
100
101(macro m5 ((type t)(classpermission cp))
102  (allow t self cp)
103)
104(call m5 (t1 (CLASS (PERM))))
105(call m5 (t2 cp1))
106(call m5 (t3 (cm1 (cm1p))))
107