How to generate self-signed certificate for CBC sensor gateway
book
Article ID: 381390
calendar_today
Updated On:
Products
Carbon Black Cloud Endpoint Standard
Issue/Introduction
This KB article is created to explain how to generate a self-signed certificate for Carbon Black Cloud Sensor Gateway (CBC SGW).
SGW administrator might need to generate a self-signed certificate in below cases, but not limited to these mentioned:
There is a need to change the IP address or the FQDN configured previously in the SGW.
The default self-signed certificate was not generated during the creation of SGW due to a failure in acquiring an IP address via DHCP during the initial installation.
There are no certificates available under /opt/vmware/sgw/data/certs/ directory.
The administrator wants to switch from CA signed certificate to self-signed certificate temporarily while renewing the CA signed certificate
Environment
SGW 1.2+
Resolution
Instructions for generating the self-signed certificate and configuring SGW with that certificate:
The self-signed certificate can be generated using the SGW machine CLI, go to /tmp/ or escalate to root using su and go to /opt/vmware/sgw/data/certs
Copy below details to openssl-san.cnf file and modify the values below accordingly. IP.1 is your sgw ip address, hence modify it and DNS.2 is the FQDN of SGW, remove the DNS.2 line if you do not use FQDN for the SGW machine.
[req] default_bits = 2048 distinguished_name = req_distinguished_name req_extensions = req_ext x509_extensions = v3_req prompt = no [req_distinguished_name] C = Country ST = State L = City O = Organization OU = Organizational Unit CN = SGW_IP_ADDRESS_OR_FQDN
Note: Do not use long names under req_distinguished_name section for example instead of (United State of America use US) otherwise the generation will fail. It is not recommended to change not highlighted values in above details.
Execute below command, which will generate two files server.crt and server.key
Copy the content of both resulting files to a text file to use them in step 5
Run configure-sgw and choose the "tls settings">"Sensor Gateway">"Sensor Gateway Certificate">Paste the content of server.crt here and click Ctrl-d twice
Select the option "Sensor Gateway Certificate Private Key">Click Enter to skip entering the password, then paste the content of server.key file and click Ctrl-d twice to exit.
Click Back>Back>Save&quit, then confirm the changes by answering y.
The certificate at this point should have been renewed.
Push the self-signed certificate to the trust store of all your endpoint machines that are expected to communicate with the CBC Sensor Gateway.