-
Notifications
You must be signed in to change notification settings - Fork 18
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
Provision owner's ssh key to their devtainers #11
Comments
No. (3) is complicated, and limiting unless there's a way to reassign which No. (1) is simplest. Note that No. (2) is probably the next easiest of these options. With a single Contrary to the original issue text, provisioning users' preexisting passphrase-protected keys may not be the most secure way to do things. It would be more secure for users to use dedicated keys generated for the specific Dockside use case. To simplify an initial implementation, such keys could then be allowed to be un-passphrase-protected, as they would not be expected to be ever transferred off the Dockside server. Assuming so, and to simplify set up for an organization, such keys could be generated by Dockside for each user. Potentially, such keys could be stored in a separate table to As an alternative to per user keys, per project keys may be required. If so such keys could be stored in a separate table and selected according to the best matching git URI domain and path prefix to the git repo specified in the profile all devtainer launch data. |
An implementation of (2) above, with potential for support for (1) above, has been committed to https://github.com/newsnowlabs/dockside/tree/devel-gitlaunch-20241007-1 with commit f9d7993. This prototype assumes dedicated non-passphrase-protected keypairs are stored in users.json. The keys for a devtainer’s owner will be added to the devtainer’s ssh-agent when the devtainer is launched or started. This facilitates accessing private git repos within the devtainer (either via terminal console or directly from the Theia IDE). It can also be used (via a new Profile option) to launch a devtainer directly from a stock docker image and any private (or public) Github repo, which will be cloned into the devtainer during its initial launch. This makes it easy to use Dockside for private repo development and for launching devtainers from any Github repo. |
Currently, users' passphrase-protected keys must be provisioned to devtainers using a shared volume mounted at
~/.ssh
, and specified within the profile. The user must typessh-add ~/.ssh/<their key>
within a terminal to add their key to the ssh agent that Dockside launches within their devtainer.Create a generalised system for managing users' ssh keys and deploying (and undeploying) them to devtainers.
This should comprise:
users.json
And some of the following:
~/.ssh
(with file ownership matchingideUser
) on devtainer launch; automatically updating the key files on all owned devtainers, if/when the key be changed.ssh-agent
when the devtainer is started (potentially needing a mechanism for obtaining the passphrase that may be used to unlock the key).ssh-agent
process not for each devtainer, but for each user; providing each devtainer that a user launches with access to the owner'sssh-agent
; adding the owner's key to theirssh-agent
when required (potentially needing a mechanism for obtaining a passphrase to be used to unlock the key).The text was updated successfully, but these errors were encountered: