Powershell – Generate Microsoft CA signed SSL certificates with vSphere 5.1
The process of requesting certificates for vSphere 5.1 is a fairly grim, manual process. It's repetitive and easy to make a mistake on any step of the way. Since I've got to do this for quite a few VirtualCenter Servers, I thought I'd script the certificate generation if nothing else. I am following the excellent documentation provided in Implementing CA signed SSL certificates with vSphere 5.1 and more specifically in Creating certificate requests and certificates for vCenter Server 5.1 components.
The script assumes that:
- You have a working Certificate Authority
- You are in an Active Directory domain environment
- You have the relevant permissions to modify Certificate Templates, Request and Issue certificates.
- You have installed OpenSSL v1.0.1c or later.
You will need to modify the configuration section to suit your environment and the $WorkingDir folder should exist before you run the script.
Trouble with SCOM 2007 R2 Certificates? Validate the entire PKI path!
I learned something new today: SCOM 2007 R2 certificate based communications not only checks the validity of the certificate you use, but also the CA that issued it...let me expand:
Like many organisations there is a root CA (we'll call it ROOTCA01), and then a subordinate CA (we'll call that SUBCA01). OPSMGM01 has a certificate to identify itself and has certificates for ROOTCA01 and SUBCA01 in it's Trusted Root Certificate Authorities.
The certificate to secure the connection between OpsMgr Gateway (OPSGW01) and the OpsMgr Management Server (OPSMGM01) is issued by SUBCA01 and is installed on OPSGW01, and to validate the certificate chain SUBCA01's certificate is also installed in the Trusted Root Certification Authorities. Opening OPSGW01's certificate and examining the Certificate Path tab shows the certificate is valid all the way up to the issuing CA - SUBCA01.
The connection will not work - OPSGW01 logs the following events:
Log Name: Operations Manager
Source: OpsMgr Connector
Date: 05/01/2012 10:18:28
Event ID: 21016
Level: Error
Computer: opsgw01.definit.co.uk
Description: OpsMgr was unable to set up a communications channel to opsmgm01.definit.co.uk and there are no failover hosts. Communication will resume when opsmgm01.definit.co.uk is available and communication from this computer is allowed.Log Name: Operations Manager
Source: OpsMgr Connector
Date: 05/01/2012 10:18:25
Event ID: 20070
Level: Error
Computer: opsgw01.definit.co.uk
Description: The OpsMgr Connector connected to opsmgm01.definit.co.uk, but the connection was closed immediately after authentication occurred. The most likely cause of this error is that the agent is not authorized to communicate with the server, or the server has not received configuration. Check the event log on the server for the presence of 20000 events, indicating that agents which are not approved are attempting to connect.Log Name: Operations Manager
Source: OpsMgr Connector
Date: 05/01/2012 10:18:24
Event ID: 21002
Level: Warning
Computer: opsgw01.definit.co.uk
Description: The OpsMgr Connector could not accept a connection from xxx.xxx.xxx.xxx:5723 because mutual authentication failed.Log Name: Operations Manager
Source: OpsMgr Connector
Date: 05/01/2012 10:18:24
Event ID: 20067
Level: Warning
Computer: opsgw01.definit.co.uk
Description: A device at IP xxx.xxx.xxx.xxx:5723 attempted to connect but the certificate presented by the device was invalid. The connection from the device has been rejected. The failure code on the certificate was 0x800B0109 (A certificate chain processed, but terminated in a root certificate which is not trusted by the trust provider.).
It's the last event that led me to check the certificate chain for the SUBCA01 certificate, which was installed and trusted but did not validate up the chain to ROOTCA01. Installing the ROOTCA01 certificate resolved this issue.
Using System Center Operations Manager 2007 R2 Audit Collection Services for remote, DMZ or workgroup servers
SCOM 2007 R2’s Audit Collection Services (ACS from now on) is very useful for meeting compliance (e.g. Sarbanes Oxley) and security audit requirements – working with financial companies often requires such compliance. It’s pretty simple to install in a domain environment – you run the installer to create a collection server, then activate the forwarder on the client servers.
When it comes to servers you really want to audit, those that are by definition more at risk from security breach because they are publicly accessible, it’s not so straightforward. Take for example that web server, or FTP host in your DMZ, certainly not domain joined and probably bombarded by daily brute force password attacks. Select the SCOM agent in the console and enable Audit Collection Services?
