403Webshell
Server IP : 172.24.0.40  /  Your IP : 216.73.216.10
Web Server : Apache
System : Linux dbweb26.ust.edu.ph 4.18.0-513.5.1.el8_9.x86_64 #1 SMP Fri Sep 29 05:21:10 EDT 2023 x86_64
User : apache ( 48)
PHP Version : 8.2.18
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib64/python3.6/site-packages/setools/diff/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib64/python3.6/site-packages/setools/diff/__pycache__/rbacrules.cpython-36.pyc
3

�^��@s�ddlmZmZddlmZddlmZddlmZm	Z	ddl
mZddlm
Z
dd	lmZed
ddd
g�ZGdd�de�ZGdd�de	�ZGdd�de	�ZdS)�)�defaultdict�
namedtuple�)�RBACRuletype�)�DiffResultDescriptor)�
Difference�Wrapper)�class_wrapper_factory)�role_wrapper_factory)�type_or_attr_wrapper_factoryZmodified_rbacrule�ruleZ
added_defaultZremoved_defaultc@sheZdZdZed�Zed�Zed�Zed�Zed�Z	e
e�Ze
e�Z
dd�Zdd�Zdd	�Zd
d�ZdS)
�RBACRulesDifferencez<Determine the difference in RBAC rules between two policies.�diff_role_allows�diff_role_transitionscCsd|jjdj|��|js"|jr*|j�|j|j|jtj	t
�|j|jtj	t
��\|_|_}dS)zAGenerate the difference in role allow rules between the policies.zJGenerating role allow differences from {0.left_policy} to {0.right_policy}N)
�log�info�format�_left_rbac_rules�_right_rbac_rules�_create_rbac_rule_lists�	_set_diff�_expand_generatorrZallow�RoleAllowWrapper�added_role_allows�removed_role_allows)�self�_�r�!/usr/lib64/python3.6/rbacrules.pyr3sz$RBACRulesDifference.diff_role_allowscCs�|jjdj|��|js"|jr*|j�|j|j|jtj	t
�|j|jtj	t
��\}}}g}x:|D]2\}}t|j�t|j�krf|j
t||j|j��qfW||_||_||_dS)zFGenerate the difference in role_transition rules between the policies.zOGenerating role_transition differences from {0.left_policy} to {0.right_policy}N)rrrrrrrrrZrole_transition�RoleTransitionWrapperr�default�append�modified_rbacrule_record�added_role_transitions�removed_role_transitions�modified_role_transitions)rZaddedZremovedZmatchedZmodifiedZ	left_ruleZ
right_rulerrrrAs&z)RBACRulesDifference.diff_role_transitionscCs�|jjdj|��x$|jj�D]}|j|jj|�qW|jjdj|��x$|jj�D]}|j	|jj|�qVW|jjd�dS)z$Create rule lists for both policies.z-Building RBAC rule lists from {0.left_policy}z.Building RBAC rule lists from {0.right_policy}z#Completed building RBAC rule lists.N)
r�debugrZleft_policyZ	rbacrulesrZruletyper"Zright_policyr)rr
rrrrasz+RBACRulesDifference._create_rbac_rule_listscCsH|jjd�d|_d|_d|_d|_d|_d|_|jj	�|j
j	�dS)z%Reset diff results on policy changes.zResetting RBAC rule differencesN)rr'rrZmodified_role_allowsr$r%r&r�clearr)rrrr�_reset_diffos
zRBACRulesDifference._reset_diffN)�__name__�
__module__�__qualname__�__doc__rrrr$r%r&r�listrrrrrr)rrrrr#s rc@s4eZdZdZd
Zdd�Zdd�Zdd	�Zd
d�ZdS)rz.Wrap role allow rules to allow set operations.�source�targetcCs,||_t|j�|_t|j�|_t|�|_dS)N)�originrr/r0�hash�key)rr
rrr�__init__�szRoleAllowWrapper.__init__cCs|jS)N)r3)rrrr�__hash__�szRoleAllowWrapper.__hash__cCs|j|jkS)N)r3)r�otherrrr�__lt__�szRoleAllowWrapper.__lt__cCs|j|jko|j|jkS)N)r/r0)rr6rrr�__eq__�szRoleAllowWrapper.__eq__N)r/r0)	r*r+r,r-�	__slots__r4r5r7r8rrrrr~src@s4eZdZdZdZdd�Zdd�Zd	d
�Zdd�Zd
S)r z3Wrap role_transition rules to allow set operations.r/r0�tclasscCs8||_t|j�|_t|j�|_t|j�|_t|�|_dS)N)	r1rr/rr0r
r:r2r3)rr
rrrr4�s
zRoleTransitionWrapper.__init__cCs|jS)N)r3)rrrrr5�szRoleTransitionWrapper.__hash__cCs|j|jkS)N)r3)rr6rrrr7�szRoleTransitionWrapper.__lt__cCs$|j|jko"|j|jko"|j|jkS)N)r/r0r:)rr6rrrr8�szRoleTransitionWrapper.__eq__N)r/r0r:)	r*r+r,r-r9r4r5r7r8rrrrr �sr N)�collectionsrrZ	policyreprZdescriptorsr�
differencerr	Zobjclassr
Zrolesr�typesrr#rrr rrrr�<module>s[

Youez - 2016 - github.com/yon3zu
LinuXploit