r/ssu-user-ca: Configure sshd TrustedUserCAKeys

The `TrustedUserCAKeys` setting for *sshd(8)* tells the server to accept
any certificates signed by keys listed in the specified file.
The authenticating username has to match one of the principals listed in
the certificate, of course.

This role is applied to all machines, via the `base.yml` playbook.
Certificates issued by the user CA managed by SSHCA will therefore be
trusted everywhere.  This brings us one step closer to eliminating the
dependency on Active Directory/Samba.
frigate-exporter
Dustin 2024-02-01 18:44:52 -06:00
parent 0d30e54fd5
commit f83cea50e9
5 changed files with 29 additions and 0 deletions

View File

@ -4,6 +4,7 @@
- base
- role: ssh-host-certs
tags: ssh-host-certs
- ssh-user-ca
- hosts: kvm-guest
roles:
- serial-console

View File

@ -1,4 +1,6 @@
sshca_url: https://sshca.pyrocufflink.blue
ssh_trusted_user_ca_keys: >-
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINyi18IfxAf9wLnyffnMrThYpqxVwu0rsuiLoqW6rcwF sshca.pyrocufflink.blue
certbot_account_email: dustin@hatch.name
smtp:

View File

@ -0,0 +1 @@
ssh_trusted_user_ca_keys: ''

View File

@ -0,0 +1 @@
TrustedUserCAKeys /etc/ssh/ca.pub

View File

@ -0,0 +1,24 @@
- name: ensure sshd is configured to trust user ca keys
copy:
src: trustedusercakeys.conf
dest: /etc/ssh/sshd_config.d/70-trustedusercakeys.conf
owner: root
group: root
mode: u=rw,go=r
notify:
- reload sshd
tags:
- ssh-user-ca
- sshd-config
- config
- name: ensure ssh trusted user ca list is set
copy:
dest: /etc/ssh/ca.pub
content: >+
{{ ssh_trusted_user_ca_keys }}
owner: root
group: root
mode: u=rw,go=r
tags:
- ssh-user-ca