PATH:
usr
/
lib64
/
python3.9
/
site-packages
/
setools
# Copyright 2016, Tresys Technology, LLC # # SPDX-License-Identifier: LGPL-2.1-only # import logging import re from typing import Iterable from .descriptors import CriteriaDescriptor, CriteriaSetDescriptor from .policyrep import Bounds, BoundsRuletype from .query import PolicyQuery from .util import match_regex class BoundsQuery(PolicyQuery): """ Query *bounds statements. Parameter: policy The policy to query. Keyword Parameters/Class attributes: ruletype The rule type(s) to match. """ ruletype = CriteriaSetDescriptor(enum_class=BoundsRuletype) parent = CriteriaDescriptor("parent_regex") parent_regex: bool = False child = CriteriaDescriptor("child_regex") child_regex: bool = False def __init__(self, policy, **kwargs) -> None: super(BoundsQuery, self).__init__(policy, **kwargs) self.log = logging.getLogger(__name__) def results(self) -> Iterable[Bounds]: """Generator which yields all matching *bounds statements.""" self.log.info("Generating bounds results from {0.policy}".format(self)) self.log.debug("Ruletypes: {0.ruletype}".format(self)) self.log.debug("Parent: {0.parent!r}, regex: {0.parent_regex}".format(self)) self.log.debug("Child: {0.child!r}, regex: {0.child_regex}".format(self)) for b in self.policy.bounds(): if self.ruletype and b.ruletype not in self.ruletype: continue if self.parent and not match_regex( b.parent, self.parent, self.parent_regex): continue if self.child and not match_regex( b.child, self.child, self.child_regex): continue yield b
[-] netifconquery.py
[edit]
[-] constraintquery.py
[edit]
[-] terulequery.py
[edit]
[-] permmap.py
[edit]
[-] py.typed
[edit]
[-] nodeconquery.py
[edit]
[+]
checker
[-] util.py
[edit]
[-] perm_map
[edit]
[-] typequery.py
[edit]
[-] commonquery.py
[edit]
[-] defaultquery.py
[edit]
[-] pirqconquery.py
[edit]
[-] policyrep.pyi
[edit]
[-] ioportconquery.py
[edit]
[-] ibpkeyconquery.py
[edit]
[-] pcideviceconquery.py
[edit]
[-] ibendportconquery.py
[edit]
[-] __init__.py
[edit]
[+]
diff
[-] policyrep.cpython-39-x86_64-linux-gnu.so
[edit]
[-] categoryquery.py
[edit]
[-] genfsconquery.py
[edit]
[-] polcapquery.py
[edit]
[-] boundsquery.py
[edit]
[-] objclassquery.py
[edit]
[-] boolquery.py
[edit]
[-] userquery.py
[edit]
[-] rolequery.py
[edit]
[+]
..
[-] descriptors.py
[edit]
[-] iomemconquery.py
[edit]
[-] dta.py
[edit]
[-] sensitivityquery.py
[edit]
[-] fsusequery.py
[edit]
[-] portconquery.py
[edit]
[-] typeattrquery.py
[edit]
[-] rbacrulequery.py
[edit]
[-] mlsrulequery.py
[edit]
[+]
__pycache__
[-] exception.py
[edit]
[-] devicetreeconquery.py
[edit]
[-] initsidquery.py
[edit]
[-] mixins.py
[edit]
[-] infoflow.py
[edit]
[-] query.py
[edit]