Şuanki Dizin: /lib64/python3.9/site-packages/setools/__pycache__/ |
Şuanki Dosya : //lib64/python3.9/site-packages/setools/__pycache__/rbacrulequery.cpython-39.pyc |
a q�qeW�@s�ddlZddlZddlmZmZmZmZmZddlm Z m Z ddlmZm Z ddlmZmZddlmZmZmZmZddlmZGd d �d e je j�ZdS)�N)�cast�Iterable�Optional�Pattern�Union�)�mixins�query)�CriteriaDescriptor�CriteriaSetDescriptor)�InvalidType�RuleUseError)�AnyRBACRule�RBACRuletype�Role� TypeOrAttr)�match_indirect_regexcseZdZUdZeed�Zedd�ZdZ e ed<dZe ed<dZ eeeeefed <dZe ed <dZe ed<edd �ZdZe ed<edd�ZdZe ed<eeeeeefd�dd��Zejeeeeefdd�dd��Zdd��fdd�Zeed�dd�Z �Z!S)� RBACRuleQuerya� Query the RBAC rules. Parameter: policy The policy to query. Keyword Parameters/Class attributes: ruletype The list of rule type(s) to match. source The name of the source role/attribute to match. source_indirect If true, members of an attribute will be matched rather than the attribute itself. source_regex If true, regular expression matching will be used on the source role/attribute. Obeys the source_indirect option. target The name of the target role/attribute to match. target_indirect If true, members of an attribute will be matched rather than the attribute itself. target_regex If true, regular expression matching will be used on the target role/attribute. Obeys target_indirect option. tclass The object class(es) to match. tclass_regex If true, use a regular expression for matching the rule's object class. default The name of the default role to match. default_regex If true, regular expression matching will be used on the default role. )� enum_class�source_regex�lookup_roleFT�source_indirectN�_target�target_regex�target_indirect�tclass_regexZlookup_class� default_regex)�returncCs|jS�N)r)�self�r �;/usr/lib64/python3.9/site-packages/setools/rbacrulequery.py�target:szRBACRuleQuery.target)�valuerc Cst|sd|_nd|jr t�|�|_nPz |j�tttt f|��|_Wn.t yn|j�ttttf|��|_Yn0dSr) rr�re�compile�policyZlookup_type_or_attrrr�strrrrr)rr#r r r!r">s cs(tt|�j|fi|��t�t�|_dSr)�superr�__init__�loggingZ getLogger�__name__�log)rr&�kwargs�� __class__r r!r)JszRBACRuleQuery.__init__c cs:|j�d�|��|j�d�|��|j�d�|��|j�d�|��|�|j�|j�d�|��|j��D]�}|jr�|j|jvr�qp|jr�t |j|j|j |j�s�qp|jr�t |j|j|j |j�s�qpz|�|�s�WqpWnty�YqpYn0|j�r.zt |j|jd|j��sWqpWnt�y,YqpYn0|VqpdS)z/Generator which yields all matching RBAC rules.z,Generating RBAC rule results from {0.policy}zRuletypes: {0.ruletype}zLSource: {0.source!r}, indirect: {0.source_indirect}, regex: {0.source_regex}zLTarget: {0.target!r}, indirect: {0.target_indirect}, regex: {0.target_regex}z0Default: {0.default!r}, regex: {0.default_regex}TN)r,�info�format�debugZ_match_object_class_debugr&Z rbacrules�ruletype�sourcerrrr"rrZ_match_object_classr �defaultr)rZruler r r!�resultsNsZ � ��� � zRBACRuleQuery.results)"r+� __module__�__qualname__�__doc__rrr3r r4r�bool�__annotations__rrrrrrrrrZtclassrr5r�propertyr"�setterr'r)rrr6� __classcell__r r r.r!rs$ r)r*r$�typingrrrrr�rr Zdescriptorsr r� exceptionrr Z policyreprrrr�utilrZ MatchObjClassZPolicyQueryrr r r r!�<module>s
Linux 65-254-81-4.cprapid.com 5.14.0-284.11.1.el9_2.x86_64 #1 SMP PREEMPT_DYNAMIC Tue May 9 05:49:00 EDT 2023 x86_64
Apache
65.254.81.4