In this second blog article, I discuss what to do with compromised vSphere 6.0 Certificates issues by a PSC to vSphere components. As mentioned in the previous blog article, you cannot revoke certificates issued by a PSC either using an installed intermediate certificate from an external CA or using its own root. You must regenerate all certificates instead.
FYI, this post assumes you’re using the VCSA. Windows installable vCenter is nearly identical, aside from the path to Certificate Manager.
Compromised vSphere 6.0 Certificates – Embedded PSC With Own Root Certificate
If you have compromised vSphere 6.0 certificates automatically generated from an embedded PSC, you must regenerate all certificates. Yes, you must regenerate even certificates you don’t suspect, too.
To do this:
- Login as root into your embedded vCenter server via console, SSH, etc.
- Enter into shell. If you didn’t enable shell via the console, you can run “shell.set –enable True” and then run “shell”.
- Run the certificate manager utility. For the VCSA, you simply run /usr/lib/vmware-vmca/bin/certificate-manager
- Select option 4 – Regenerate a new VMCA Root Certificate and replace all certificates.
- Certificate Manager asks for various pieces of information for each certificate regeneration such as the country, organization, OrgUnit, State, Locality, email, etc. These are cosmetic values mostly, and are only visible if someone really examines the certificate. Functionally, they make no difference. However, I wanted to call your attention to a couple of things that are very important. It is VERY CRITICAL you do the following for each certificate, or else the process will fail!
- There is a bug in the certificate automation tool, where if you answer identical values for all questions asked, the same certificate will be generated for that cert. You’ll notice there are multiple certs that end up being regenerated. You can tell which one is being regenerated with the following line: “Please configure root.cfg with proper values before proceeding to next step.” That means the root certificate is being regenerated. You’ll see various certs as well like “machine”, “machine-ssl”, “vpxd.cfg”, etc. Each one of these certs must actually be unique. Ensure that you give at least some different value for one of the questions asked for every cert regenerated for a server. By far, the easiest way to do this is to answer the following question uniquely for every cert: “Enter proper value for ‘Name’ [Default value : CA]” Simply name it an abbreviated name of the server and the certificate name. In this case, you could call it “VC-ROOTCFG”. Answering every other question identically won’t hurt.
- One question that is more than cosmetic that you must answer correctly is: “Enter proper value for ‘Hostname’ [Enter valid Fully Qualified Domain Name(FQDN), For Example : example.domain.com]”. Make sure this is the actual DNS name for the vCenter server.
- When prompted afterregenerating all certificates, stop and start all services using:
- service-control –stop –all
- service-control –start –all
- I would recommend rebooting your vCenter server now.
- Download your root certificate again and reimport into GPO or however you established trust on the clients for the root originally.
- Fix all trust issues with external products. (See part 3 of this series!)
This is probably the one time you might actually want an embedded PSC for vCenter. This is far simpler than if you have an external PSC. (I still recommend external PSC’s in all cases for the record!!!)
Compromised vSphere 6.0 Certificates – External PSC(s) With Own Root Certificate
This is somewhat similar. However, keep in mind each PSC is a CA. Therefore, you probably should do this on every PSC that’s a part of the same environment if you suspect certificate(s) have been compromised.
To do this:
- Login as root into your external PSC server via console or SSH.
- Enter into shell. If you didn’t enable shell via the console, you can run “shell.set –enable True” and then run “shell”.
- Run the certificate manager utility. For the VCSA, you simply run /usr/lib/vmware-vmca/bin/certificate-manager
- Select option 4 – Regenerate a new VMCA Root Certificate and replace all certificates.
- Certificate Manager asks for various pieces of information for each certificate regeneration such as the country, organization, OrgUnit, State, Locality, email, etc. These are cosmetic values mostly, and are only visible if someone really examines the certificate. Functionally, they make no difference. However, I wanted to call your attention to a couple of things that are very important. It is VERY CRITICAL you do the following for each certificate, or else the process will fail!
- There is a bug in the certificate automation tool, where if you answer identical values for all questions asked, the same certificate will be generated for that cert. You’ll notice there are multiple certs that end up being regenerated. You can tell which one is being regenerated with the following line: “Please configure root.cfg with proper values before proceeding to next step.” That means the root certificate is being regenerated. You’ll see various certs as well like “machine”, “machine-ssl”, “vpxd.cfg”, etc. Each one of these certs must actually be unique. Ensure that you give at least some different value for one of the questions asked for every cert regenerated for a server. By far, the easiest way to do this is to answer the following question uniquely for every cert: “Enter proper value for ‘Name’ [Default value : CA]” Simply name it an abbreviated name of the server and the certificate name. In this case, you could call it “PSC1-ROOTCFG”. Answering every other question identically won’t hurt.
- One question that is more than cosmetic that you must answer correctly is: “Enter proper value for ‘Hostname’ [Enter valid Fully Qualified Domain Name(FQDN), For Example : example.domain.com]”. Make sure this is the actual DNS name for this server. Even if it asks for a cert for the web client, do NOT put in the name of the vCenter server. It will also ask for an optional IP address. Obviously, if you input one, make sure it’s the correct one.
- When prompted after regenerating all certificates, stop and start all services using:
- service-control –stop –all
- service-control –start –all
- I recommend rebooting the machine when you’ve completed this.
- To verify the PSC cert reset worked, attempt to go to https://FQDNofPSC.domain.com/psc to ensure you get a login prompt. If you don’t, the certificate reset failed. Stop and redo this portion again. You likely didn’t provide some kind of different answer to one of the questions for each certificate to make them unique.
- Run Certificate Manager on your vCenter server(s). Here’s where it gets weird. VMware says you should run Option 3 – Replace Machine SSL certificater with VMCA Certificate and answer the questions. Next, run Option 6 – Replace Solution user certificates with VMCA certificates. That didn’t work for me. The only way I could get it to work is run Option 8 – Reset all certificates. That’s the only way I could get it to work. I found another oddity. During this process, you are asked: “Performing operation on distributed setup, Please provide valid Infrastructure Server IP.” If I entered an IP address, and did the rest correctly (remember to answer the questions but provide a different value for name for each certificate!), the process would kick off, get stuck at a long time here and eventually fail:Status : 85% Completed [starting services…]
Error while starting services, please see log for more details
Status : 0% Completed [Operation failed, performing automatic rollback]Error while replacing Machine SSL Cert, please see /var/log/vmware/vmcad/certificate-manager.log for more information.
Then the certificates would roll back. Enter the FQDN of one of your PSC servers instead! That allows it to continue.
- Download your root certificate again and re-import into GPO or however you established trust on the clients for the root originally.
- Fix all trust issues with external products. (See part 3 of this series!)
This is far more complicated than the first one, but it’s probably the one you’re more likely to need to do.
Compromised vSphere 6.0 Certificates – Intermediate CA
If you installed a now compromised intermediate CA certificate, revoke the intermediate certificate within the external PKI. You should then request and install a new intermediate certificate within the PSC. Then proceed with regenerating certificates for all other components. (See above…)
And that’s how you deal with compromised vSphere 6.0 Certificates. In part 3, I’ll delve into how to fix trust issues with various products that might arise from regenerating these certificates.