From e222a2718c677b6751af4beede73670e5375e56e Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Mon, 23 Feb 2026 14:22:51 +0100 Subject: [PATCH] Anonymize IP addresses in get_full_log Mask IPv4 addresses in logs when collecting full log output: added a sed step that replaces the last two octets with "x.x" to avoid exposing full IPs (GDPR). Also updated the comment to reflect anonymization; existing steps that strip carriage returns and ANSI escape sequences remain in place before truncating with head -c. --- misc/api.func | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/misc/api.func b/misc/api.func index 7944dc4d9..a2cc42e07 100644 --- a/misc/api.func +++ b/misc/api.func @@ -391,9 +391,10 @@ get_full_log() { fi if [[ -n "$logfile" && -s "$logfile" ]]; then - # Strip ANSI codes and carriage returns, then truncate to max_bytes + # Strip ANSI codes, carriage returns, and anonymize IP addresses (GDPR) sed 's/\r$//' "$logfile" 2>/dev/null | sed 's/\x1b\[[0-9;]*[a-zA-Z]//g' | + sed -E 's/([0-9]{1,3}\.)[0-9]{1,3}\.[0-9]{1,3}/\1x.x/g' | head -c "$max_bytes" fi }