-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Fix OpenSSH EICE nodes connections #59928
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -268,14 +268,17 @@ func (s *ServerConfig) CheckDefaults() error { | |||||||||||||||
| if s.TargetServer == nil { | ||||||||||||||||
| return trace.BadParameter("target server is required") | ||||||||||||||||
| } | ||||||||||||||||
| if s.TargetServer.IsOpenSSHNode() { | ||||||||||||||||
| switch s.TargetServer.GetSubKind() { | ||||||||||||||||
| case types.SubKindTeleportNode: | ||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we add a "" case too just to be safe? I'm not sure we enforce that the subkind must be "teleport" for regular node heartbeats.
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Lines 178 to 182 in 5e2b4a7
|
||||||||||||||||
| if s.UserAgent == nil { | ||||||||||||||||
| return trace.BadParameter("user agent required for teleport nodes (agentless)") | ||||||||||||||||
| } | ||||||||||||||||
| case types.SubKindOpenSSHNode: | ||||||||||||||||
| if s.AgentlessSigner == nil { | ||||||||||||||||
| return trace.BadParameter("agentless signer is required for OpenSSH Nodes") | ||||||||||||||||
| } | ||||||||||||||||
| } else { | ||||||||||||||||
| if s.UserAgent == nil { | ||||||||||||||||
| return trace.BadParameter("user agent required for teleport nodes") | ||||||||||||||||
| } | ||||||||||||||||
| case types.SubKindOpenSSHEICENode: | ||||||||||||||||
| // agentless signer is set once the forwarding server is started. | ||||||||||||||||
| } | ||||||||||||||||
| if s.TargetConn == nil { | ||||||||||||||||
| return trace.BadParameter("connection to target connection required") | ||||||||||||||||
|
|
||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we write a test that would have caught this bug?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a basic test for
CheckDefaults. I'm not sure about adding a more in-depth test (e.g. fully mocked EICE flow in an integration test) given that the EICE flow is deprecated.