Skip to content

fix: gateway v2 support for hashicorp vault connection#5410

Merged
varonix0 merged 2 commits intomainfrom
daniel/gateway-v2-support-vault
Feb 9, 2026
Merged

fix: gateway v2 support for hashicorp vault connection#5410
varonix0 merged 2 commits intomainfrom
daniel/gateway-v2-support-vault

Conversation

@varonix0
Copy link
Member

@varonix0 varonix0 commented Feb 9, 2026

Context

Added gateway v2 support for hashicorp vault migration / app connection.

Steps to verify the change

Type

  • Fix
  • Feature
  • Improvement
  • Breaking
  • Docs
  • Chore

Checklist

  • Title follows the conventional commit format: type(scope): short description (scope is optional, e.g., fix: prevent crash on sync or fix(api): handle null response).
  • Tested locally
  • Updated docs (if needed)
  • Read the contributing guide

@varonix0 varonix0 self-assigned this Feb 9, 2026
@maidul98
Copy link
Collaborator

maidul98 commented Feb 9, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 9, 2026

Greptile Overview

Greptile Summary

This PR threads gatewayV2Service through the HashiCorp Vault app-connection, secret-sync, and external-migration code paths so Vault requests can be proxied via the newer Gateway v2 when connection details are available, falling back to the existing gateway v1 proxy otherwise.

The main behavioral changes are in backend/src/services/app-connection/hc-vault/hc-vault-connection-fns.ts, where requestWithHCVaultGateway now checks gatewayV2Service.getPlatformConnectionDetailsByGatewayId(...) and uses withGatewayV2Proxy(...) when present. Service factories and callers (app-connection-service, external-migration-service, secret-sync-fns) are updated accordingly to pass the new dependency.

Blocking issues found:

  • Gateway v2 HTTPS requests currently disable TLS verification (rejectUnauthorized: false), which weakens transport security for Vault connections.
  • HC Vault secret sync’s disableSecretDeletion option currently prevents all updates because it returns early before writing changes back to Vault.

Confidence Score: 2/5

  • This PR should not merge until the TLS verification and secret-sync logic issues are fixed.
  • Most changes are dependency-wiring for gateway v2 support, but two concrete regressions were introduced: (1) gateway v2 Vault requests disable TLS certificate verification, enabling MITM, and (2) HC Vault secret sync’s disableSecretDeletion option now skips all writes, preventing updates/additions when users enable that option.
  • backend/src/services/app-connection/hc-vault/hc-vault-connection-fns.ts, backend/src/services/secret-sync/hc-vault/hc-vault-sync-fns.ts

Important Files Changed

Filename Overview
backend/src/server/routes/index.ts Wires gatewayV2Service into externalMigrationServiceFactory call; no functional logic changes here.
backend/src/services/app-connection/app-connection-service.ts Passes gatewayV2Service into hcVaultConnectionService factory; change is straightforward service wiring.
backend/src/services/app-connection/hc-vault/hc-vault-connection-fns.ts Adds gateway v2 proxy path for Vault requests and threads gatewayV2Service through call chain; introduces HTTPS agent with rejectUnauthorized:false (security issue).
backend/src/services/app-connection/hc-vault/hc-vault-connection-service.ts Updates hcVaultConnectionService to accept gatewayV2Service and pass it to listHCVaultMounts.
backend/src/services/external-migration/external-migration-service.ts Threads gatewayV2Service into various HC Vault migration helpers; appears consistent with updated function signatures.
backend/src/services/secret-sync/hc-vault/hc-vault-sync-fns.ts Threads gatewayV2Service through sync calls; current disableSecretDeletion behavior returns before writes, preventing updates when deletion is disabled (logic bug).
backend/src/services/secret-sync/secret-sync-fns.ts Extends sync deps to include gatewayV2Service and passes it to HC Vault sync functions; wiring change only.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

7 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 9, 2026

Additional Comments (1)

backend/src/services/secret-sync/hc-vault/hc-vault-sync-fns.ts
Deletion disable blocks updates

disableSecretDeletion currently returns early before the Vault write, so any updates/additions in secretMap never get persisted when deletion is disabled. This is a functional regression for users who set this flag to “don’t delete”, not “don’t write”. The early return likely needs to move to only skip the deletion loop (i.e., still perform the POST when tainted is true).

@varonix0 varonix0 requested review from maidul98 and victorvhs017 and removed request for maidul98 February 9, 2026 22:33
@varonix0 varonix0 merged commit dd68b1e into main Feb 9, 2026
10 of 11 checks passed
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.

3 participants