관리-도구
편집 파일: connect_ports.cpython-39.opt-1.pyc
a �Z`� � @ sD d dl Z e jddd�Zej Zd dlT d dlmZ G dd� de�ZdS ) � Nzsetroubleshoot-pluginsT)Zfallback)�*)�Pluginc @ sL e Zd Zed�Zed�Zed�ZdZed�ZdZ dd� Z d d � Zdd� Zd S )�pluginzR SELinux is preventing $SOURCE_PATH from connecting to port $PORT_NUMBER. a� SELinux has denied $SOURCE from connecting to a network port $PORT_NUMBER which does not have an SELinux type associated with it. If $SOURCE should be allowed to connect on $PORT_NUMBER, use the <i>semanage</i> command to assign $PORT_NUMBER to a port type that $SOURCE_TYPE can connect to (%s). If $SOURCE is not supposed to connect to $PORT_NUMBER, this could signal an intrusion attempt. z� If you want to allow $SOURCE to connect to $PORT_NUMBER, you can execute # semanage port -a -t PORT_TYPE -p %s $PORT_NUMBER where PORT_TYPE is one of the following: %s. � zIIf you want to allow $SOURCE_PATH to connect to network port $PORT_NUMBERz!you need to modify the port type.c C sB |d � d�}t|�dkr&td�| S td�|d |d f S d S )N� �,zc# semanage port -a -t PORT_TYPE -p %s $PORT_NUMBER where PORT_TYPE is one of the following: %s.z+# semanage port -a -t %s -p %s $PORT_NUMBERr )�split�len�_)�self�avcZoptionsZports� r �2/usr/share/setroubleshoot/plugins/connect_ports.py�get_do_text0 s �zplugin.get_do_textc C s t �| t� | �d� d S )N�d )r �__init__�__name__Zset_priority)r r r r r 8 s zplugin.__init__c C sJ |� g d��rF|�dg�rF|�� }|rF| �|j�d�d d�|�f�S d S )N)Zhi_reserved_port_tZreserved_port_tZport_tZunreserved_port_tZname_connectr r z, )Zmatches_target_typesZhas_any_access_inZallowed_target_typesZreportZtclassr �join)r r Z allowed_typesr r r �analyze<