Allow tunnel nodes to enable the ssh listener#53473
Conversation
8add08a to
7fa96e7
Compare
7fa96e7 to
6d23b17
Compare
|
Amplify deployment status
|
6d23b17 to
224b603
Compare
| if !useLocalListener { | ||
| // Start the SSH server. This kicks off updating labels and starting the | ||
| // heartbeat. | ||
| if err := s.Start(); err != nil { |
There was a problem hiding this comment.
nit: this conditional start reads a bit funny when scanning this logic. Might be worth an explanatory comment. Ex:
// if local listener setup wasn't run, the server still needs to be startedThere was a problem hiding this comment.
I'd consider making it even more explicit in the code and setting a flag for serverStarted to true right before the go s.Serve(listener) and checking for conn.UseTunnel() && !serverStarted here.
There was a problem hiding this comment.
I moved this back into the else clause to reduce confusion.
| if conn.UseTunnel() { | ||
| if !useLocalListener { |
There was a problem hiding this comment.
| if conn.UseTunnel() { | |
| if !useLocalListener { | |
| if conn.UseTunnel() && !useLocalListener { |
| func testForceListenerInTunnelMode(t *testing.T, suite *integrationTestSuite) { | ||
| // InsecureDevMode needed for IoT node handshake | ||
| lib.SetInsecureDevMode(true) | ||
| defer lib.SetInsecureDevMode(false) |
There was a problem hiding this comment.
I'm always scared of global state manipulation in tests.
| func testForceListenerInTunnelMode(t *testing.T, suite *integrationTestSuite) { | |
| // InsecureDevMode needed for IoT node handshake | |
| lib.SetInsecureDevMode(true) | |
| defer lib.SetInsecureDevMode(false) | |
| func testForceListenerInTunnelMode(t *testing.T, suite *integrationTestSuite) { | |
| // InsecureDevMode needed for IoT node handshake | |
| defer lib.SetInsecureDevMode(lib.IsInsecureDevMode()) | |
| lib.SetInsecureDevMode(true) | |
| // fail the test if it's accidentally made parallel | |
| t.SetEnv("_testForceListenerInTunnelMode_SetInsecureDevMode", "1") |
| if !useLocalListener { | ||
| // Start the SSH server. This kicks off updating labels and starting the | ||
| // heartbeat. | ||
| if err := s.Start(); err != nil { |
There was a problem hiding this comment.
I'd consider making it even more explicit in the code and setting a flag for serverStarted to true right before the go s.Serve(listener) and checking for conn.UseTunnel() && !serverStarted here.
224b603 to
540d53f
Compare
540d53f to
9fb28d3
Compare
This allows the service to be connectable by users with direct network access. All connections still require a valid user certificate to be presented and will not permit any extra access. This is intended to provide an optional connection path to hosts that may provide reduced latency if the Proxy is not co-located with the user and service.
9fb28d3 to
e6bf732
Compare
|
@rosstimothy See the table below for backport results.
|
This allows the service to be connectable by users with direct network access. All connections still require a valid user
certificate to be presented and will not permit any extra access. This is intended to provide an optional connection path to hosts that may provide reduced latency if the Proxy is not co-located with the user and service.
Changelog: Allow the
ssh_service.listen_addrto forcibly be enabled when operating in reverse tunnel mode to provide an optional direct access path to hosts.