4 Commits

Author SHA1 Message Date
Sunil Mohan Adapa
195602e7f1
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>
2024-08-11 12:57:25 -04:00
James Valleroy
09d8ee1b8e
ssh: Add sudo to allowed groups
This is to allow vagrant user to login, as well as a normal sudo user
that was created before installing FreedomBox.

For most FreedomBoxes, the sudo group is empty, so it will have no
impact.

I do not update the existing file. But if someone needs this update,
they can disable and then re-enable the restrict option.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2023-01-13 07:41:49 -08:00
Sunil Mohan Adapa
21c8a8945f
ssh: Restrict logins to groups root, admin and freedombox-ssh
Tests:

- Remove restricted console logins. Try to login via SSH with non-admin and note
that it fails. sudo into the user succeeds.

- Add a user to freedombox-ssh group from Users & Groups app. Login with SSH
succeeds.

- Login with admin user succeeds with and without adding to freedombox-ssh
group.

- On a fresh install, non-admin users are not restricted.

- On an upgrade from a version with the patch, non-admin users are restricted.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-12-05 20:47:08 -05:00
Sunil Mohan Adapa
12cf5065b0
ssh: Use privileged decorator for actions
Tests:

- Functional tests work
- Updating SSH keys in user edit page sets the SSH keys. File is updated
  properly. Page shows newly set SSH keys.
  - Entering invalid auth credentials throws error
- Enabling/disabling SSH password authentication works.
  - Configuration file is updated.
  - App page shows proper value

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-10-08 18:53:15 -04:00