Add Git credential helper support for proxied HTTPS remotes#175
Add Git credential helper support for proxied HTTPS remotes#175freemanconsulting wants to merge 2 commits into
Conversation
️✅ There are no secrets present in this pull request anymore.If these secrets were true positive and are still valid, we highly recommend you to revoke them. 🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request. |
da9c8c4 to
8950f7e
Compare
|
Latest smoke/update on
AGENT_VAULT_ADDR=http://127.0.0.1:14321 ./agent-vault run --vault default --git -- \
/opt/homebrew/bin/git ls-remote --heads https://github.com/Infisical/agent-vault.git
This means the helper/config path works and the proxy injection path is being exercised. Remaining blocker for marking ready is a valid scoped Azure DevOps credential pairing for a live 200 Git read, then a scratch-branch write smoke. Automated verification:
|
8950f7e to
4de349a
Compare
|
Azure DevOps read smoke is now verified with a short-lived Code Read credential stored in Agent Vault. Command shape: AGENT_VAULT_ADDR=http://127.0.0.1:14321 ./agent-vault run --vault default --git -- \
/opt/homebrew/bin/git ls-remote --heads \
https://dev.azure.com/dtetrac/eTracIntegrations/_git/etrac-as2-routerResult: Request log verification: {"method":"GET","host":"dev.azure.com:443","path":"/dtetrac/eTracIntegrations/_git/etrac-as2-router/info/refs","matched_service":"azure-devops-basic","credential_keys":["AZURE_DEVOPS_USER","AZURE_DEVOPS_PASSWORD"],"status":200,"error_code":""}Security notes from the smoke:
Remaining blocker before ready-for-review: write smoke with a short-lived Code Read/Write credential against a scratch branch, then delete the scratch branch. |
|
Azure DevOps write smoke is now verified with a short-lived Code Read/Write credential stored in Agent Vault. Test shape:
Scratch branch: Push result: Delete result: Request log verification includes successful Git write traffic and only credential key names: {"method":"POST","host":"dev.azure.com:443","path":"/dtetrac/eTracIntegrations/_git/etrac-as2-router/git-receive-pack","matched_service":"azure-devops-basic","credential_keys":["AZURE_DEVOPS_USER","AZURE_DEVOPS_PASSWORD"],"status":200,"error_code":""}Cleanup completed:
With this, the required real Git operations are verified:
|
4de349a to
f0058be
Compare
Summary
Adds first-class Git-over-HTTPS credential brokering for Agent Vault-wrapped processes.
Git asks credential helpers for username/password before it sends HTTPS traffic, which breaks non-interactive agent runtimes when system helpers such as macOS Keychain require UI access. This PR adds a Git credential helper plus
agent-vault run --gitso Git can proceed with sentinel credentials while Agent Vault remains the authority for the real upstream credential and injects it through the existing MITM proxy path.User flow:
Technical overview:
agent-vault git-credential <get|store|erase>, implementing Git's credential helper protocol.getreturns only non-secret sentinel credentials for supported HTTPS hosts.storeanderaseare safe no-ops.agent-vault run --git, which injects process-local Git config throughGIT_CONFIG_*env vars:credential.helperentries firstcredential.helper=!<agent-vault> git-credentialcredential.useHttpPath=truehttp.sslCAInfo=<Agent Vault MITM CA>http.proxySSLCAInfo=<Agent Vault MITM CA>GIT_TERMINAL_PROMPT=0Type of change
Test plan
make test)Automated/local verification:
make testpassedgo test ./...passedgo vet ./...passedcd web && npm run buildpassedcd web && npm test || truechecked; no npmtestscript existsmake lintattempted; local environment does not havegolangci-lintinstalledgit diff --check origin/main...HEADpassedManual smoke coverage:
git ls-remotethroughagent-vault run --git: PASSgit ls-remotewith short-lived Code Read credential stored in Agent Vault: PASSagent-vault run --git: PASSagent-vault run --git: PASSSmoke transcripts are attached in PR comments:
Security checklist
Security notes:
--gituses process-local Git config only; it does not mutate global Git config.