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

[24.11] nixos/ssh: disable authorizedKeysInHomedir by default #309025

Open
wants to merge 1 commit into
base: staging
Choose a base branch
from

Conversation

nbraud
Copy link
Contributor

@nbraud nbraud commented May 4, 2024

Split-off from #279894 to avoid a breaking change late in 24.05's release cycle.

Do not merge before staging stops being included in the release (not before 2024-05-15 AoE)

Description of changes

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • 24.11 Release Notes
    • (Module updates) Added a release notes entry if the change is significant
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@pbsds
Copy link
Contributor

pbsds commented May 6, 2024

i assume including #309368 is a mistake, but the sshd and release note diff LGTM!

@nbraud
Copy link
Contributor Author

nbraud commented May 12, 2024

i assume including #309368 is a mistake

Oops, it was indeed unintended!

I'm not even sure how I manageds that one, probably branched out after testing that PR, and forgot to specify I was branching from master.
PS: Figured it out, I simply forgot I needed to branch off staging instead 😅

@nbraud nbraud force-pushed the nixos/ssh/no_authorizedKeys_in_homedir branch from e92eed3 to f152a17 Compare May 12, 2024 13:24
@nbraud nbraud force-pushed the nixos/ssh/no_authorizedKeys_in_homedir branch from f152a17 to f94b85b Compare May 12, 2024 13:27
@mkg20001 mkg20001 marked this pull request as ready for review May 12, 2024 13:30
@nbraud
Copy link
Contributor Author

nbraud commented May 12, 2024

@mkg20001 I don't think this is mergeable yet, staging won't diverge from the current release until the 15th
PS: The change documentation would also need to be moved into 24.11's release notes

@nbraud nbraud marked this pull request as draft May 12, 2024 17:44
@nbraud nbraud force-pushed the nixos/ssh/no_authorizedKeys_in_homedir branch from f94b85b to eaf9d6e Compare May 26, 2024 12:53
@nbraud nbraud marked this pull request as ready for review May 26, 2024 12:53
@nbraud
Copy link
Contributor Author

nbraud commented May 26, 2024

Rebased to address merge conflict, and add the release note in 24.11. This is now ready for review & merge.

PS: Accidentally introduced some extra whitespace in the release note, now fixed.

@nbraud nbraud force-pushed the nixos/ssh/no_authorizedKeys_in_homedir branch from eaf9d6e to d0a2897 Compare May 26, 2024 12:55
@nbraud
Copy link
Contributor Author

nbraud commented May 26, 2024

@ofborg test openssh

@SuperSandro2000
Copy link
Member

I do not think that we can ever change this default without causing major breakages and potentially causing tremendous damage. Even if we announce this in all places, we probably do not reach enough people that absolutely need to know this and lock them out of there machines. There is also a scenario where people might need to physically remove the root disk from there server after this change, to allow logging back in:

  • no user password is set/allowed to log in
  • boot parameter cannot be edited
  • the generation before this got already garbage collected
  • the only ssh key is in their home directory

Copy link
Member

@SuperSandro2000 SuperSandro2000 left a comment

Choose a reason for hiding this comment

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

just to block merges until further discussion has happened

@winterqt
Copy link
Member

If we wanted to go forward with this change, we could warn on the current default value for two releases (12 months), and then make the switch in 25.11.

@nbraud
Copy link
Contributor Author

nbraud commented May 29, 2024

I do not think that we can ever change this default without causing major breakages and potentially causing tremendous damage. Even if we announce this in all places, we probably do not reach enough people that absolutely need to know this and lock them out of there machines.

Since this was spun out in a separate PR, there's probably a lot of context which isn't obvious at first glance:

  • the option was introduced because the current behaviour is a root cause for security issues like pam_ssh_agent_auth allowing users to define own ssh pubkey #31611 ;
  • the SSH maintainer requested for the default to be changed when I introduced the option ;
  • I already pushed the change back to avoid breaking things in 24.05 ;
  • I already tried making the default dependent on stateVersion, which would address ~all those concerns... but it causes an evaluation error on ofborg:
    apparently, the darwin builders' configuration pull in the OpenSSH NixOS module, but their configuration is also not supposed to depend on stateVersion (and a check enforces that)
    In any case, that would be my prefered option, and is listed as a task item in the PR description

@nbraud
Copy link
Contributor Author

nbraud commented May 29, 2024

If we wanted to go forward with this change, we could warn on the current default value for two releases (12 months), and then make the switch in 25.11.

Or fix the issue preventing the default to depend on stateVersion, presumably.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants