forked from finos/git-proxy
-
Notifications
You must be signed in to change notification settings - Fork 2
SSH agent forwarding #65
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
Open
fabiovincenzi
wants to merge
374
commits into
G-Research:denis-coric/ssh-flow
Choose a base branch
from
fabiovincenzi:ssh-agent-on-pr987
base: denis-coric/ssh-flow
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
SSH agent forwarding #65
fabiovincenzi
wants to merge
374
commits into
G-Research:denis-coric/ssh-flow
from
fabiovincenzi:ssh-agent-on-pr987
Conversation
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
…om/jescalada/git-proxy into 1150-vitest-migration-from-service
This will be removed in a later PR once the new CLI tests are converted to Vitest
…models.ts to ui/types.ts
…tions These functions relied on the deprecated 'proxyUrl' config field. In current versions, the hostname is extracted directly from the repository URL path. No code in the codebase was using these functions.
The db.findUserBySSHKey method is properly typed in src/db/index.ts, so the (db as any) cast was unnecessary.
Remove users.js and config.js as they are superseded by the TypeScript versions (users.ts and config.ts).
Remove test SSH private keys that should not be committed. Add test/.ssh/ to .gitignore to prevent future commits. Note: These keys were previously pushed to origin in commit bc0b2f6 and should be considered compromised.
- Add '--' separator in git clone to prevent flag injection via repo names - Validate SSH host key paths to prevent command injection in ssh-keygen - Use strict equality for GitHub/GitLab hostname checks to prevent subdomain spoofing - Add .gitignore entry for test/.ssh/ directory Fixes CodeQL security alerts: - Second order command injection (2 instances) - Incomplete URL substring sanitization (2 instances) - Uncontrolled command line (1 instance)
…cript Converted pullRemote, performance, and SSH integration tests to TypeScript for better type safety and consistency with the codebase migration.
…ents This commit addresses multiple security concerns identified in the PR review: **Security Enhancements:** - Add SSH agent socket path validation to prevent command injection - Implement repository path validation with stricter rules (hostname, no traversal, .git extension) - Add host key verification using hardcoded trusted fingerprints (prevents MITM attacks) - Add chunk count limit (10,000) to prevent memory fragmentation attacks - Fix timeout cleanup in error paths to prevent memory leaks **Type Safety Improvements:** - Add SSH2ServerOptions interface for proper server configuration typing - Add SSH2ConnectionInternals interface for internal ssh2 protocol types - Replace Function type with proper signature in _handlers **Configuration Changes:** - Use fixed path for proxy host keys (.ssh/proxy_host_key) - Ensure consistent host key location across all SSH operations **Security Tests:** - Add comprehensive security test suite (test/ssh/security.test.ts) - Test repository path validation (traversal, special chars, invalid formats) - Test command injection prevention - Test pack data chunk limits All 34 SSH tests passing (27 server + 7 security tests).
06ee7b2 to
0ff683e
Compare
Co-authored-by: Juan Escalada <97265671+jescalada@users.noreply.github.com> Signed-off-by: Fabio Vincenzi <93596376+fabiovincenzi@users.noreply.github.com>
Co-authored-by: Juan Escalada <97265671+jescalada@users.noreply.github.com> Signed-off-by: Fabio Vincenzi <93596376+fabiovincenzi@users.noreply.github.com>
…/git-proxy into ssh-agent-on-pr987
…/git-proxy into ssh-agent-on-pr987
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.
No description provided.