karimhabush / cis-vsphere

A tool to assess the compliance of a VMware vSphere environment against the CIS Benchmark.
MIT License
47 stars 17 forks source link

patches.json Generation #5

Open chall32 opened 1 year ago

chall32 commented 1 year ago

Hello,

How is patches.json generated?

Or is it obtained from VMware?

karimhabush commented 1 year ago

Hello,

patches.json is not being generated, it should be exported from VMWare ESXi official Patch Tracker. You can find it here : https://esxi-patches.v-front.de/ESXi-7.0.0.html

However, it would be great if we could automate that as well!

Karim,

chall32 commented 1 year ago

Try this:

$BuildNumber = "20842708"
Add-EsxSoftwareDepot https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml
$Image = Get-EsxImageProfile | Where Name -Like "*$BuildNumber-standard*"
$Image.VibList | Sort-Object | Select-Object Name,Version | ConvertTo-Json

Add-EsxSoftwareDepot and Get-EsxImageProfile are slow to get the data and complete (for me at least), so give them time to finish :wink:

karimhabush commented 1 year ago

Works like a charm!!! That will be a great addition!😃