From 5b0be4e677e11b03ae5140b04fff1292a10b46ce Mon Sep 17 00:00:00 2001 From: Pulse Monitor Date: Sat, 9 Aug 2025 10:23:21 +0000 Subject: [PATCH] security: fix critical vulnerabilities in auto-registration - Remove token logging - tokens were being logged in plaintext - Add client IP logging for security auditing - Add HTTPS warning when tokens sent over HTTP - Remove debug output that exposed tokens in console - Add optional auth requirement via REQUIRE_AUTH_FOR_AUTO_REGISTER env var - Prevent token exposure in error messages - Already has duplicate node prevention Security improvements: - Tokens no longer logged anywhere - Source IPs tracked for audit trail - Optional authentication for high-security environments - HTTPS enforcement warnings --- internal/api/config_handlers.go | 41 ++++++++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/internal/api/config_handlers.go b/internal/api/config_handlers.go index 3ffe48447..4d3710a6e 100644 --- a/internal/api/config_handlers.go +++ b/internal/api/config_handlers.go @@ -1623,6 +1623,12 @@ else # Send registration to Pulse PULSE_URL="%s" + + # Ensure we're using HTTPS for security (warn if not) + if [[ ! "$PULSE_URL" =~ ^https:// ]]; then + echo "⚠️ WARNING: Not using HTTPS - token will be sent unencrypted!" + echo " Consider accessing Pulse via HTTPS for security." + fi # Use jq or manual escaping to properly construct JSON REGISTER_JSON=$(cat <