11# SSH MITM Driver
22
3- ` jumpstarter-driver-ssh-mitm ` provides secure SSH proxy functionality where private keys
4- are stored on the exporter and never transmitted to clients.
3+ ` jumpstarter-driver-ssh-mitm ` provides a secure SSH proxy layer where private keys
4+ are stored on the exporter and never transmitted to clients. It is designed to be
5+ used as a child of ` SSHWrapper ` .
56
67## Installation
78
@@ -10,52 +11,72 @@ are stored on the exporter and never transmitted to clients.
1011$ pip3 install --extra-index-url {{index_url}} jumpstarter-driver-ssh-mitm
1112```
1213
14+ ## Architecture
15+
16+ ```
17+ SSHWrapper --> SSHMITM --> TcpNetwork --> DUT
18+ ```
19+
20+ - ** SSHWrapper** : Handles SSH CLI and command execution
21+ - ** SSHMITM** : Provides authenticated proxy connection (stores the SSH key)
22+ - ** TcpNetwork** : Raw TCP connection to the DUT
23+
1324## Configuration
1425
15- Example configuration with inline key:
26+ The command name is determined by the key in the ` export ` section. Use ` ssh_mitm ` to get the ` j ssh_mitm ` command :
1627
1728``` yaml
1829export :
19- ssh_mitm :
20- type : jumpstarter_driver_ssh_mitm .driver.SSHMITM
30+ ssh_mitm : # ← This gives you "j ssh_mitm" command
31+ type : jumpstarter_driver_ssh .driver.SSHWrapper
2132 config :
22- default_username : " root"
23- ssh_identity : |
24- -----BEGIN OPENSSH PRIVATE KEY-----
25- ...
26- -----END OPENSSH PRIVATE KEY-----
33+ default_username : root
2734 children :
2835 tcp :
29- type : jumpstarter_driver_network .driver.TcpNetwork
36+ type : jumpstarter_driver_ssh_mitm .driver.SSHMITM
3037 config :
31- host : " 192.168.1.100"
32- port : 22
38+ ssh_identity_file : /path/to/private/key
39+ default_username : root
40+ children :
41+ tcp :
42+ type : jumpstarter_driver_network.driver.TcpNetwork
43+ config :
44+ host : 192.168.1.100
45+ port : 22
3346` ` `
3447
35- Example configuration with key file :
48+ Or with inline key :
3649
3750` ` ` yaml
3851export :
39- ssh_mitm :
40- type : jumpstarter_driver_ssh_mitm .driver.SSHMITM
52+ ssh_mitm : # ← This gives you "j ssh_mitm" command
53+ type : jumpstarter_driver_ssh .driver.SSHWrapper
4154 config :
42- default_username : " root"
43- ssh_identity_file : " /path/to/private/key"
55+ default_username : root
4456 children :
4557 tcp :
46- type : jumpstarter_driver_network .driver.TcpNetwork
58+ type : jumpstarter_driver_ssh_mitm .driver.SSHMITM
4759 config :
48- host : " 192.168.1.100"
49- port : 22
60+ default_username : root
61+ ssh_identity : |
62+ -----BEGIN OPENSSH PRIVATE KEY-----
63+ ...
64+ -----END OPENSSH PRIVATE KEY-----
65+ children :
66+ tcp :
67+ type : jumpstarter_driver_network.driver.TcpNetwork
68+ config :
69+ host : 192.168.1.100
70+ port : 22
5071` ` `
5172
52- ### Config parameters
73+ ### SSHMITM Config parameters
5374
54- | Parameter | Description | Type | Required | Default |
55- | ----------------- | -------------------------------------------------------- | ---- | -------- | ------- |
56- | default_username | Default SSH username | str | no | "" |
57- | ssh_identity | SSH private key content (inline) | str | no* | None |
58- | ssh_identity_file | Path to SSH private key file | str | no* | None |
75+ | Parameter | Description | Type | Required | Default |
76+ | ----------------- | ---------------------------------------- | - ---- | -------- | ------- |
77+ | default_username | SSH username for DUT connection | str | no | "" |
78+ | ssh_identity | SSH private key content (inline) | str | no* | None |
79+ | ssh_identity_file | Path to SSH private key file | str | no* | None |
5980
6081\* Either ` ssh_identity` or `ssh_identity_file` must be provided.
6182
@@ -65,28 +86,26 @@ export:
6586
6687# # Usage
6788
89+ Since SSHMITM is used as a child of SSHWrapper, you use the configured command name (e.g., `ssh_mitm`) :
90+
6891` ` ` bash
6992# Execute a command
7093j ssh_mitm whoami
7194
72- # Interactive shell (native SSH via port forwarding)
73- j ssh_mitm shell
95+ # Interactive shell
96+ j ssh_mitm
7497
75- # Interactive shell (gRPC REPL, no local SSH required)
76- j ssh_mitm shell --repl
98+ # With arguments
99+ j ssh_mitm ls -la /tmp
77100
78- # Port forward for ssh/scp/rsync
79- j ssh_mitm forward -p 2222
80- # Then: ssh -p 2222 localhost
101+ # With SSH flags
102+ j ssh_mitm -v hostname
81103` ` `
82104
105+ **Note**: The command name (`ssh_mitm`) is determined by the key in your exporter config's `export` section. You can use any name you prefer.
106+
83107# # API Reference
84108
85109` ` ` {eval-rst}
86110.. autoclass:: jumpstarter_driver_ssh_mitm.driver.SSHMITM()
87111` ` `
88-
89- ` ` ` {eval-rst}
90- .. autoclass:: jumpstarter_driver_ssh_mitm.client.SSHMITMClient()
91- :members: execute, run
92- ` ` `
0 commit comments