GithubHelp home page GithubHelp logo

lzmartinico / qubes-app-split-ssh Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mtdcr/qubes-app-split-ssh

0.0 1.0 0.0 35 KB

Split SSH implementation for QubesOS

Makefile 14.12% Shell 85.88%

qubes-app-split-ssh's Introduction

Qubes Split SSH

These Qubes scripts allow to keep SSH private keys in a separate VM (a "vault"), allowing other VMs to use them only after being authorized. This is done by using Qubes' qrexec framework to connect a local unix socket in an AppVM to an SSH agent socket within the vault VM. Each connection creates a new SSH Agent, which only holds a single key as chosen by the user.

This was inspired by the Qubes Split GPG and sshecret.

Other details:

  • This was developed/tested on the debian-9 template in Qubes 4.0.1; it might work for other templates
  • You will be prompted to confirm each request, though like split GPG you won't see what was requested
  • One can have an arbitrary number of vault VMs, you just need to adjust /rw/config/ssh-vault.

About this fork

  • This fork was based on https://github.com/a51f733a0cf842ec/qubes-app-split-ssh, which in turn was based on https://github.com/henn/qubes-app-split-ssh.
  • It offers a more robust implementation of the server side, avoiding protocol errors and handling special characters.
  • On the AppVM side, it needs almost no code, as it uses systemd's socket-activation feature.
  • Each AppVM gets access to its own keyring only.
  • You will be prompted to confirm each request for a key.
  • Individual AppVMs can use it without further configuration, unless your SSH-vault doesn't use the default name ("ssh-vault"), in which case only one file needs to get adjusted.

Installation instructions

Copy files from this repository to various destinations (VM is the first argument). You can use qvm-copy <filename>.

  • Dom0

    • Copy qubes.SshAgent.policy to /etc/qubes-rpc/policy/qubes.SshAgent
  • TemplateVM for SSH-vault

    • Copy qubes.SshAgent to /etc/qubes-rpc/qubes.SshAgent.
    • Make qubes.SshAgent executable. For example, running sudo chmod +x /etc/qubes-rpc/qubes.SshAgent in the TemplateVM
    • Shutdown your TemplateVM.
  • TemplateVM for AppVM:

    • Copy qubes-ssh-agent.sh to /etc/profile.d/.
    • Copy [email protected] and qubes-ssh-agent.socket to /etc/systemd/user/. Run sudo systemctl --global enable qubes-ssh-agent.socket
    • Shutdown your TemplateVM.
  • SSH-vault:

    • Create a directory ~/.qubes_ssh/$AppVM for each AppVM allowed to access your SSH-vault.
    • Populate these directories with private and public SSH key files.
    • You can have multiple private and public key pairs in each directory and will be prompted for the key to use. This may be useful for transitioning between keys.
    • Optionally save the number of seconds after which use of a key needs to be reconfirmed in a file called ~/.qubes_ssh/$AppVM/.cache, where -1 has the special meaning of always skipping the confirmation dialog. This only has an effect if there is exactly one key file or directory in ~/.qubes_ssh/$AppVM. Consider creating special purpose AppVMs for tasks using this feature.
  • AppVM (optional):

    • Put the name of your SSH-vault into /rw/config/ssh-vault.
    • Restart your AppVM.

Troubleshooting

If something isn't working, you can check the service logs by running sudo journalctl -t qubes.SshAgent.

qubes-app-split-ssh's People

Contributors

a51f733a0cf842ec avatar henn avatar mtdcr avatar mig5 avatar strugee avatar imjustmatthew avatar lzmartinico avatar rdubourguais avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.