Project

General

Profile

Actions

Bug #19392

closed

Rudder agent check should check if certificate matches private key

Added by Alexis Mousset almost 3 years ago. Updated over 2 years ago.

Status:
Released
Priority:
N/A
Category:
Agent
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
0
Name check:
To do
Fix check:
Checked
Regression:

Description

# We verify that the certificate belongs to the private key (Modulus is identical)
modulus_cert=$(openssl x509 -noout -modulus -in "${PPKEYS}/agent.cert")
modulus_key=$(openssl rsa  -noout -modulus -passin "pass:Cfengine passphrase" -in "${PPKEYS}/localhost.priv")
if [ "${modulus_cert}" != "${modulus_key}" ]; then
  echo "Certificate does not match agent key" >&2
  exit 1
fi
Actions

Also available in: Atom PDF