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

Feature Request: Alpine support for ssh hardening #724

Open
haxwithaxe opened this issue Nov 25, 2023 · 1 comment
Open

Feature Request: Alpine support for ssh hardening #724

haxwithaxe opened this issue Nov 25, 2023 · 1 comment

Comments

@haxwithaxe
Copy link

Description

It would be nice to have support for Alpine Linux in the various parts of this collection. In particular I'm interested in the SSH hardening part. Better security automation for a popular distribution has obvious benefits such as a lower barrier to good security hygiene.

Solution

Adding a vars file for Alpine seems to be sufficient for a lot of the functionality. I haven't fully exercised the ssh hardening functionality (ie nothing to do with SELinux) so I don't know how hard it would be to fully implement but copying and pasting the Debian.yml and lightly modifying it was enough for me to do what I needed. Below is the snippet from the group_vars I used successfully.

...
os_vars:
  sshd_path: /usr/sbin/sshd
  ssh_host_keys_dir: /etc/ssh
  sshd_service_name: sshd  # changed from `ssh`
  ssh_owner: root
  ssh_group: root
  ssh_host_keys_owner: root
  ssh_host_keys_group: root
  ssh_host_keys_mode: '0600'
  ssh_selinux_packages: []  # changed from a list of packages

  # true if SSH support Kerberos
  ssh_kerberos_support: true

  # true if SSH has PAM support
  ssh_pam_support: true

  sshd_moduli_file: /etc/ssh/moduli

  sshd_disable_crypto_policy: false
...

Alternatives

As described above manually adding an os_vars based on Debian's to the relevant group_vars in my playbook was enough for my limited purposes.

Additional information

If there is interest in this feature but no bandwidth available to implement it in the project I may be able to provide a PR so let me know If you're interested.
I really like this project and it would be great to help out if it's desired.

@schurzi
Copy link
Contributor

schurzi commented Dec 1, 2023

We are open to adding Alpine support. So if you want, please create a PR.
Thanks a lot in advance!

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

No branches or pull requests

2 participants