microsoft / microsoft/vscode-remote-release
Forward access to the host credential/secret storage, to allow credential reuse and increased security
@chrmarti is already working on this.
Since Nov 13, 2024.
- Dominant language
- Dockerfile
- Stars
- 4.2k
- Forks
- 469
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 1
Description
I would like some way to forward the host system's generic credential/secret storage into devcontainers, to make it available to command-line tools at minimum.
Currently, I've been messing with the GitHub cli for some experiments against my employer's enterprise org, which requires logging in. There's a few problems with this:
- I have to log in separately on each devcontainer (I was working on both a producer and consumer side of a package, not something that would normally be combined).
- GitHub rate limits logging in with the CLI, meaning I couldn't actually log in on the second devcontainer for multiple minutes.
- The credentials will disappear if the container is rebuilt.
Now, there are ways to work around this, to an extent....
- I could persist the credentials for a container by adding a bind or volume mount, but;
- This has to be added to each container. Volume mounts would be separated by container, so wouldn't solve shared credential concerns
- Issues with permissions (not guaranteed matching UIDs)
- Less secure than secret storage
- You generally shouldn't use bind mounts on docker desktop on Windows.
- I could create a devcontainer feature with a volume mount, but;
- More complicated than a simple devcontainer mount, but would allow credential re-use.
- Issues with permissions (not guaranteed matching UIDs)
- Some form of folder redirection or environment configuration would be required to account for different home directories.
Instead, it would be helpful if the host secret storage was proxied into the container, for use by various clis. This would be more helpful on Windows, given the extra layer otherwise required. Providing such a proxy would also mean that a separate connection may not be needed for each tool (although I'm less sure if it would be possible to get rid of the docker/git forwarding...).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.