Information
The vCenter Server must deactivate CDP/LLDP on distributed switches unless used intentionally. vSphere Distributed Virtual Switch can engage in CDP or LLDP, potentially sharing sensitive unencrypted information, like IP addresses and system names, on the network. As it can aid adversaries in understanding or impersonating your environment, However, it is also extremely helpful for legitimate use cases. It is recommended to keep it deactivated unless necessary for troubleshooting or configuration validation.
NOTE: Nessus has not performed this check. Please review the benchmark to ensure target compliance.
Solution
$VDview = Get-VDSwitch -Name $VDS | Get-View
$ConfigSpec = New-Object VMware.Vim.VMwareDVSConfigSpec
$ConfigSpec.LinkDiscoveryProtocolConfig = New-Object VMware.Vim.LinkDiscoveryProtocolConfig
$ConfigSpec.LinkDiscoveryProtocolConfig.Protocol = 'cdp'
$ConfigSpec.LinkDiscoveryProtocolConfig.Operation = 'none'
$ConfigSpec.ConfigVersion = $VDview.Config.ConfigVersion
$VDview.ReconfigureDvs_Task($ConfigSpec)