client_pki : SANs explicites sur le certificat d'hôte (mTLS)
step ca certificate ne recevait aucun --san explicite. Ajout d'une liste client_pki_sans (FQDN + nom court + IP) et d'une boucle --san dans la commande. Le cert porte désormais DNS:fqdn, DNS:court, IP:adresse — avec EKU Server+Client Auth, prêt pour un mTLS bidirectionnel. Vérifié sur infra-dns-01 (ré-émission). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
a8319d4367
commit
a5903f192b
2 changed files with 8 additions and 0 deletions
|
|
@ -13,6 +13,13 @@ client_pki_nom_cert: "{{ ansible_fqdn | default(ansible_hostname) }}"
|
|||
client_pki_cert: "{{ client_pki_steppath }}/certs/{{ client_pki_nom_cert }}.crt"
|
||||
client_pki_cle: "{{ client_pki_steppath }}/certs/{{ client_pki_nom_cert }}.key"
|
||||
|
||||
# SANs du certificat (FQDN + nom court + IP). Requis pour un mTLS moderne :
|
||||
# les clients TLS valident par le SAN, pas par le CN.
|
||||
client_pki_sans:
|
||||
- "{{ client_pki_nom_cert }}"
|
||||
- "{{ ansible_hostname | default('') }}"
|
||||
- "{{ ansible_host | default('') }}"
|
||||
|
||||
# Secrets OBLIGATOIRES (Ansible Vault).
|
||||
client_pki_ca_fingerprint: "{{ vault_step_ca_fingerprint | default('') }}" # rempli depuis la voute (vault_step_ca_fingerprint)
|
||||
client_pki_provisioner_password: "{{ vault_step_ca_provisioner_password | default('') }}" # rempli depuis la voute (vault_step_ca_provisioner_password)
|
||||
|
|
|
|||
|
|
@ -73,6 +73,7 @@
|
|||
{{ client_pki_cert }} {{ client_pki_cle }}
|
||||
--provisioner {{ client_pki_provisioner }}
|
||||
--provisioner-password-file {{ client_pki_steppath }}/provisioner.pass
|
||||
{% for s in client_pki_sans | select | unique %}--san {{ s }} {% endfor %}
|
||||
--force
|
||||
creates: "{{ client_pki_cert }}"
|
||||
environment:
|
||||
|
|
|
|||
Loading…
Reference in a new issue