Home
last modified time | relevance | path

Searched refs:refpolicy (Results 1 – 18 of 18) sorted by relevance

/external/selinux/python/sepolgen/tests/
Dtest_refpolicy.py21 import sepolgen.refpolicy as refpolicy namespace
26 s = refpolicy.IdSet(["read", "write", "getattr"])
32 s = refpolicy.IdSet()
38 sc = refpolicy.SecurityContext()
39 sc = refpolicy.SecurityContext("user_u:object_r:foo_t")
43 sc = refpolicy.SecurityContext()
56 sc = refpolicy.SecurityContext()
65 sc = refpolicy.SecurityContext()
69 sc1 = refpolicy.SecurityContext("user_u:object_r:foo_t")
70 sc2 = refpolicy.SecurityContext("user_u:object_r:foo_t")
[all …]
Dtest_interfaces.py25 import sepolgen.refpolicy as refpolicy namespace
34 self.assertEqual(p.type, refpolicy.SRC_TYPE)
49 self.assertEqual(p.type, refpolicy.SRC_TYPE)
50 self.assertEqual(p.obj_classes, refpolicy.IdSet(["file"]))
59 self.assertEqual(p.type, refpolicy.SRC_TYPE)
60 self.assertEqual(p.obj_classes, refpolicy.IdSet(["process"]))
69 self.assertEqual(p.type, refpolicy.SRC_TYPE)
70 self.assertEqual(p.obj_classes, refpolicy.IdSet(["dir"]))
79 self.assertEqual(p.type, refpolicy.TGT_TYPE)
80 self.assertEqual(p.obj_classes, refpolicy.IdSet(["dir"]))
[all …]
Dtest_access.py21 import sepolgen.refpolicy as refpolicy namespace
33 self.assertTrue(isinstance(a.perms, refpolicy.IdSet))
139 b.perms = refpolicy.IdSet(["read"])
143 b.perms = refpolicy.IdSet(["read", "write", "append"])
146 b.perms = refpolicy.IdSet(["read", "append"])
158 rule = refpolicy.AVRule()
180 self.assertEqual(av.perms, refpolicy.IdSet(["read", "write"]))
193 rule = refpolicy.AVRule()
223 self.assertEqual(av.perms, refpolicy.IdSet(["read", "write"]))
238 a.add("$1", "foo", "file", refpolicy.IdSet(["read", "write"]))
[all …]
Dtest_module.py28 mc.create_module_package("module_compile_test.te", refpolicy=True)
32 mc.refpolicy = True
33 mc.create_module_package("module_compile_test.te", refpolicy=False)
Dtest_refparser.py22 import sepolgen.refpolicy as refpolicy namespace
Dtest_audit.py22 import sepolgen.refpolicy
62 sc = sepolgen.refpolicy.SecurityContext()
/external/selinux/python/sepolgen/src/sepolgen/
Drefparser.py40 from . import refpolicy
354 m = refpolicy.ModuleDeclaration()
357 m.refpolicy = True
363 x = refpolicy.Interface(p[4])
371 x = refpolicy.Template(p[4])
402 o = refpolicy.OptionalPolicy()
412 x = refpolicy.TunablePolicy()
438 x = refpolicy.IfDef(p[4])
453 i = refpolicy.InterfaceCall(ifname=p[1])
485 s = refpolicy.ObjPermSet(p[4])
[all …]
Dpolicygen.py33 from . import refpolicy
82 self.module = refpolicy.Module()
125 refpolicy = True
127 refpolicy = False
129 mod.refpolicy = refpolicy
139 m = refpolicy.ModuleDeclaration()
144 m.refpolicy = True
146 m.refpolicy = False
158 rule = refpolicy.AVRule(av)
163 rule.comment = str(refpolicy.Comment(explain_access(av, verbosity=self.explain)))
[all …]
Doutput.py30 from . import refpolicy
51 for node, depth in refpolicy.walktree(self.module, showdepth=True):
97 if isinstance(a, refpolicy.InterfaceCall):
98 if isinstance(b, refpolicy.InterfaceCall):
103 if isinstance(b, refpolicy.AVRule):
120 c.append(refpolicy.Comment())
125 c.append(refpolicy.Comment())
139 if isinstance(rule, refpolicy.InterfaceCall):
146 sep_rules.append(refpolicy.Comment())
148 comment = refpolicy.Comment()
[all …]
Dinterfaces.py28 from . import refpolicy
40 self.type = refpolicy.SRC_TYPE
41 self.obj_classes = refpolicy.IdSet()
58 (self.name, refpolicy.field_to_str[self.type], " ".join(self.obj_classes))
70 if (type == refpolicy.SRC_TYPE or type == refpolicy.TGT_TYPE) and \
71 (p.type == refpolicy.TGT_TYPE or p.type == refpolicy.SRC_TYPE):
88 p.type = refpolicy.SRC_TYPE
145 if __param_insert(av.src_type, refpolicy.SRC_TYPE, av, params) == 1:
149 if __param_insert(av.tgt_type, refpolicy.TGT_TYPE, av, params) == 1:
153 if __param_insert(av.obj_class, refpolicy.OBJ_CLASS, av, params) == 1:
[all …]
Daudit.py23 from . import refpolicy
172 self.scontext = refpolicy.SecurityContext()
173 self.tcontext = refpolicy.SecurityContext()
226 self.scontext = refpolicy.SecurityContext(fields[1])
229 self.tcontext = refpolicy.SecurityContext(fields[1])
308 self.invalid_context = refpolicy.SecurityContext()
309 self.scontext = refpolicy.SecurityContext()
310 self.tcontext = refpolicy.SecurityContext()
319 self.invalid_context = refpolicy.SecurityContext(recs[5])
320 self.scontext = refpolicy.SecurityContext(recs[7].split("=")[1])
[all …]
Daccess.py34 from . import refpolicy
89 self.perms = refpolicy.IdSet()
120 self.perms = refpolicy.IdSet(list[3:])
287 types = refpolicy.IdSet()
300 s = refpolicy.IdSet()
328 role_type = refpolicy.RoleType()
Dmodule.py158 def create_module_package(self, sourcename, refpolicy=True): argument
174 if refpolicy:
Drefpolicy.py569 self.refpolicy = False
572 if self.refpolicy:
/external/selinux/libsepol/tests/
DMakefile51 …../../checkpolicy/checkpolicy -M policies/test-cond/refpolicy-base.conf -o policies/test-downgrade…
/external/selinux/python/audit2allow/
Daudit2allow232 mc.create_module_package(filename, self.__options.refpolicy)
313 if self.__options.refpolicy:
Daudit2why232 mc.create_module_package(filename, self.__options.refpolicy)
313 if self.__options.refpolicy:
/external/selinux/python/sepolgen/
DHACKING17 Reference Policy Representation (sepolgen.refpolicy)