Conversation
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- Consider passing each SSH option as a separate list element instead of concatenating them into a single formatted string, to avoid quoting/spacing issues and make future changes less error-prone.
- Disabling StrictHostKeyChecking globally for this console type has security implications; it may be worth making this behavior configurable so environments that require host key verification can opt in or out explicitly.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider passing each SSH option as a separate list element instead of concatenating them into a single formatted string, to avoid quoting/spacing issues and make future changes less error-prone.
- Disabling StrictHostKeyChecking globally for this console type has security implications; it may be worth making this behavior configurable so environments that require host key verification can opt in or out explicitly.
## Individual Comments
### Comment 1
<location path="osism/commands/console.py" line_range="229" />
<code_context>
settings.OPERATOR_USER,
"-o",
- f"-o UserKnownHostsFile={tmp_known_hosts}",
+ f"-o StrictHostKeyChecking=no -o LogLevel=ERROR -o UserKnownHostsFile={tmp_known_hosts}",
"-g",
host,
</code_context>
<issue_to_address>
**issue (bug_risk):** Multiple ssh -o options are combined into a single argv element, which ssh will not parse as intended.
Since this is one argv element, ssh parses it as `-o` with a single value (`StrictHostKeyChecking=no -o LogLevel=ERROR -o UserKnownHostsFile=...`). Only `StrictHostKeyChecking=no` is applied; the rest are ignored as separate options. These should be passed as distinct arguments instead, e.g. `"-o", "StrictHostKeyChecking=no", "-o", "LogLevel=ERROR", "-o", f"UserKnownHostsFile={tmp_known_hosts}"` so all options take effect.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
The clush SSH options were missing StrictHostKeyChecking=no and LogLevel=ERROR, causing "Host key verification failed" errors on all clush connections. Will be improved by #2140 in the future. Signed-off-by: Christian Berendt <berendt@osism.tech>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The clush SSH options were missing StrictHostKeyChecking=no and LogLevel=ERROR, causing "Host key verification failed" errors on all clush connections.
Will be improved by #2140 in the future.