The VM needs a secure way to pull private Git repositories #9

Open
opened 2026-10-19 19:10:31 +01:00 by SethFalco · 0 comments
Owner

At least in my current configuration, the VM is not able to git pull because it doesn't have my SSH key.

I could put my SSH key in the VM, but that would be incredibly irresponsible. GitHub does allow creating additional SSH keys, but these aren't scoped anyway, so it would still grant read/write access to all repos I can access, not just the ones for that client.

  • I could create a bot user on GitHub and ask the client to invite it to the org, but I don't want to pester the client's managers.
  • Fine grained token? The VM would have to pull with HTTPS instead of SSH, plus it still requires pestering the client's managers.
  • Not a viable option, but maybe one day GitHub will release scoped SSH keys. Better to pursue a forge agnostic solution anyway.

I've got two ideas on how to do this:

  1. Agent Devenv would, alongside the VM, also host a git mirror. The user will define SSH URLs for which repos they want mirrored to it, and generate an SSH key that gets mounted to the VM, so the agent can freely use the mirror without having upstream access.
  2. Create a mechanism which the VM can invoke predefined procedures on the host. No args, no shell, no interpolation, etc. It's just a key the VM can send down, and if that key is known to the host then it can execute the predefined script.

I much prefer option 1 for this use case, so we're going to try that.

I could see a need for option 2 to come around later, so it could be done one day, but for now it's just a fallback method for implementing this.

At least in my current configuration, the VM is not able to `git pull` because it doesn't have my SSH key. I could put my SSH key in the VM, but that would be incredibly irresponsible. GitHub does allow creating additional SSH keys, but these aren't scoped anyway, so it would still grant read/write access to _all_ repos I can access, not just the ones for that client. - I could create a bot user on GitHub and ask the client to invite it to the org, but I don't want to pester the client's managers. - Fine grained token? The VM would have to pull with HTTPS instead of SSH, plus it still requires pestering the client's managers. - Not a viable option, but [maybe one day GitHub will release scoped SSH keys](https://github.com/orgs/community/discussions/4699). Better to pursue a forge agnostic solution anyway. I've got two ideas on how to do this: 1. Agent Devenv would, alongside the VM, also host a git mirror. The user will define SSH URLs for which repos they want mirrored to it, and generate an SSH key that gets mounted to the VM, so the agent can freely use the mirror without having upstream access. 2. Create a mechanism which the VM can invoke predefined procedures on the host. No args, no shell, no interpolation, etc. It's just a key the VM can send down, and if that key is known to the host then it can execute the predefined script. I much prefer option 1 for this use case, so we're going to try that. I could see a need for option 2 to come around later, so it could be done one day, but for now it's just a fallback method for implementing this.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ai/agent-devenv#9
No description provided.