Support configured credential providers across shell snapshots (#44072)

## Why

Credential brokerage must retain trusted destination hints even when shell environment policy hides them from child processes. Snapshot replay also needs to preserve credential aliases when tokens are short or captured dummy values change.

## What changed

- Add `features.network_proxy.credentials` and preserve provider settings when toggling the proxy. Prevent project configuration from overriding providers or their credential and destination environment variables.
- Use provider metadata throughout snapshot capture and replay, and pass hidden destination context to the broker without exposing it in the child environment.
- Rewrite aliases containing short credentials or previously captured dummies, respecting environment filters and explicit overrides.
- Preserve case-distinct `shell_environment_policy.set` keys so Windows credential ambiguity checks survive configuration merging and permission profile changes.
- Restore independent MITM settings when credential brokerage is disabled.

## Testing

Add regression coverage for custom providers, hidden destination hints, Bash and Zsh alias replay, configuration edits and merging, Windows ambiguity handling, and credential protection during approved execution.

GitOrigin-RevId: b2bd935d2d8555be56baf8feb1a8e5b3a0c666bc
This commit is contained in:
Winston Howes authored and copyberry committed 2026-09-09 06:04:59 +00:00
1 parent 129fd21687
commit 38cbebaf3f
24 files changed
+1482 -415

No files matched your search

+62
View File
@@ -1193,6 +1193,62 @@
},
"type": "object"
},
"CredentialAuthMethod": {
"description": "Authentication formats supported by declarative credential providers.",
"enum": [
"bearer",
"token",
"basic",
"header"
],
"type": "string"
},
"CredentialProviderConfig": {
"additionalProperties": false,
"description": "Declarative description of an environment-backed credential family.",
"properties": {
"auth": {
"default": [],
"items": {
"$ref": "#/definitions/CredentialAuthMethod"
},
"type": "array"
},
"env": {
"default": [],
"items": {
"type": "string"
},
"type": "array"
},
"header": {
"type": "string"
},
"patterns": {
"default": [],
"items": {
"type": "string"
},
"type": "array"
},
"prefix": {
"type": "string"
},
"url_prefix_from_env": {
"description": "Environment variable containing an additional URL prefix or hostname.",
"type": "string"
},
"url_prefixes": {
"default": [],
"description": "URL prefixes authorized for injection. Bare loopback hosts imply HTTP; other bare hosts imply HTTPS.",
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"CurrentTimeReminderConfigToml": {
"additionalProperties": false,
"properties": {
@@ -2589,6 +2645,12 @@
"credential_broker": {
"type": "boolean"
},
"credentials": {
"additionalProperties": {
"$ref": "#/definitions/CredentialProviderConfig"
},
"type": "object"
},
"dangerously_allow_all_unix_sockets": {
"type": "boolean"
},