Create an Ubuntu 20.04 snapshot on Hetzner Cloud that meets the DevSec Linux Baseline specification.
Configuration management is done via ansible using the os-hardening-role
of the ansible dev-sec collection.
Used roles see ansible/requirements.yml
packer is a great tool provided by Hashicorp, for more details see Packer by Hashicorp
On macOS using brew
brew install packer
export HCLOUD_TOKEN=<redacted>
# for verbose logging
# export PACKER_LOG=1
packer build hcloud-ubuntu-snapshot.pkr.hcl
Afterwards your can connect via ssh
on port 2222
.
# show all snapshots (customized images)
hcloud image list -t snapshot
# get all images with label ubuntu-snapshot
hcloud image list -o noheader -o "columns=id" -l ubuntu-snapshot