*p B d Z ddlZddlZddlmZ ddlmZmZ ddlm Z ddl
mZ ddlm
Z
mZmZ ddlmZmZmZmZ dd lmZ dd
lmZmZmZ ddlmZ ddlmZ dd
lm Z ddl!m"Z"m#Z# ddl$m%Z% ddl&m'Z'm(Z(m)Z)m*Z* ej+ e, Z-dZ.dZ/de0fdZ1 G d de" Z2dS )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 .
Copyright © 2019 Cloud Linux Software Inc.
This software is also available under ImunifyAV commercial license,
see
N)PatchmanConfig)PATCHMAN_PACKAGEPATCHMAN_SERVICE_NAME)PatchmanCustomIntegration)
PatchmanError)
FeatureStatusPatchmanFeatureRealtimeFeature)DomainPathUserpatchman_db)License)get_current_ipis_ipv4
is_private_ip)REALTIME_SERVICE_NAME)Core)MessageType)
RootEndpointsbind)
hosting_panel) check_runfinally_happened
OsReleaseInfo
os_versionzpatchman-clientz/usr/local/patchman/patchmandreturnc B t j t j z S N)r id_likeDEBIAN P/opt/imunify360/venv/lib/python3.11/site-packages/imav/patchman/rpc/endpoints.py is_debianr% 8 s ""]%999r# c e Zd ZdZ edd dd Z edd dd Zed Zed
Z d Z
dd
Z edd dd Z edd d Z
edd d Z edd d Z eddd d Z eddd d ZdS )PatchmanEndpointsz/etc/patchman/license/keypatchmanusersFNc
j K |rt || }nt j }| d{V }t t
t t gt j d 5 }|D ]}|d }|d pd} |d }
|d pd}|d }|d
}
t j
|| |
|||
}|d }|D ]C}|d
}t
j
|| }|d }|D ]}t j
|| Dd|j icddd S # 1 swxY w Y dS )as Writes the users and their domains to database.
Patchman go agent executes this endpoint to fill the database. In case
of custom integration it retrieves the user-defined parameters from
Patchman Portal and passes it here.
:param custom_integration: true if custom integration, false by default
:param integration_type: only for custom integration, file or script
:param metadata_path: only for custom integration, path to file or
script that represent metadata (File type 1 or Script 1 from
https://docs.imunify360.com/Patchman_custom_integration.pdf)
Nr) )
target_dirprefixusernameemail languageparentlevel suspended)namer. r0 r1 r2 r3 domainsdomain)r4 userpaths)r4 r6 path)r r HostingPanelpatchman_usersr r
r r r TMPDIRcreatedatabase)selfcustom_integrationintegration_type
metadata_pathhpr; db user_data user_namer. r0 r1 r2 r3 r7 r5 domain_datadomain_namer6 r8 path_names r$ r) zPatchmanEndpoints.users? s &