+
    =l j-  ã                   ó¨  € ^ RI t ^ RIHtHtHtHt ^ RIHtHt ^ RI	H
t
 ^ RIHt ^ RIHtHt ^ RIHt ^ RIHt ^ R	IHtHtHtHtHtHtHtHt  ! R
 R]4      t ! R R]4      t ! R R]4      t ! R R]4      t  ! R R]4      t! ! R R]]4      t" ! R R]4      t#R R lt$R R lt%R R lt&R R lt']
! R R!]']R"7      t(R#R$R%R&R'R(R)]"R*].R+. R,R-R.R//t)R# )0é    N)ÚAnyÚDictÚListÚOptional)ÚsystemÚutil)ÚAPIEndpoint)ÚAdditionalInfo)ÚVulnerabilityParserÚget_vulnerabilities)Úget_apt_cache_datetime)ÚUAConfig)ÚBoolDataValueÚ
DataObjectÚDatetimeDataValueÚFieldÚFloatDataValueÚStringDataValueÚ	data_dictÚ	data_listc                   ón   a € ] tR t^t o ]! R]RRR7      ]! R]RRR7      .tRRRR/V 3R lR lltR	tV t	R
# )ÚCVEsOptionsÚ	unfixableFzShow only unfixable CVES.©ÚdocÚfixablezShow only fixable CVES.c                óF   <€ V ^8„  d   QhRS[ S[,          RS[ S[,          /# )é   r   r   )r   Úbool)ÚformatÚ__classdict__s   "€ÚE/usr/lib/python3/dist-packages/uaclient/api/u/pro/security/cves/v1.pyÚ__annotate__ÚCVEsOptions.__annotate__)   s)   ø€ ÷ ñ ñ ™D•>ðñ ™$•ñ	ó    c               ó   € Wn         W n        R # ©N)r   r   )Úselfr   r   s   &$$r"   Ú__init__ÚCVEsOptions.__init__)   s   € ð #ŒØŽr%   )r   r   N)
Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r   r   Úfieldsr)   Ú__static_attributes__Ú__classdictcell__©r!   s   @r"   r   r      sY   ø‡ € áØØØØ+ô		
ñ 	ØØØØ)ô		
ð€Fðð %*ðð #(÷	÷ ð r%   r   c            	       óŒ   a € ] tR t^3t o ]! R]RRR7      ]! R]RRR7      ]! R]RRR7      ]! R	]R
R7      .tV 3R lR ltRtV t	R# )ÚCVEAffectedPackageÚnameFzThe CVE namer   Úfix_versionz.The version that fixes the CVE for the packageÚ
fix_statusz)The status of the CVE fix for the packageÚ
fix_originz*The pocket where the fix is available fromc                ó2   <€ V ^8„  d   QhRS[ RS[ RS[ RS[ /# )r   r5   r6   r7   r8   ©Ústr)r    r!   s   "€r"   r#   ÚCVEAffectedPackage.__annotate__N   s-   ø€ ÷ %ñ %Ùð%Ù&)ð%Ù7:ð%ÙHKñ%r%   c                ó6   € Wn         W n        W0n        W@n        R # r'   ©r5   r6   r7   r8   )r(   r5   r6   r7   r8   s   &&&&&r"   r)   ÚCVEAffectedPackage.__init__N   s   € ð Œ	Ø&ÔØ$ŒØ$Žr%   )r8   r7   r6   r5   N©
r+   r,   r-   r.   r   r   r/   r)   r0   r1   r2   s   @r"   r4   r4   3   si   ø‡ € áØØØØô		
ñ 	ØØØØ@ô		
ñ 	ØØØØ;ô		
ñ 	ØØØ<ô	
ð'€F÷4%ö %r%   r4   c                   ój   a € ] tR t^Wt o ]! R]RR7      ]! R]! ]4      RR7      .tV 3R lR lt	Rt
V tR	# )
ÚAffectedPackageÚcurrent_versionz"The current version of the packager   Úcvesz The CVE that affects the packagec                ó6   <€ V ^8„  d   QhRS[ RS[S[,          /# )r   rC   rD   )r;   r   r4   )r    r!   s   "€r"   r#   ÚAffectedPackage.__annotate__e   s#   ø€ ÷ ñ Ù"%ðÙ-1Ñ2DÕ-Eñr%   c               ó   € Wn         W n        R # r'   ©rC   rD   )r(   rC   rD   s   &$$r"   r)   ÚAffectedPackage.__init__e   s   € ð  /ÔØŽ	r%   rH   N)r+   r,   r-   r.   r   r   r   r4   r/   r)   r0   r1   r2   s   @r"   rB   rB   W   s@   ø‡ € áØØØ4ô	
ñ
 	ØÙÐ(Ó)Ø2ô	
ð€F÷ö r%   rB   c                   ó^   a € ] tR t^lt o ]! R]RR7      ]! R]RR7      .tV 3R lR ltRtV t	R	# )
Ú
RelatedUSNr5   zThe USN namer   ÚtitlezThe USN titlec                ó&   <€ V ^8„  d   QhRS[ RS[ /# )r   r5   rL   r:   )r    r!   s   "€r"   r#   ÚRelatedUSN.__annotate__z   s   ø€ ÷ ñ ™Sð ©ñ r%   c                ó   € Wn         W n        R # r'   ©r5   rL   )r(   r5   rL   s   &&&r"   r)   ÚRelatedUSN.__init__z   s   € ØŒ	ØŽ
r%   rP   Nr@   r2   s   @r"   rK   rK   l   s:   ø‡ € áØØØô	
ñ
 	ØØØô	
ð€F÷ö r%   rK   c                   óØ   a € ] tR t^t o ]! R]RR7      ]! R]RR7      ]! R]RR7      ]! R]! ]4      R	R
R7      ]! R]R	RR7      ]! R]R	RR7      .t	RRRRRRRRRR/V 3R lR llt
RtV tR# )ÚCVEInfoÚdescriptionzThe CVE descriptionr   Úpublished_atzThe CVE published dateÚpriorityzThe ubuntu priority for the CVEÚnotesFzA list of notes for the CVEÚ
cvss_scorezThe CVE cvss scoreÚcvss_severityzThe CVE cvss severityNÚrelated_usnsÚrelated_packagesc                óÞ   <€ V ^8„  d   QhRS[ RS[P                  RS[ RS[S[S[ ,          ,          RS[S[,          RS[S[ ,          RS[S[S[,          ,          RS[S[S[ ,          ,          /# )	r   rT   rU   rV   rW   rX   rY   rZ   r[   )r;   Údatetimer   r   ÚfloatrK   )r    r!   s   "€r"   r#   ÚCVEInfo.__annotate__¤   s‡   ø€ ÷ 1ñ 1ñ ð1ñ ×'Ñ'ð	1ñ
 ð1ñ ™™S�	Õ"ð1ñ ™U•Oð1ñ  ¡•}ð1ñ ™t¡JÕ/Õ0ð1ñ #¡4©¥9Õ-ñ1r%   c               óf   € Wn         W n        W0n        W@n        WPn        W`n        Wpn        W€n        R # r'   ©rT   rU   rV   rW   rX   rY   rZ   r[   )	r(   rT   rU   rV   rW   rX   rY   rZ   r[   s	   &$$$$$$$$r"   r)   ÚCVEInfo.__init__¤   s3   € ð 'ÔØ(ÔØ ŒØŒ
Ø$ŒØ*Ôð )ÔØ 0Ör%   )rX   rY   rT   rW   rV   rU   r[   rZ   )r+   r,   r-   r.   r   r   r   r   r   r/   r)   r0   r1   r2   s   @r"   rS   rS      sÌ   ø‡ € áØØØ%ô	
ñ
 	ØØØ(ô	
ñ
 	ØØØ1ô	
ñ
 	ØÙ�oÓ&ØØ-ô		
ñ 	ØØØØ$ô		
ñ 	ØØØØ'ô		
ð9"€FðH1ð &*ð1ð '+ð1ð (,ð1ð 48ð1ð 15÷1÷ 1ð 1r%   rS   c                   ó‚   a € ] tR t^½t o ]! R]! ]R7      RR7      ]! R]! ]R7      RR7      .tRR/V 3R	 lR
 llt	Rt
V tR# )Ú
CVEsResultÚpackages)Ú	value_clszcA dictionary where the keys are installed package names and the values are AffectedPackage objects.r   rD   zMA dictionary where the keys are CVE names and the values are CVEInfo objects.Úapt_updated_atNc          	      ó–   <€ V ^8„  d   QhRS[ S[S[3,          RS[ S[S[3,          RS[P                  RS[S[P                  ,          /# )r   re   rD   Úvulnerability_data_published_atrg   )r   r;   rB   rS   r]   r   )r    r!   s   "€r"   r#   ÚCVEsResult.__annotate__Ë   sY   ø€ ÷ -ñ -ñ ‘s™OÐ+Õ,ð-ñ ‘3™�<Õ ð	-ñ *2×):Ñ):ð-ñ !¡×!2Ñ!2Õ3ñ-r%   c               ó6   € Wn         W n        W0n        W@n        R # r'   ©re   rD   ri   rg   )r(   re   rD   ri   rg   s   &$$$$r"   r)   ÚCVEsResult.__init__Ë   s   € ð !ŒØŒ	Ø/NÔ,Ø,Ör%   )rg   rD   re   ri   )r+   r,   r-   r.   r   r   rB   rS   r/   r)   r0   r1   r2   s   @r"   rd   rd   ½   sS   ø‡ € áØÙ Ô0Øuô	
ñ
 	ØÙ Ô(Ø_ô	
ð€Fð-ð 7;÷-÷ -ð -r%   rd   c                   óH   a € ] tR t^Üt o RtV 3R lR ltV 3R lR ltRtV tR# )Ú	CVEParserrD   c                óR   <€ V ^8„  d   QhRS[ S[S[3,          RS[ S[S[3,          /# )r   Úaffected_pkgÚreturn©r   r;   r   )r    r!   s   "€r"   r#   ÚCVEParser.__annotate__ß   s-   ø€ ÷ =ñ =Ù ¡¡c �Nð=á	‰c‘3ˆh�ñ=r%   c                ó:   € VP                  V P                  / 4      # r'   )ÚgetÚvulnerability_type)r(   rq   s   &&r"   Úget_package_vulnerabilitiesÚ%CVEParser.get_package_vulnerabilitiesß   s   € ð ×Ñ × 7Ñ 7¸Ó<Ð<r%   c                ón   <€ V ^8„  d   QhRS[ S[S[3,          RS[ S[S[3,          RS[ S[S[3,          /# )r   Úvulnerability_infoÚvulnerabilities_datarr   rs   )r    r!   s   "€r"   r#   rt   ä   sA   ø€ ÷ "ñ "á ¡¡c �Nð"ñ #¡3© 8�nð"ñ 
‰c‘3ˆh�ñ	"r%   c           
     ó  € VP                  R 4      '       dn   . pVP                  R/ 4      P                  R/ 4      pVR ,           F8  pVP                  RVRVP                  V/ 4      P                  RR4      /4       K:  	  W1R &   V# )rZ   Úsecurity_issuesÚusnsr5   rL   Ú )rv   Úappend)r(   r{   r|   rZ   Úusn_infoÚrelated_usns   &&&   r"   Ú _post_process_vulnerability_infoÚ*CVEParser._post_process_vulnerability_infoä   sš   € ð
 ×!Ñ! .×1Ò1ØˆLà+×/Ñ/Ð0AÀ2ÓF×JÑJØ˜óˆHð  2°.×AÐA�Ø×#Ñ#à Ø §¡¨k¸2Ó!>×!BÑ!BØ# Ró"ðöñ  Bð 2>˜~Ñ.à!Ð!r%   © N)	r+   r,   r-   r.   rw   rx   r„   r0   r1   r2   s   @r"   ro   ro   Ü   s   ø‡ € ØÐ÷=ð =÷
"ö "r%   ro   c                ó$   € V ^8„  d   QhR\         /# )r   rr   )r   )r    s   "r"   r#   r#   ÿ   s   € ÷ ñ ¬dñ r%   c                 óÊ   € V P                  R 4      ;'       d    V P                  R4      pVP                  '       d   V'       d   R# VP                  '       d   V'       g   R# R# )r6   r8   FT)rv   r   r   )ÚcveÚoptionsÚ
is_fixables   && r"   Úcve_status_match_optionsrŒ   ÿ   sC   € Ø—‘˜Ó'×AÐA¨C¯G©G°LÓ,A€Jà××ÐŸZÙØ	��ˆ§ÙÙr%   c                ó0   € V ^8„  d   QhR\         R\        /# )r   rŠ   rr   )r   rd   )r    s   "r"   r#   r#   	  s   € ÷ &ñ &Üð&äñ&r%   c                 ó*   € \        V \        4       4      # r'   )Ú_cvesr   )rŠ   s   &r"   rD   rD   	  s   € ô �œ(›*Ó%Ð%r%   c                ój   € V ^8„  d   QhR\         R\        \        \        3,          R\        R\        /# )r   rŠ   Úvulnerabilitiesri   rr   )r   r   r;   r   rd   )r    s   "r"   r#   r#     s8   € ÷ >ñ >Üð>äœ#œs˜(•^ð>ô &)ð>ô ñ	>r%   c                 ó,  € / p\        4       p\        VP                  R / 4      P                  4       4       F±  w  rV. p\        VP                  R. 4      R R7       Fh  p\	        W€4      '       g   K  VP                  \        VR,          VR,          VR,          VR,          R7      4       VP                  VR,          4       Kj  	  V'       g   K›  \        VR	,          VR
7      W5&   K³  	  \        VP                  R/ 4      P                  4       R R7       U	UU
u/ uFº  w  r˜W”9   g   K  T	\        VR,          \        P                  ! VR,          4      VR,          VR,          VR,          VR,          VP                  R. 4       U
u. uF0  p
\        V
P                  RR4      V
P                  RR4      R7      NK2  	  up
VP                  R. 4      R7      bK¼  	  ppp	p
\        VV\        P                  ! V4      \        4       R7      # u up
i u up
pp	i )re   rD   c                 ó   € V R ,          # )r5   r†   )r‰   s   &r"   Ú<lambda>Ú(_parse_vulnerabilities.<locals>.<lambda>  s   € ¸#¸f¾+r%   )Úkeyr5   r6   r7   r8   r>   rC   rH   r‘   c                 ó   € V ^ ,          # )r   r†   )Úvs   &r"   r”   r•   A  s   € ˜!˜Až$r%   rT   rU   Úubuntu_priorityrW   rX   rY   rZ   r€   rL   rP   r[   ra   rl   )ÚsetÚsortedrv   ÚitemsrŒ   r�   r4   ÚaddrB   rS   r   Úparse_rfc3339_daterK   rd   r   )rŠ   r‘   ri   re   Úallowed_cvesÚpkg_nameÚpackage_infoÚpkg_cvesr‰   Úcve_namerƒ   rD   s   &&&         r"   Ú_parse_vulnerabilitiesr¤     s
  € ð
 €HÜ“5€LÜ"(Ø×Ñ˜J¨Ó+×1Ñ1Ó3ö#Ñˆð ˆÜØ×Ñ˜V RÓ(Ñ.E÷
ˆCô (¨×5Ô5Ø—‘Ü&Ø  �[Ø$'¨Õ$6Ø#& |Õ#4Ø#& |Õ#4ô	ôð × Ñ   V¥Ö-ñ
÷ ‰8Ü!0Ø ,Ð->Õ ?Øô"ˆHÓñ'#ôR $Ø×ÑÐ 1°2Ó6×<Ñ<Ó>Ùõ
õ#ñ"
‰MˆHð Ñ#ô)	
ˆ”'Ø˜MÕ*Ü×0Ò0°°^Õ1DÓEØÐ*Õ+Ø�g•,Ø˜<Õ(Ø˜oÕ.ð $'§7¡7¨>¸2Ô#>óñ
 $?�Kô	 Ø$Ÿ™¨°Ó4Ø%Ÿ/™/¨'°2Ó6÷ñ $?ñð !ŸW™WÐ%7¸Ó<ô
ò 	
ñ 
ð# 	ò ô0 ØØÜ(,×(?Ò(?Ø+ó)
ô .Ó/ôð ùò!ùôs   Ä
HÄ*AHÆ6H
 Æ>HÈ
Hc                ó<   € V ^8„  d   QhR\         R\        R\        /# )r   rŠ   Úcfgrr   )r   r   rd   )r    s   "r"   r#   r#   P  s&   € ÷ ñ Üðä	ðô ñr%   c                ó  € V P                   '       d!   V P                  '       d   RV n         RV n        \        P                  ! 4       P                  p\        \        4       VVR7      pVP                  p\        V VVP                  R7      # )z|
This endpoint shows the CVE vulnerabilities in the system.
By default, this API will show all CVEs that affect the system.
F)Úparserr¦   Úseries)rŠ   r‘   ri   )
r   r   r   Úget_release_infor©   r   ro   Úvulnerabilities_infor¤   ri   )rŠ   r¦   r©   Úcve_vulnerabilities_resultÚcve_vulnerabilitiess   &&   r"   r�   r�   P  s{   € ð ××Ð˜WŸ_Ÿ_˜_Ø!ˆÔØˆŒä×$Ò$Ó&×-Ñ-€Fä!4Ü‹{ØØô"Ðð 5×IÑIÐä!ØØ+Ø(B×(bÑ(bôð r%   Úv1ÚCVEs)Úversionr5   ÚfnÚoptions_clsÚintroduced_inÚ35Úrequires_networkTÚexample_pythonzs
from uaclient.api.u.pro.security.cves.v1 import cves, CVEsOptions

options = CVEsOptions()
result = cves(options)
Úresult_classÚignore_result_classesÚ
exceptionsÚexample_clizpro api u.pro.security.cves.v1Úexample_jsonaŽ  
{
    "cves": {
      "CVE-2023-5678": {
        "cvss_score": 8.1,
        "cvss_severity": "high",
        "description": "description example",
        "notes": [
          "note example",
        ],
        "priority": "medium",
        "published_at": ".*"
      }
    },
    "packages": {
      "accountsservice": {
        "current_version": "0.6.40-2ubuntu11.6",
        "cves": [
          {
            "fix_origin": "esm-infra",
            "fix_status": "fixed",
            "fix_version": "0.6.40-2ubuntu11.6+esm1",
            "name": "CVE-2023-5678"
          }
        ]
      },
      "libaccountsservice0": {
        "current_version": "0.6.40-2ubuntu11.6",
        "cves": [
          {
            "fix_origin": "esm-infra",
            "fix_status": "fixed",
            "fix_version": "0.6.40-2ubuntu11.6+esm1",
            "name": "CVE-2023-5678"
          }
        ]
      }
    },
}
)*r]   Útypingr   r   r   r   Úuaclientr   r   Úuaclient.api.apir	   Úuaclient.api.data_typesr
   Ú+uaclient.api.u.pro.security.cves._common.v1r   r   Úuaclient.aptr   Úuaclient.configr   Úuaclient.data_typesr   r   r   r   r   r   r   r   r   r4   rB   rK   rS   rd   ro   rŒ   rD   r¤   r�   ÚendpointÚ_docr†   r%   r"   Ú<module>rÆ      s÷   ðÛ ß ,Ó ,ç !Ý (Ý 2÷õ 0Ý $÷	÷ 	ó 	ô�*ô ô4!%˜ô !%ôH�jô ô*�ô ô&;1ˆjô ;1ô|-�˜^ô -ô> "Ð#ô  "õFõ&õ>õBñ@ ØØ	ØØô	€ð �TØ˜Øð ð �JØ˜j˜\Ø�"ØÐ3Øð 'ð5‚r%   