Copied from the environment repository's roles and scrubbed for the Collection: galaxy namespace mortis, molecule scenarios call the roles by their FQCN and take their paths from the workflow, README examples use mortis.kamino.* and documentation addresses, repository-local references (issue numbers, ADRs, inventory paths) are dropped. network_interfaces loses its Legacy name guard and the molecule play that tested it: the guard only protected the in-repo rename, and a new consumer never had the old names. mock_roles in .ansible-lint lists both FQCNs. Not verified locally: the molecule scenarios (they run on the kamino-molecule runner in CI) and ansible-test sanity. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
54 lines
2.0 KiB
YAML
54 lines
2.0 KiB
YAML
---
|
|
# Per-systemd_hardening_system_type policy. Overridable from group_vars/host_vars: set
|
|
# systemd_hardening_disable_services_extra (replaces the list for every type in that scope), or
|
|
# override systemd_hardening_profiles (replaces ALL profiles, so copy the ones you
|
|
# keep). Not in vars/ or include_vars: both outrank group_vars and host_vars.
|
|
systemd_hardening_profiles:
|
|
pve:
|
|
disable_services_extra: []
|
|
ubuntu_lxc:
|
|
# Not present or not meaningful in an LXC
|
|
disable_services_extra:
|
|
- systemd-journal-remote
|
|
ubuntu_vm:
|
|
disable_services_extra:
|
|
- multipathd
|
|
|
|
# Default services to disable globally
|
|
systemd_hardening_disable_services:
|
|
- rpcbind
|
|
- avahi-daemon
|
|
- cups
|
|
- bluetooth
|
|
- nfs-server
|
|
|
|
# Added to the list above for this systemd_hardening_system_type. Lazy (read at use), no set_fact,
|
|
# so a group_vars override of the flat name wins.
|
|
systemd_hardening_disable_services_extra: "{{ systemd_hardening_profiles[systemd_hardening_system_type].disable_services_extra }}"
|
|
|
|
# What the role actually disables: base + extra. Read-only result, do not set.
|
|
systemd_hardening_disable_services_effective: "{{ systemd_hardening_disable_services + systemd_hardening_disable_services_extra }}"
|
|
|
|
# High-risk services to mask completely (security policy)
|
|
systemd_hardening_mask_services:
|
|
- telnet
|
|
- rsh
|
|
- rlogin
|
|
- xinetd
|
|
|
|
# Per-service hardening overrides (opt-in)
|
|
# Map of <unit name without .service> -> {Directive: value}. Values render as:
|
|
# booleans -> yes/no, lists -> space-joined, everything else as-is.
|
|
# Example:
|
|
# systemd_hardening_services:
|
|
# myservice:
|
|
# ProtectSystem: "strict"
|
|
# NoNewPrivileges: true
|
|
#
|
|
# Do NOT add ssh/sshd here. Sandboxing directives on sshd.service
|
|
# (ProtectSystem, PrivateTmp, NoNewPrivileges, ...) are inherited by every
|
|
# SSH login session and everything spawned from it, including sudo. That
|
|
# makes admin and Ansible sessions see a read-only filesystem / private /tmp
|
|
# and can break privilege escalation. Harden sshd via the sshd role instead.
|
|
systemd_hardening_services: {}
|