Viewing File: /opt/imunify360/venv/lib/python3.11/site-packages/imav/patchman/__pycache__/license.cpython-311.pyc



sj)DdZddlZddlZddlZddlZddlmZddlmZddl	m
Z
ddlmZm
Z
ddlmZddlmZejd	Zejd
ZejeZdZdZd
ZdZdZdZdZGddeZGdde Z!GddZ"dS)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)suppress)IntEnum)Path)ListOptional)importer)PatchmanConfigzcryptography.x509zpyasn1.codec.der.decoderzlicensing.patchman.coiz/etc/patchman/ca.crtz"/etc/patchman/license/patchman.crtz"/etc/patchman/license/patchman.keyz*https://{address}:{port}/v2/imunifyav_key/z1.3.6.1.4.1.44098.2.1.3cFeZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdS)Featurezr
    Patchman functionality depending on the license.
    See patchman agent implementation for more details.
    r
N)__name__
__module____qualname____doc__CoreCoreMalwareQuarantineCoreVulnerabilitiesPatchRulesMalwareScanRulesMalwareCleanEcommerceVulnerabilitiesScanEcommerceVulnerabilitiesPatchPluginVulnerabilitiesScanPluginVulnerabilitiesPatchScanningMultithreadedScanningRealtimePatchDependenciesWafJ/opt/imunify360/venv/lib/python3.11/site-packages/imav/patchman/license.pyrr1sf

D #$ $%! !!"
CCCr*rceZdZdS)PatchmanLicenseErrorN)rrrr)r*r+r-r-FsDr*r-ceZdZedZedeefdZedefdZ	edZ
edeefdZ
edeefdZdS)	LicensecNttSN)rLICENSE_CERT_FILEexistsclss r+	is_activezLicense.is_activeKs%&&--///r*returncg}|r?ttd5}t|}dddn#1swxYwYt
d|jDdx}rt	|j
j
\}}|}|tjt|dD]Y\}}	|	dkrNt!t"5|t|dddn#1swxYwYZt$d||S)zX
        Return the list of features available for the current patchman license
        rbNc3DK|]}|jjtk|VdSr1)oid
dotted_stringFEATURES_EXTENSION_OID).0exts  r+	<genexpr>z'License.get_features.<locals>.<genexpr>Ys?w,0FFFFFFFr*r)start1zPatchman license features: %s)r6openr2x509load_pem_x509_certificatereadnext
extensionsasn1_decoderdecodevalueasBinaryappendrr	enumerater
ValueErrorloggerinfo)
r5featuresfcertr?	asn1_data_	bitstringposrKs
          r+get_featureszLicense.get_featuresOs
==??	:'..
@!55affhh??
@
@
@
@
@
@
@
@
@
@
@
@
@
@
@#

s
: ,2239?CC	1%..00	---"+IQ"?"?"?::JC||%j11::$OOGCLL999:::::::::::::::3X>>>s#-A&&A*-A*#EE	E	cBtj|vSr1)rr rYr4s r+has_clean_modezLicense.has_clean_modems(C,<,<,>,>>>r*cBtj|vSr1)rr&rYr4s r+has_realtime_enabledzLicense.has_realtime_enabledqs'3+;+;+=+===r*ctjddt}tjddt}tjddt}tj}|||tttj
t|||	5}|j}|jd
kr2|cdddS|dkr	ddddSt'd
|jd#1swxYwYdS)zw
        Get imunify registration key from the Patchman license service.
        See LICENSING-84 for details.
        	licensingca)defaultaddressport)cafile)certfilekeyfile)rbrc)contextNiz!Patchman license service returns z	 response)r	getCA_ROOT_FILELICENSE_ADDRESSLICENSE_PORTsslcreate_default_contextload_verify_locationsload_cert_chainr2LICENSE_KEY_FILEurllibrequesturlopenIMUNIFY_KEY_URL_TEMPLATEformatstatusrFrJr-)r5rdrbrcrgresponserws       r+_get_imunify_keyzLicense._get_imunify_keyus #K|LLL $O


!+v|LLL,..%%V%444&$	 	
	
	
^
#
#$++G$+GG$

	_F#%%}}--//
								3								'NHONNN
										s8EE3EEEcZKtj}	tj|d|jdd{VS#t
$r%}td|Yd}~n5d}~wt$r%}t	d|Yd}~nd}~wwxYwdS)Ni,)timeoutzCan't get imunify key due to %s)
asyncioget_event_loopwait_forrun_in_executorryFileNotFoundErrorrPwarning	Exceptionerror)r5loopexcs   r+get_imunify_keyzLicense.get_imunify_keys%''	A )$$T3+?@@
!	C	C	CNN<cBBBBBBBB	A	A	ALL:C@@@@@@@@	Ats#4A
B(A66
B(B##B(N)rrrclassmethodr6rrrYboolr[r]rstrryrr)r*r+r/r/Js00[0T'][:?t???[?>>[>#[:hsm[r*r/)#rr|loggingrmrr
contextlibrenumrpathlibrtypingrrdefence360agent.utilsrimav.patchman.configr	
LazyImportrDrI	getLoggerrrPrkrlrjr2rqrur=rrr-r/r)r*r+<module>rs*







!!!!!!!!******//////x.//"x"#=>>		8	$	$)%87G2




g


*					9			UUUUUUUUUUr*
Back to Directory File Manager