When the original sensor to server certificates expire, the sensors will no longer communicate with the server. This article goes over getting the sensors connected back up, generating a new set of client and server (self-signed) certificates that can be swapped out for continued communication.
The default certificates are good for 10 years.
ssl_verify_client off;
update:
EnforceClientCerts=False
add:
EnforceClientCertRevocation=False
standalone
/usr/share/cb/cbservice cb-enterprise restart
cluster
/usr/share/cb/cbcluster stop && /usr/share/cb/cbcluster start
Once we have verified sensors are able to connect and show online, the next step is to generate a new set of client certs.
mkdir /etc/cb/certs/expired_certs && cp /etc/cb/certs/cb-client* /etc/cb/certs/expired_certs/ && cp /etc/cb/certs/cb-server.* /etc/cb/certs/expired_certs/
cp /etc/redhat-release /etc/redhat-release.bkp && sed -i 's/7/8/' /etc/redhat-release
export FORCE_REGENERATE=client-ca
/usr/share/cb/cbssl certs --regenerate client-ca
mv /etc/redhat-release.bkp /etc/redhat-release && unset FORCE_REGENERATE
Revert the settings to allow client certificate checks to proceed. Any sensor that did not get the update group certificates signed by the new cb-client-ca will drop offline. These will either have to be re-installed or these checks will need to be removed until they show online again.
ssl_verify_client optional;
update:
EnforceClientCerts=True
add:
EnforceClientCertRevocation=True
The next step is to generate a temporary server certificate once all sensors are online with the checks still enforced. (Sensors will drop offline in the console after 5 minutes if the procedure failed).
chmod 700 temp_server_cert.sh
./temp_server_cert.sh $(hostname)
export FORCE_REGENERATE=legacy
cp /etc/redhat-release /etc/redhat-release.bkp && sed -i 's/7/8/' /etc/redhat-release
/usr/share/cb/cbssl certs --regenerate legacy
mv /etc/redhat-release.bkp /etc/redhat-release && unset FORCE_REGENERATE
/usr/share/cb/cbcluster sync-certs
#!/bin/sh
: '
### THIS SCRIPT GENERATES A TEMPORARY SELF SIGNED CERT WITH TWO SAN ENTRIES ###
When running the script, please add a domain name.
This is just used to name the files, however it may be easier to use the hostname.
./temp_server_cert.sh <domain name>
The two DNS entries are the SAN entries required for a custom certificate.
DNS.1
DNS.2
These can be anything you want as long as they are not DNS resolvable. Or you can use the default entered already.
Feel free to update certificate entry information
'
if [ "$#" -ne 1 ]
then
echo "Usage: Must supply a domain"
exit 1
fi
DOMAIN=$1
cat << EOF >> ${DOMAIN}_config.conf
[req]
distinguished_name = req_distinguished_name
x509_extensions = v3_req
prompt = no
[req_distinguished_name]
C = US
ST = MA
L = Waltham
O = Broadcom Carbon Black
OU = Support
CN = XXXX
[email protected]
[v3_req]
keyUsage = keyEncipherment, dataEncipherment
extendedKeyUsage = serverAuth
subjectAltName = @alt_names
[alt_names]
DNS.1 = edr.primary
DNS.2 = edr.minion
EOF
echo "Creating the self signed cert and key"
openssl req -x509 -nodes -days 1825 -newkey rsa:2048 -keyout ${DOMAIN}_private_sensor.key -out ${DOMAIN}_public_sensor.pem -config ${DOMAIN}_config.conf -extensions 'v3_req'