관리-도구
편집 파일: watcher.cpython-311.pyc
� ���8ҭ��D�����������������������������d�Z�ddlZddlZddlmZ�ddlmZmZ�ddlm Z �ddl mZ�ddlm Z �ddlmZ�dd lmZ�dd lmZ�dd lmZ�ddlmZmZ��ee������������Z�G�d��d e ������������ZdS�)u �� This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. Copyright © 2019 Cloud Linux Software Inc. This software is also available under ImunifyAV commercial license, see <https://www.imunify360.com/legal/eula> �����N)� getLogger)�Inotify�Watcher)� inactivity)�MyImunifyConfig)� MessageSource)�$is_native_feature_management_enabled)� sync_users)� hosting_panel)�finally_happened�recurring_checkc��������������������r�����e�Zd�ZdZdZej��������Zdd�Zd��Z de fd�Zde fd�Z�e d ������������d ����������������ZdS�)� PasswdWatchers���/etcs���passwdNc����������������������K����||�_���������||�_��������t����������j����������������������|�_��������|�t����������|�j���������������������|�_��������n||�_��������|�j�����������������������������|�j��������|�j ���������������������t��������������������������d�{V���s|��������������������������������������d�{V����t����������j ��������r|��������������������������������������d�{V����|�j������������������������������|������������������������������������������������|�_��������d�S��N)�_loop�_sinkr����HostingPanel�_hosting_panelr����_watcher�watch� WATCH_PATH� WATCH_MASKr ����update_users_permissionsr����ENABLED�update_myimunify_users�create_task�_process_events�_watch_task)�self�loop�sink�watchers��� �\/opt/imunify360/venv/lib/python3.11/site-packages/imav/feature_management/plugins/watcher.py� create_sourcezPasswdWatcher.create_source1���s������������� ��� �+�8�:�:����?�#�D�J�/�/�D�M�M�#�D�M�� ���D�O�T�_�=�=�=�9�;�;�;�;�;�;�;�;�� 2��/�/�1�1�1�1�1�1�1�1�1��"�� 0��-�-�/�/�/�/�/�/�/�/�/��:�1�1�$�2F�2F�2H�2H�I�I���������c���������������������K����|�j���������������������������������������������t����������j��������t����������j��������������������5��|�j�����������d�{V����d�d�d��������������n#�1�swxY�w�Y���|�j��������o|�j��������������������������������������������d�S��d�S�r���)r����cancel� contextlib�suppress�asyncio�CancelledErrorr����close�r ���s��� r$����shutdownzPasswdWatcher.shutdownD���s���������������!�!�!� � ��!7� 8� 8�� #�� #��"�"�"�"�"�"�"�"� #�� #�� #�� #�� #�� #�� #�� #�� #�� #�� #����� #�� #�� #�� #�� � �/�$�-�-�-�/�/�/�/�/�/�/�/s����A�A�A�returnc�������������������j���K����t����������|�j���������������������������������������������d�{V�����������������d�{V���S�r���)�sync_feature_management_usersr���� get_usersr.���s��� r$���r���z&PasswdWatcher.update_users_permissionsK���sZ����������2��%�/�/�1�1�1�1�1�1�1�1� �� �� �� �� �� �� �� �� r&���c�������������������v���K����t����������|�j��������|�j���������������������������������������������d�{V�����������������d�{V���S�r���)�sync_myimunify_usersr���r���r3���r.���s��� r$���r���z$PasswdWatcher.update_myimunify_usersP���s^����������)��J�d�1�;�;�=�=�=�=�=�=�=�=� �� �� �� �� �� �� �� �� r&���r���c���������������������K����|�j����������������������������������������������d�{V���}|j��������|�j��������k����rd�S�t ��������������������������d�{V���snt ����������j�����������������������������d������������5��t����������|�j ��������dd���������������d�{V����t�������������������������������d�������������d�d�d��������������n#�1�swxY�w�Y���t����������j ��������r|��������������������������������������d�{V����d�S�d�S�)N�permissions_update��������)� max_tries�delayz&Feature management permissions updated)r���� get_event�name� WATCH_FILEr ���r����track�taskr���r����logger�infor���r���r���)r ����events��� r$���r���zPasswdWatcher._process_eventsU���ss����������m�-�-�/�/�/�/�/�/�/�/���:���(�(��F�9�;�;�;�;�;�;�;�;�� F��!�&�&�';�<�<�� F�� F�&��1�Q�a������������������������D�E�E�E� F�� F�� F�� F�� F�� F�� F�� F�� F�� F�� F����� F�� F�� F�� F� ��"�� 0��-�-�/�/�/�/�/�/�/�/�/�/�/� 0�� 0s����'8B+�+B/�2B/r���)�__name__� __module__�__qualname__r���r>���r����MOVED_TOr���r%���r/����boolr���r���r ���r�����r&���r$���r���r���,���s����������������J��J��!�J�J��J��J��J�&0��0��0� ��� �� �� �� � �d�� �� �� �� � ��_�Q���0��0����0��0��0r&���r���)�__doc__r+���r)����loggingr����imav.malwarelib.subsys.ainotifyr���r����defence360agent.apir���� defence360agent.contracts.configr����!defence360agent.contracts.pluginsr����*defence360agent.feature_management.controlr ����(defence360agent.feature_management.utilsr ���r2����defence360agent.myimunify.modelr5����defence360agent.subsys.panelsr����defence360agent.utilsr���r ���rD���rA���r���rI���r&���r$����<module>rU������sD�������*��������������������������<��<��<��<��<��<��<��<��*��*��*��*��*��*��<��<��<��<��<��<��;��;��;��;��;��;������������������������O��N��N��N��N��N��7��7��7��7��7��7��C��C��C��C��C��C��C��C� ��8� � ��60��60��60��60��60�M��60��60��60��60��60r&���