Edit File: configuration_management.cpython-311.pyc
� ��\h � �B � d Z ddlZddlmZ ddlmZ ddlmZ ddlm Z ddl mZ ddlm Z g Z ej e� � Zd Z ed � eej � � D � � � � Z edd� � Zd � e� � � D � � Z G d� dej � � ZdS )z]Endpoints for configuration management commands. - manage ModSecurity directives, rulesets. � N)� namedtuple)�lookup)�ValidationError)�Scope)�config)� hosting_panel�1000c # �x K � | ]5}|� d � � �|t t j |� � fV � �6dS )�SecN)� startswith�getattrr �ModSecurityDirectives)�.0�attrs �^/opt/imunify360/venv/lib/python3.11/site-packages/im360/simple_rpc/configuration_management.py� <genexpr>r sZ � � � � � �����u���� �7�6�/��6�6�7�� � � � � � �Issuezid title fix url ignoredc � � g | ]@\ }}||t t d j di t � � ��ddt z d�� � f��AS )zXWrong value for {directive} ModSecurity directive. Expected: {expected!r} Got: {{got!r}}z4Run `imunify360-agent fix modsec directives` commandz#https://docs.imunify360.com/issues/F��ignored� )r �%ISSUE_ID_MODSEC_DIRECTIVE_WRONG_VALUE�format�vars)r � directive�expecteds r � <listcomp>r s� � � � � � � �8� �� �1� <� 5�5;� F� F�>B�f�f� F� F�B�1�3� 4�� � � ��� � r c � � � e Zd Zej Z� fd�Z ej ddd� � d� � � Z ej ddd� � d� � � Z ej ddd� � d � � � Z ej ddd� � d � � � Z� xZ S )�ModSecEndpointsc �z �� t � � � |� � t j � � | _ d S �N)�super�__init__r �HostingPanel)�self�sink� __class__s �r r$ zModSecEndpoints.__init__0 s2 �� � ���������*�7�9�9����r �check�modsec� directivesc � � K � t j j }g }t D ]�\ }}}| j � |� � � d {V ��}||k r�t � d|||� � |� |�� � }|� t |� � � |j j di t � � ���� � � � ��t d� |D � � � � st! |� � �d|iS )Nzdirective %r got %r expected %rr )�titlec 3 �&