You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there, thank you for your extensive work on this collection !
I am building a system image that will be written to multiple devices produced on an assembly line, and that will perform some of the configuration at runtime once deployed (à la cloud-init)
however, i am facing a slight hickup when using the ssh_hardening role of this collection: it requires host key files, that i assume should be generated independently on each instance on its first boot, and therefore can't exist at "build" time.
i'm using a debian base.
Reproduction steps
image_rootfs=$(mktemp -d)pushd$(mktemp -d)# get a base rootfs
docker export$(docker create python) --output="rootfs.tar"
tar -xvf rootfs.tar -C "${image_rootfs}"
rm rootfs.tar
# write the inventory file
cat <<EOF >> inventory[chroots]${image_rootfs} ansible_connection=chrootEOF# write the playbook
cat <<EOF >> playbook.yaml- hosts: chroots roles: - devsec.hardening.ssh_hardeningEOF
ansible-galaxy collection install "devsec.hardening:==8.8.0"
sudo ansible-playbook -i inventory -D playbook.yaml
Current Behavior
Does the following without a way to opt-out
generates a 4096 bits rsa keypair
requires the presence of /etc/ssh/ssh_host_*_key files
mbenabda
changed the title
sshd_hardening role cannot be used to build the same image for multiple instances
sshd_hardening role cannot be used to build system images
Sep 27, 2023
The hostkeys get created/installed when you install the openssh-server package on debian, which is not installed in the image you used in the example (python).
Do you plan on using the ssh-server on your appliances? If yes, I propose to install the package before running the hardening role.
Description
Hi there, thank you for your extensive work on this collection !
I am building a system image that will be written to multiple devices produced on an assembly line, and that will perform some of the configuration at runtime once deployed (à la cloud-init)
however, i am facing a slight hickup when using the ssh_hardening role of this collection: it requires host key files, that i assume should be generated independently on each instance on its first boot, and therefore can't exist at "build" time.
i'm using a debian base.
Reproduction steps
Current Behavior
Does the following without a way to opt-out
/etc/ssh/ssh_host_*_key
filesHere are relevant logs of the playbook run:
Expected Behavior
the role provides a way to opt out from these validations
OS / Environment
Ansible Version
Collection Version
Additional information
Please let me know if I missed something
Thank you !
The text was updated successfully, but these errors were encountered: