fix: never chmod 700 system dirs like /var/log (2.3.3-SAC)

Hardening state files under /var/log was applying chmod 700 to the parent
directory, which broke syslog/logrotate and other services after agent update.
This commit is contained in:
PTah
2026-07-25 13:20:05 +10:00
parent b0abf99d1b
commit c50bd6e9d8
8 changed files with 92 additions and 5 deletions
+1 -1
View File
@@ -31,7 +31,7 @@ Watchdog и таймеры watchdog **не изменяются** при обы
5. Ищет **`ssh-monitor`** в клоне (GitLab layout или плоский репозиторий).
6. Сравнивает **SHA256** с **`LOCAL_SCRIPT_PATH`** (`/usr/local/bin/ssh-monitor`).
7. **Всегда** синхронизирует **`sac-client.sh`**, **`ssh-monitor-perms.sh`**, watchdog.
8. Дописывает ключи конфига; **`apply_runtime_security_hardening`**: `chmod 600` конфиг, `700` spool, `600` state/SAC-файлы, whitelist.
8. Дописывает ключи конфига; **`apply_runtime_security_hardening`**: `chmod 600` конфиг, `700` spool (`/var/lib/ssh-monitor`), `600` state/SAC-файлы (в т.ч. под `/var/log/` **без** `chmod` на сам `/var/log`), whitelist.
9. При изменении **`ssh-monitor`**, **`sac-client.sh`** или конфига — **`systemctl restart ssh-monitor.service`**.
10. Лог: **`/var/log/update_script.log`** (блок «Итог обновления», строки `manifest` и `security hardening`).