Revonzy Mini Shell

Revonzy Mini Shell

Şuanki Dizin: /lib64/python3.9/site-packages/setools/checker/__pycache__/
Dosya Yükle :
Şuanki Dosya : //lib64/python3.9/site-packages/setools/checker/__pycache__/assertte.cpython-39.pyc

a

q�qe��@s�ddlZddlmZmZddlmZddlmZddlm	Z	ddl
mZdd	lm
Z
mZmZd
ZdZdZd
ZdZdZdZdZGdd�de�ZdS)�N)�List�Union�)�InvalidCheckValue)�	AnyTERule)�TERuleQuery�)�
CheckerModule)�ConfigDescriptor�ConfigSetDescriptor�ConfigPermissionSetDescriptor�source�target�tclass�perms�
exempt_source�
exempt_target�
expect_source�
expect_targetc	s�eZdZdZdZeeeee	e
eee
f�Zed�Zed�Zedddd�Ze�Zedddd�Zedddd�Zedddd�Zedddd�Zdd	��fd
d�Zed	�dd
�Z�ZS)�AssertTEzKChecker module for asserting a type enforcement allow rule exists (or not).Z	assert_teZlookup_type_or_attrZlookup_classTF)�strict�expandN)�returncst��|||�t�t�|_|�t�|_|�t	�|_
|�t�|_|�t
�|_|�t�|_|�t�|_|�t�|_|�t�|_t|j|j
|j|jf�s�td��|j|j@}|r�|j�d�d�dd�|D����|j|j@}|�r|j�d�d�dd�|D����dS)NzEAt least one of source, target, tclass, or perms options must be set.z.Overlap in expect_source and exempt_source: {}z, css|]}|jVqdS�N��name��.0�i�r�>/usr/lib64/python3.9/site-packages/setools/checker/assertte.py�	<genexpr>A�z$AssertTE.__init__.<locals>.<genexpr>z.Overlap in expect_target and exempt_target: {}css|]}|jVqdSrrrrrr r!Fr")�super�__init__�loggingZ	getLogger�__name__�log�get�
SOURCE_OPTr
�
TARGET_OPTr�	CLASS_OPTr�	PERMS_OPTr�EXEMPT_SRC_OPTr�EXEMPT_TGT_OPTr�EXPECT_SRC_OPTr�EXPECT_TGT_OPTr�anyr�info�format�join)�self�policyZ	checknameZconfigZsource_exempt_expect_overlapZtarget_exempt_expect_overlap��	__class__rr r$,s0�
�
�zAssertTE.__init__c
CsPt|j|j|j|jf�s Jd��|j�d�t|j|j|j|j|jdd�}t	|j
�}t	|j�}g}t|�
��D]x}t	|j���}t	|j���}||8}||8}||j
|jr�||j|jr�|�t|��|�|�qn|�t|��qn|D]"}d�|�}	|�|	�|�|	�q�|D]$}d�|�}	|�|	�|�|	��q|j�d�|��|S)Nz'AssertTe no options set, this is a bug.z!Checking TE allow rule assertion.)Zallow)r
rrrZruletypez)Expected rule with source "{}" not found.z)Expected rule with target "{}" not found.z
{} failure(s))r1r
rrrr'r2rr6�setrr�sorted�resultsrrrZlog_fail�str�appendZlog_okr3�debug)
r5�queryZunseen_sourcesZunseen_targetsZfailuresZruleZsrcsZtgts�itemZfailurerrr �runHsF��

�



zAssertTE.run)r&�
__module__�__qualname__�__doc__Z
check_type�	frozensetr)r*r+r,r-r.r/r0Zcheck_configr
r
rrrrrrrrrr$rrA�
__classcell__rrr7r rs�r)r%�typingrr�	exceptionrZ	policyreprZterulequeryrZ
checkermoduler	Zdescriptorsr
rrr)r*r+r,r-r.r/r0rrrrr �<module>s

EliteHackz.ORG
Revonzy Mini Shell
root@revonzy.com

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