403Webshell
Server IP : 188.151.22.197  /  Your IP : 216.73.217.74
Web Server : Apache/2.4.62 (Rocky Linux) OpenSSL/3.5.5
System : Linux wsten.se 5.14.0-687.30.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Jul 27 13:09:21 UTC 2026 x86_64
User : apache ( 48)
PHP Version : 8.1.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib64/python3.9/site-packages/setools/checker/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib64/python3.9/site-packages/setools/checker/__pycache__/assertte.cpython-39.opt-1.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
Cs.|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!Checking TE allow rule assertion.)Zallow)r
rrrZruletypez)Expected rule with source "{}" not found.z)Expected rule with target "{}" not found.z
{} failure(s))r'r2rr6r
rrr�setrr�sorted�resultsrrrZlog_fail�str�appendZlog_okr3�debug)
r5�queryZunseen_sourcesZunseen_targetsZfailuresZruleZsrcsZtgts�itemZfailurerrr �runHs@�

�



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

Youez - 2016 - github.com/yon3zu
LinuXploit