You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note that this project is itself using ssh-agent-inject with VS Code (see `.devcontainer/`).
31
31
32
+
## How it works
33
+
34
+
This project consists of two applications that communicate through stdio: `ssh-agent-inject` and `ssh-agent-pipe` which is embedded within the `ssh-agent-inject` binary (that's why you don't see it in the release archive).
35
+
36
+
The `ssh-agent-inject` command runs on the host and
37
+
38
+
* watches Docker for containers having the `com.ensody.ssh-agent-inject` label
39
+
* copies the embedded `ssh-agent-pipe` binary into those containers
40
+
* runs `ssh-agent-pipe` within each container via `docker exec`
41
+
* connects to the host's ssh-agent (one connection per container)
42
+
* forwards the host's ssh-agent to `ssh-agent-pipe` via stdio
43
+
44
+
The `ssh-agent-pipe` command runs in the container and
45
+
46
+
* listens on a UNIX socket at `$SSH_AUTH_SOCK`
47
+
* handles parallel connections on that UNIX socket
48
+
* serializes all socket<->stdio communication (handles one request-response pair at a time)
49
+
50
+
The apps communicate via stdio because this keeps the attack surface small and makes it easier to ensure that nobody else can connect to your ssh-agent (assuming you can trust the Docker container, of course).
51
+
32
52
## Building
33
53
34
54
All required dependencies are contained in a Docker image defined in `.devcontainer/`, which can be automatically used with Visual Studio Code (or manually via Docker build & run).
0 commit comments