feat: ssh key retention #53
Open
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.
This pull request introduces a comprehensive SSH key retention feature for Git Proxy, enabling secure storage and reuse of user SSH keys during the approval process. This eliminates the need for re-authentication after push approval, while maintaining robust security measures such as encryption, expiration, and cleanup. The changes span documentation updates, new components, database schema modifications, and enhancements to existing processing flows.
Documentation and Architecture Updates:
docs/SSH_KEY_RETENTION.md
: Added detailed documentation covering the problem statement, solution architecture, security features, implementation details, configuration, and future enhancements for the SSH key retention feature.Core Feature Implementation:
src/security/SSHAgent.ts
: Introduced theSSHAgent
class to securely manage SSH keys in memory, with features such as automatic expiration, secure cleanup, and signing capabilities.src/proxy/processors/push-action/captureSSHKey.ts
: Added a processor to capture and store SSH key information during push processing when approval is required.Database and Action Enhancements:
src/db/types.ts
: Extended thePush
type to include fields for encrypted SSH keys, expiration timestamps, and protocol information.src/proxy/actions/Action.ts
: Updated theAction
class to support SSH user information, including public key details and protocol-specific data.Processing Flow Updates:
src/proxy/chain.ts
: Integrated the newcaptureSSHKey
processor into the push action chain to ensure SSH key capture before processing.src/proxy/processors/pre-processor/parseAction.ts
: Enhanced the pre-processor to set protocol and SSH user information for SSH-based pushes. [1] [2]Storing user key for post-approval process