Tm d Z ddlZddlmZ ddlmZ ddlmZ ddlm Z ddl
mZmZ ddl
mZmZ ej e Z G d d
e Zdeeeeef f deeeeef f fd
Zdeeef deeef fdZdS )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)defaultdict)Iterable)urljoin)Request)APIAPIError)IAIDTokenErrorIndependentAgentIDAPIc ` e Zd Z eej d ZddddddZede de
fd ZdS )VulnerabilityAPIz/api/patch/vulnerabilities cveIdapptypenameseverityidsreturnc < K t | j j }|s|S t j d{V }n4# t
$ r'}t d| |cY d}~S d}~ww xY w| j dd | z }t ||dd } | | d{V }n4# t $ r'}t d| |cY d}~S d}~ww xY w|
t |d |S )
zc
Get vulnerabilities details for specific *ids*.
More details in DEF-32152
NzACan't get iaid token: %s. Return default vulnerabilities details.z?ids=,zapplication/json)zX-AuthzContent-Type)headerszRFailed to get vulnerabilities details: %s. Return default vulnerabilities details.vulnerabilities)r _STUB_VULNERABILITY_INFOcopyr
get_tokenr loggererrorURLjoinr
async_requestr updatenormalize_vulnerabilities)clsr infotokenexcurlrequestresults V/opt/imunify360/venv/lib/python3.11/site-packages/imav/malwarelib/api/vulnerability.pyget_detailszVulnerabilityAPI.get_details/ s 37<== K /9;;;;;;;;EE LL:
KKKKKK
g/
///$6HII
,,W55555555FF LL:
KKKKKK
-f5F.GHHIIIs9 ;
A,A'!A,'A,$C
C1
C,&C1,C1N)__name__
__module____qualname__r r _BASE_URLr r classmethodr dictr, r+ r r % sr
'#-!=
>
>C #H # # # # [# # #r4 r r r c > d | D S )z)
Normalize vulnerabilities data.
c 4 i | ]\ }}|t | S r3 )normalize_vulnerability).0_id
vulnerabilitys r+
z-normalize_vulnerabilities..\ s7 C
$]
3
3 r4 )items)r s r+ r# r# V s/ "1"7"7"9"9 r4 r: c | dd | dd | dd | dd | dd dS )z'
Normalize vulnerability data.
r r
r r r r r )getupper)r: s r+ r7 r7 b s~
""7B// ++!!&"--!!&"--!%%j"55;;== r4 )__doc__loggingcollectionsr typingr urllib.parser urllib.requestr defence360agent.api.serverr r defence360agent.internals.iaidr r
getLoggerr- r r r2 strr# r7 r3 r4 r+ rJ se * # # # # # # " " " " " " 4 4 4 4 4 4 4 4
8 $ $. . . . .s . . .b #tCH~-. #tCH~
4S>
d38n
r4