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

scponly: init at 4.8 #109452

Merged
merged 1 commit into from Jan 17, 2021
Merged

scponly: init at 4.8 #109452

merged 1 commit into from Jan 17, 2021

Conversation

wmertens
Copy link
Contributor

Motivation for this change

This allows setting the shell of a user to `${pkgs.scponly}/bin/scponly", after which they can only use scp and sftp.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@SuperSandro2000
Copy link
Member

Please change the titles to scponly: init at 4.8

pkgs/shells/scponly/default.nix Outdated Show resolved Hide resolved
pkgs/shells/scponly/default.nix Outdated Show resolved Hide resolved
pkgs/shells/scponly/default.nix Outdated Show resolved Hide resolved
pkgs/shells/scponly/default.nix Outdated Show resolved Hide resolved
@wmertens
Copy link
Contributor Author

@SuperSandro2000 done, thanks!

@SuperSandro2000
Copy link
Member

This is a semi-automatic executed nixpkgs-review which does not build all packages (e.g. lumo, tensorflow or pytorch)
If you find some bugs or got suggestions for further things to search or run please reach out to SuperSandro2000 on IRC.

Result of nixpkgs-review pr 109452 run on x86_64-linux 1

1 package built:
  • scponly

@aanderse
Copy link
Member

@wmertens aren't you supposed to add shellPath to passthru?

Also, this is pretty old software now... is it secure?

@wmertens
Copy link
Contributor Author

Ah, I didn't know about shellPath, I just used the direct path to the shell. Indeed, added now.

As for security - I could only find CVEs for previous versions and it's still used in Ubuntu, so I reasoned that it is more secure than not having anything. At worst you get shell access, which is only marginally more than just having scp access.

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
@aanderse
Copy link
Member

@wmertens awesome! I would love to use this then. What problems did you have with chroot, because that would be great to have working.

@wmertens
Copy link
Contributor Author

@aanderse I tried the following steps:

  • enabling it with the --enable-chrooted-binary config flag
  • adding a suid wrapper
  • using the suid wrapper as the shell

It didn't seem to make a difference, I was still able to see outside the home directory. Perhaps I was missing a step. I was also wondering if perhaps systemd could provide some sort of user jail but I couldn't find anything.

@aanderse
Copy link
Member

@wmertens that is too bad. Sounds like it would require some debugging to figure that out. Oh well 🤷‍♂️

Thanks!

@SuperSandro2000
Copy link
Member

Can this be merged? I can't really tell if the discussions are a merge blocker.

@SuperSandro2000
Copy link
Member

This is a semi-automatic executed nixpkgs-review which does not build all packages (e.g. lumo, tensorflow or pytorch)
If you find some bugs or got suggestions for further things to search or run please reach out to SuperSandro2000 on IRC.

Result of nixpkgs-review pr 109452 run on x86_64-linux 1

1 package built:
  • scponly

@aanderse
Copy link
Member

No problems here. Anything I'm talking about could be implemented in a future PR, if ever.

@wmertens wmertens merged commit 57c1982 into NixOS:master Jan 17, 2021
@wmertens wmertens deleted the scponly branch January 17, 2021 14:15
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

3 participants