Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't reuse the "ssh" group for our own access control #7317

Merged
merged 1 commit into from
Nov 7, 2024

Conversation

legoktm
Copy link
Member

@legoktm legoktm commented Oct 31, 2024

Status

Ready for review

Description of Changes

The "ssh" group was supposed to be an internal group that was used by openssh itself for privilege separation. It's since been renamed to "_ssh"[1] to clarify that it's internal-only and flagged that we shouldn't be using it either.

Instead, create a new "sdssh" group, add our users to it, and use it in the sshd_config.

For upgrades, we migrate users to the new group and then update sshd_config and iptables rules.

[1] https://salsa.debian.org/ssh-team/openssh/-/blob/eac38305fc5d8eb8301a106294cf6c79447bdeb3/debian/openssh-client.postinst

Fixes #7316.

Testing

How should the reviewer test this PR?

  • staging CI passes
  • install focal (either 2.10.1 or develop without this change), copy the securedrop-migrate-ssh-group script and run it on either app or mon. reboot the instance, then verify you can ssh back in and id sdadmin includes "sdssh" and not plain "ssh"

Deployment

Any special considerations for deployment? Both new installs and upgrades are considered

Checklist

@legoktm legoktm added the noble Ubuntu Noble related work label Oct 31, 2024
@legoktm legoktm requested a review from a team as a code owner October 31, 2024 17:41
@legoktm
Copy link
Member Author

legoktm commented Oct 31, 2024

(Still work in progress, I need to actually test the upgrade path)

@legoktm legoktm force-pushed the stg-ssh-migration branch 2 times, most recently from 71daebe to e9fa7b7 Compare November 1, 2024 19:33
@legoktm legoktm force-pushed the stg-ssh-migration branch 2 times, most recently from 3af5a1f to 23d9aca Compare November 4, 2024 21:59
@legoktm
Copy link
Member Author

legoktm commented Nov 4, 2024

OK, I've finished testing this and it (now) works, I learned that usermod -r isn't supported on focal so we have to use gpasswd instead. Should be ready to go!

@legoktm legoktm added this to the SecureDrop 2.11.0 milestone Nov 4, 2024
@legoktm legoktm force-pushed the stg-ssh-migration branch 2 times, most recently from abe18eb to 6cba1b5 Compare November 7, 2024 15:59
The "ssh" group was supposed to be an internal group that was used by
openssh itself for privilege separation. It's since been renamed to
"_ssh"[1] to clarify that it's internal-only and flagged that we
shouldn't be using it either.

Instead, create a new "sdssh" group, add our users to it, and use it in
the sshd_config.

For upgrades, we migrate users to the new group and then update
sshd_config and iptables rules.

[1] https://salsa.debian.org/ssh-team/openssh/-/blob/eac38305fc5d8eb8301a106294cf6c79447bdeb3/debian/openssh-client.postinst

Fixes #7316.
Copy link
Contributor

@zenmonkeykstop zenmonkeykstop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, migration script works as expected. This will require upgrade testing during its release's QA tho.

@zenmonkeykstop zenmonkeykstop added this pull request to the merge queue Nov 7, 2024
Merged via the queue into develop with commit 9fc6dbe Nov 7, 2024
45 checks passed
@zenmonkeykstop zenmonkeykstop deleted the stg-ssh-migration branch November 7, 2024 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
noble Ubuntu Noble related work
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Create our own ssh group for access control
2 participants