mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-07-22 11:59:33 +00:00
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 <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
d900b2c9b1
commit
195602e7f1
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user