Disabling JMX listener ports for vCenter Server (Windows)
book
Article ID: 336228
calendar_today
Updated On:
Products
VMware vCenter Server
Issue/Introduction
This article provides the steps to disable JMX ports on some vCenter Server and Platforms Services Controller components. This is to address the security vulnerability defined in CVE-2016-3427.
The following steps are applicable only to vCenter Server 6.0 (Embedded or External PSC).
Environment
VMware vCenter Server 6.0.x
Resolution
Disabling JMX port Manually on Single Sign-On
Login to Platform Services Controller Windows host.
Run the following command to verify that JMX port is enabled: netstat -apn tcp | findstr 6969. An output similar to the following is displayed: C:\Users\Administrator>netstat -apn tcp | findstr 6969 TCP 127.0.0.1:6969 0.0.0.0:0 LISTENING
Take backup of catalina.properties file installed by vmware-sts. The following is the the default location of catalina.properties file: C:\ProgramData\VMware\vCenterServer\runtime\VMwareSTSService\conf\catalina.properties
Open and edit the catalina.properties file using a text editor.
Search the following configuration line: base.jmx.port=6969
Replace 6969 with -1, the configuration line should be similar to the following: base.jmx.port=-1
Save the file and close the editor.
To restart the VMware Security Token Service, perform the following steps:
Click Start, click in the Start Search box.
Type services.msc, press ENTER.
Select VMware Security Token Service and click Restart.
Select Yes on the Restart Other Services prompt.
Run the following command to verify if all the services are successfully restarted, and that JMX port is now disabled: netstat -apn tcp | findstr 6969 Note: This should not show any listening ports on 6969
Disabling JMX port Manually on VDCS
Login to vCenter Server windows host.
Take backup of catalina.properties file installed by vmware-vdcs. The following is the the default location of catalina.properties file: C:\Program Files\VMware\vCenter Server\vdcs\vdcserver\conf\catalina.properties
Open and edit the catalina.properties file using a text editor.
Search the following configuration line: base.jmx.port= Note: You can use default port number 51058 to run netstat.
Run the following command to verify that JMX port is enabled: netstat -apn tcp | findstr 51058 An output similar to the following is displayed: C:\Users\Administrator>netstat -apn tcp | findstr 51058 TCP 127.0.0.1:51058 0.0.0.0:0 LISTENING
Replace 51058 with -1, the configuration line should be similar to the following: base.jmx.port=-1
Save the file and close the editor.
To restart the VDCS Service, perform the following steps:
Click Start, click in the Start Search box.
Type services.msc, press ENTER.
Select VMware Content Library Service and click Restart.
Select Yes on the Restart Other Services prompt.
Run the following command to verify if all the services are successfully restarted, and that JMX port is now disabled: netstat -apn tcp | findstr 51058 Note: This should not show any listening ports on 51058. Port 51058 is the port number mentioned in catalina.properties against base.jmx.port.
Disabling JMX port Manually on vCenter Server (Perfchart)
Login to Windows vCenter Server using mstsc.
Run the following command to verify that JMX port is enabled: netstat -apn tcp | findstr 6070 An output similar to the following is displayed: C:\Users\Administrator>netstat -apn tcp | findstr 6070 TCP 127.0.0.1:6070 0.0.0.0:0 LISTENING
Take backup of catalina.properties file installed by vmware-perfchart. The following is the the default location of catalina.properties file: C:\ProgramData\VMware\vCenterServer\data\perfcharts\tc-instance\conf\catalina.properties
Open and edit the catalina.properties file using a text editor.
Search the following configuration line: base.jmx.port= Note: You can use default port number 6070 to run netstat.
Replace 6070 with -1, the configuration line should be similar to the following: base.jmx.port=-1
Save the file and close the editor.
To restart the VMware Perfchart Service, perform the following steps:
Click Start, click in the Start Search box.
Type services.msc, press ENTER.
Select VMware Perfchart Service and click Restart.
Select Yes on the Restart Other Services prompt.
Run the following command to verify if all the services are successfully restarted, and that JMX port is now disabled: netstat -apn tcp | findstr 6070 Note: This should not show any listening ports on 6070.
Disabling JMX port on Windows Using Python Script
Login to vCenter Server/Platform Services Controller Windows host.
Download the DisableJMX.py script file attached to the KB article to the following location: C:\DisableJMX.py
Run the DisableJMX.py script by passing through the catalina.properties file path as an argument. Note: Make sure you use the python binary provided by VMware vCenter Server by opening command prompt at location C:\Program Files\VMware\vCenter Server\python\ For example: python.exe C:\DisableJMX.py C:\ProgramData\VMware\vCenterServer\runtime\VMwareSTSService\conf\catalina.properties
The default catalina.properties paths for the components are: VMware Security Token Service: C:\ProgramData\VMware\vCenterServer\runtime\VMwareSTSService\conf\catalina.properties Note: After running the script you need to manually restart STS service.
VMware Perfcharts: C:\ProgramData\VMware\vCenterServer\data\perfcharts\tc-instance\conf\catalina.properties Note: After running the script you need to manually restart perfcharts service. VMware VDCS: C:\Program Files\VMware\vCenter Server\vdcs\vdcserver\conf\catalina.properties Note: After running the script you need to manually restart Content Libraryservice.
Check if DisableJMX.py script restarted services.
Run the following command to verify if the JMX port is disabled: netstat -apn tcp | findstr 6969. Note: This should not show any listening ports on 6969 netstat -apn tcp | findstr 6070 Note: This should not show any listening ports on 6070 netstat -apn tcp | findstr 51058 Note: This should not show any listening ports on 6969