Closed dariommr closed 2 years ago
The function that we are using to parse config.yml
to bash is not ideal, this function does not distinguish if a server IP comes from one node or another, it just passes everything into the same array. Moreover, right now we can't pass more than one IP to one node, it is a one-to-one relationship. So, the function needs to be changed, this also means that the variables would probably change the way we are getting them.
I have found a function that allows us to do more things with the YAML files, it is more accurate that the previous one. The function is based on the previous one: Function , Credits
I have only added this line gsub(\"name: \", \"\");
due to the names were not parse correctly.
Example of both functions output:
Now, we can separate the nodes IP's.
By changing this we also need to change the variables.
Now that all of this is done, we need to make some changes in the cert_generateCertificateconfiguration
function.
Right now our certificates file looks like this.
[ req ]
prompt = no
default_bits = 2048
default_md = sha256
distinguished_name = req_distinguished_name
x509_extensions = v3_req
[req_distinguished_name]
C = US
L = California
O = Wazuh
OU = Wazuh
CN = cname
[ v3_req ]
authorityKeyIdentifier=keyid,issuer
basicConstraints = CA:FALSE
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
subjectAltName = @alt_names
[alt_names]
IP.1 = cip
It has to be changed to include more IPs in the alt_names
section.
Hello Team, When configuring cluster nodes that contain more than one IP address (such as CCS, CCR) we need to create the certificates with multiple IP addresses (Subject Alternative Names)
My request is to add this feature to the wazuh-cert-tool.
Thank you in advance!