M1-Sicherheitsabschluss 10.11.2026: Fail2Ban-Abnahme, hostunabhängige LXC-Backups, Keycloak-Stabi + NPM-Rückfalltest, CT 104 entfernt
- Fail2Ban CT 103 funktional abgenommen (Image/Digest, Jails, Filter-Dry-Run, kontrollierter Ban/Unban 203.0.113.66 mit nftables-Nachweis, Dienstneustart, pct-Reboot); Befund proxy-host-14 im Jail-Glob nach Restart + SOP; frischer Rollback-vzdump d4478c85... - Hostunabhängige LXC-Backups: frische Stop-Mode-vzdumps CT 100/102/103/105, Archiv auf ghostnet-ki (gn-backup, quellbeschränkter PVE-Key) mit SHA-256- Verifikation, Restore-Test CT 100 -> CT 150 bestanden; deklarative Rollen gn_backup_receiver (KI) + pve_lxc_backup_sync (PVE, nächtlicher Timer, Prune 4/CT), beide konvergent changed=0 - Keycloak CT 102: 26 Tage stabil (NRestarts=0), Ansible-Drift changed=0, praktischer NPM-Rückfalltest auf CT 104 bestanden (Hosts 7/13 -> .16 -> .4); danach CT 104 nach Betreiberfreigabe archiviert + entfernt, historische CT-102-Altbackups gelöscht (SHA-256 dokumentiert), 10.0.0.16 aus WG-Set server_admin_targets entfernt - WAN/IPv6-Exposure erfasst: WAN nur TCP 80/443 offen, keine AAAA-Records - Doku: GNAI-000/001/013, GNAI-006/007/012/016, pve-host README, ct-104 README Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
@@ -0,0 +1 @@
|
||||
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIqx/qtzU4KXBGL0MOTNZoJ6AglcmxClIA/mrOv/mung ghostnet-backup@pve
|
||||
@@ -12,5 +12,6 @@
|
||||
- role: host_baseline
|
||||
- role: podman_runtime
|
||||
- role: workload_accounts
|
||||
- role: gn_backup_receiver
|
||||
- role: amd_gpu_access
|
||||
- role: gpu_fan_control
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
# gn_backup_receiver
|
||||
|
||||
Dedicated receiver account `gn-backup` (UID 999, GID 987) on `ghostnet-ki`
|
||||
for host-independent LXC backups. The Proxmox host pushes its vzdump
|
||||
archives here over SSH (role `pve_lxc_backup_sync` in
|
||||
`proxmox/pve-host/ansible`), so the LXC backups survive a full loss of the
|
||||
PVE host (GNAI-000 section 4, blocker 4).
|
||||
|
||||
- Locked password, no sudo, real shell only because ssh executes the
|
||||
receiving `tar` through it.
|
||||
- `authorized_keys` holds the PVE backup key
|
||||
(`files/ssh/pve-backup.pub`, fingerprint
|
||||
`SHA256:tabCXnfrKhWI2+0F8vZgLqg7JtWn1Xt4ifo8o2KuPNc`) restricted with
|
||||
`from="10.0.0.2"` and no forwarding.
|
||||
- Home `/var/lib/ghostnet-ai-backup` stays root-owned `0711` (traversable
|
||||
for sshd StrictModes, not writable); the AI backup archives written by
|
||||
the root `gnai-ai-backup` timer stay root-owned. Only `lxc/` and `.ssh/`
|
||||
belong to `gn-backup`.
|
||||
|
||||
Verified 2026-11-10: archives for CT 100/102/103/105 copied from PVE,
|
||||
SHA-256 match confirmed; practical restore test of the CT 100 archive to a
|
||||
scratch CT passed.
|
||||
@@ -0,0 +1,24 @@
|
||||
---
|
||||
# Dedicated receiver account for host-independent LXC backups (GNAI-000
|
||||
# section 4, blocker 4). The Proxmox host pushes vzdump archives here over
|
||||
# SSH (see proxmox/pve-host/ansible role pve_lxc_backup_sync). The account
|
||||
# has no sudo and a locked password; the key is source-restricted to the
|
||||
# PVE host. It needs a real shell because ssh executes the tar/rsync
|
||||
# receiver command through it.
|
||||
gn_backup_account:
|
||||
name: gn-backup
|
||||
uid: 999
|
||||
gid: 987
|
||||
comment: Ghostnet LXC backup receiver (host-independent vzdump copies from PVE)
|
||||
home: /var/lib/ghostnet-ai-backup
|
||||
shell: /bin/bash
|
||||
|
||||
# The home directory itself stays root-owned; only traversal (0711) is
|
||||
# needed so sshd can read ~/.ssh/authorized_keys under StrictModes. The
|
||||
# AI backup archives written by the root backup timer remain root-owned.
|
||||
gn_backup_home_mode: "0711"
|
||||
gn_backup_lxc_dir: /var/lib/ghostnet-ai-backup/lxc
|
||||
|
||||
# Restrictions for the PVE backup key (public key in files/ssh/pve-backup.pub).
|
||||
gn_backup_ssh_options: 'from="10.0.0.2",no-agent-forwarding,no-port-forwarding,no-X11-forwarding,no-user-rc'
|
||||
gn_backup_pubkey_file: pve-backup.pub
|
||||
@@ -0,0 +1,52 @@
|
||||
---
|
||||
- name: Create the gn-backup group
|
||||
ansible.builtin.group:
|
||||
name: gn-backup
|
||||
gid: "{{ gn_backup_account.gid }}"
|
||||
system: true
|
||||
state: present
|
||||
|
||||
- name: Create the locked gn-backup receiver account
|
||||
ansible.builtin.user:
|
||||
name: "{{ gn_backup_account.name }}"
|
||||
uid: "{{ gn_backup_account.uid }}"
|
||||
group: gn-backup
|
||||
comment: "{{ gn_backup_account.comment }}"
|
||||
home: "{{ gn_backup_account.home }}"
|
||||
shell: "{{ gn_backup_account.shell }}"
|
||||
create_home: false
|
||||
system: true
|
||||
password_lock: true
|
||||
state: present
|
||||
|
||||
- name: Keep the backup home traversable but root-owned
|
||||
ansible.builtin.file:
|
||||
path: "{{ gn_backup_account.home }}"
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: "{{ gn_backup_home_mode }}"
|
||||
|
||||
- name: Create the gn-backup .ssh directory
|
||||
ansible.builtin.file:
|
||||
path: "{{ gn_backup_account.home }}/.ssh"
|
||||
state: directory
|
||||
owner: "{{ gn_backup_account.name }}"
|
||||
group: gn-backup
|
||||
mode: "0700"
|
||||
|
||||
- name: Install the source-restricted PVE backup key
|
||||
ansible.builtin.copy:
|
||||
content: "{{ gn_backup_ssh_options }} {{ lookup('ansible.builtin.file', role_path ~ '/../../files/ssh/' ~ gn_backup_pubkey_file) }}"
|
||||
dest: "{{ gn_backup_account.home }}/.ssh/authorized_keys"
|
||||
owner: "{{ gn_backup_account.name }}"
|
||||
group: gn-backup
|
||||
mode: "0600"
|
||||
|
||||
- name: Create the LXC backup target directory
|
||||
ansible.builtin.file:
|
||||
path: "{{ gn_backup_lxc_dir }}"
|
||||
state: directory
|
||||
owner: "{{ gn_backup_account.name }}"
|
||||
group: gn-backup
|
||||
mode: "0700"
|
||||
Reference in New Issue
Block a user