From 195602e7f162989fbac65406d558a48a871b861a Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Sun, 4 Aug 2024 10:25:25 -0700 Subject: [PATCH] ssh: Mark secret strings in privileged actions Tests: - Run affected privileged actions through UI and notice that secret strings are not logged. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- plinth/modules/ssh/privileged.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plinth/modules/ssh/privileged.py b/plinth/modules/ssh/privileged.py index eb34fd559..f1a744fe5 100644 --- a/plinth/modules/ssh/privileged.py +++ b/plinth/modules/ssh/privileged.py @@ -12,7 +12,7 @@ import subprocess import augeas from plinth import action_utils, utils -from plinth.actions import privileged +from plinth.actions import privileged, secret_str config_file = pathlib.Path('/etc/ssh/sshd_config.d/freedombox.conf') @@ -93,7 +93,7 @@ def get_keys(user: str) -> str: @privileged -def set_keys(user: str, keys: str, auth_user: str, auth_password: str): +def set_keys(user: str, keys: str, auth_user: str, auth_password: secret_str): """Set SSH authorized keys.""" must_be_admin = user != auth_user _validate_user(auth_user, auth_password, must_be_admin=must_be_admin)