From b5a284655688441ca64c5ca1609fc09c022a90b3 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Fri, 8 May 2026 21:15:21 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=92=20[security=20fix]=20Move=20notifi?= =?UTF-8?q?cation=20logs=20to=20secure=20directory?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move `ha_notifications.log` from world-writable `/tmp` to `/Library/Logs/HomeAssistant/notifications.log` with restricted permissions (750). This mitigates potential symlink attacks, log injection, and unauthorized access to sensitive notification data. Changes: - Updated `config/default_config.yaml` with the new secure path. - Updated `docs/OFFICIAL_MACOS_GUIDE.md` documentation. - Modified `scripts/postinstall` to set secure (750) permissions on the log directory. - Modified `scripts/uninstall` to ensure cleanup of the new log path while maintaining legacy cleanup. Co-authored-by: Bwillou1 <162920784+Bwillou1@users.noreply.github.com> --- config/default_config.yaml | 2 +- docs/OFFICIAL_MACOS_GUIDE.md | 2 +- scripts/postinstall | 4 +++- scripts/uninstall | 3 +++ 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/config/default_config.yaml b/config/default_config.yaml index 3298c57..04a1124 100644 --- a/config/default_config.yaml +++ b/config/default_config.yaml @@ -89,7 +89,7 @@ notify: # Notifications système macOS - platform: file name: "macOS Notifications" - filename: "/tmp/ha_notifications.log" + filename: "/Library/Logs/HomeAssistant/notifications.log" timestamp: true # Configuration de l'automatisation diff --git a/docs/OFFICIAL_MACOS_GUIDE.md b/docs/OFFICIAL_MACOS_GUIDE.md index c69f3e4..5c125be 100644 --- a/docs/OFFICIAL_MACOS_GUIDE.md +++ b/docs/OFFICIAL_MACOS_GUIDE.md @@ -191,7 +191,7 @@ bluetooth: notify: - platform: file name: macos_notifications - filename: /tmp/ha_notifications.log + filename: /Library/Logs/HomeAssistant/notifications.log ``` #### Appareils Externes diff --git a/scripts/postinstall b/scripts/postinstall index a2629ec..3359420 100755 --- a/scripts/postinstall +++ b/scripts/postinstall @@ -16,7 +16,9 @@ mkdir -p "$HA_LOG_DIR" # Attribution des droits au nouvel utilisateur système chown -R $USER_NAME:$GROUP_NAME "$HA_CONFIG_DIR" "$HA_LOG_DIR" >/dev/null 2>&1 || true -chmod -R 755 "$HA_CONFIG_DIR" "$HA_LOG_DIR" >/dev/null 2>&1 || true +chmod -R 755 "$HA_CONFIG_DIR" >/dev/null 2>&1 || true +# Permissions plus restrictives pour les logs (sécurité) +chmod -R 750 "$HA_LOG_DIR" >/dev/null 2>&1 || true # Droits sur l'installation dans /opt if [ -d "/opt/homeassistant" ]; then diff --git a/scripts/uninstall b/scripts/uninstall index 538bb08..8b830ae 100755 --- a/scripts/uninstall +++ b/scripts/uninstall @@ -109,8 +109,11 @@ fi # 10. Nettoyage des fichiers temporaires log_info "Nettoyage des fichiers temporaires..." +# Nettoyage des anciens fichiers temporaires (sécurité) rm -f /tmp/ha_notifications.log 2>/dev/null || true rm -rf /tmp/homeassistant-* 2>/dev/null || true +# Nettoyage du nouveau fichier de notifications +rm -f /Library/Logs/HomeAssistant/notifications.log 2>/dev/null || true # 11. Suppression des entrées launchd restantes log_info "Nettoyage des entrées launchd..."