Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect "hostname" in nomad client and server certificates #40

Open
micafer opened this issue Sep 5, 2024 · 1 comment
Open

Incorrect "hostname" in nomad client and server certificates #40

micafer opened this issue Sep 5, 2024 · 1 comment
Assignees

Comments

@micafer
Copy link
Collaborator

micafer commented Sep 5, 2024

In the nomad client and server certificate:

shell: "echo '{}' | cfssl gencert -ca={{ path }}nomad-ca.pem -ca-key={{ path }}nomad-ca-key.pem -config={{ path }}cfssl.json -hostname=\"{{ ansible_hostname }},server.{{ nomad_region }}.nomad,server.{{ nomad_region }}.nomad,localhost,127.0.0.1,{{ ansible_default_ipv4.address }}\" - | cfssljson -bare server"
args:
chdir: "{{ path }}"
creates: "{{ path }}server.pem"
- name: "Generate client certificate"
shell: "echo '{}' | cfssl gencert -ca={{ path }}nomad-ca.pem -ca-key={{ path }}nomad-ca-key.pem -config={{ path }}cfssl.json -hostname=\"{{ ansible_hostname }},client.{{ nomad_region }}.nomad,client.{{ nomad_region }}.nomad,localhost,127.0.0.1,{{ ansible_default_ipv4.address }}\" - | cfssljson -bare client"

There is an error.
We are only generating one server/client certificate used in all the servers/clients, which is generated in the nomad_master node. So the "ansible_hostname" (or the IP address) always refers to the nomad_master node in all of them, and it may raise some SSL errors in applications accessing the nomad API.

Currently it is not a major issue, but we have to keep an eye.

@Sftobias
Copy link
Collaborator

Hi Miguel, i will check this as soon as i can.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants