Skip to content

Record safe authentication configuration after credential failures - #2157

Merged
Tyrie Vella (tyrielv) merged 5 commits into
microsoft:masterfrom
tyrielv:tyrielv/auth-config-telemetry
Nov 9, 2026
Merged

Tyrie Vella (tyrielv) merged 5 commits into
microsoft:masterfrom
tyrielv:tyrielv/auth-config-telemetry

Conversation

@tyrielv

@tyrielv Tyrie Vella (tyrielv) commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Problem and Context

Failed credential attempts do not record the helper configuration that Git reads. This makes missing, reset, or obsolete helpers difficult to distinguish.

Authentication configuration can depend on the repository URL, configuration scope, and inherited environment. Helper values can also contain secrets or shell commands.

Changes

  • Add an AuthenticationConfiguration event after failed repository credential attempts, including successful commands that return no password.
  • Record the ordered helper chain, empty resets, configuration scopes, and explicit absence, query-error, and omission states.
  • Use the same Git executable, repository context, command override, and captured environment as the failed credential attempt.
  • Centralize Git-backed configuration-read retries in GitProcessConfigReader. Use bounded raw output for authentication diagnostics.
  • Use Git's URL matcher without its scalar helper selection. Preserve matching entries in configuration order.
  • Replace URL userinfo with fixed identifiers for native matching. Disable inherited and configuration-driven diagnostic traces.
  • Record allowlisted OAuth/PAT, broker, and interaction preferences. Keep Git interaction policy separate from GCM interaction policy.
  • Omit shell commands and helper arguments. Replace executable paths with fixed descriptions that omit user-specific path components.
  • Bound diagnostic queries and retry delays with one two-second deadline, output limits, an entry limit, and a five-minute interval per GitProcess instance.
  • Retry transient file-access failures with a fresh process and the captured environment. Report retry exhaustion without raw configuration or error text.
  • Add unit tests for real Git URL matching, configuration scopes, helper chains, resets, environment overrides, secret omission, query failures, and timeout cleanup.
  • Add unit tests for serialized helper descriptions, production environment capture, token-bearing usernames, unsupported URL forms, and process-tree kill failures.
  • Add unit tests for transient snapshot, system, and URL-match failures, retry exhaustion, truncated results, and timeout cleanup after a retry.

The snapshot describes configuration after the failure. It does not prove which helper ran or whether GCM used a broker.
GCM registry defaults are outside the snapshot.

Known gaps and deliberate decisions

  • Certificate credentials — The snapshot covers repository credentials. Certificate fills use protocol=cert and a local path, not repository URL semantics. No certificate-specific collector is planned here.
  • Diagnostic process ownership — The shared raw reader preserves NUL-delimited output and drains both pipes. Its processes remain outside GitProcess shutdown tracking. No lifecycle refactor is planned here.
  • Sensitive URL forms — The matcher omits userinfo from argv and checks usernames separately. URLs with query strings, fragments, or malformed authorities emit an explicit unsupported state instead of URL-dependent details.
  • Malformed full URL scopes — If a full configuration URL cannot normalize, the snapshot reports an unsupported state. Partial scopes without a scheme or host remain supported. No broader parser is planned here.

Capture ordered helper configuration, URL scope, and allowlisted
authentication preferences after failed repository credential attempts.
Omit arbitrary helper commands, arguments, URLs, and secret values from
metadata. Serialize fixed helper descriptions and preserve reset order.
Keep the captured environment on its invocation result. Replace URL
userinfo with fixed identifiers for native matching. Disable diagnostic
traces and report unsupported URL forms explicitly.
Bound diagnostic queries and throttle repeated snapshots.

Add real-Git configuration tests, final-sink serialization tests, and
failure-path tests for the snapshot.

Assisted-by: GPT-6.1 Sol
Co-authored-by: Copilot <[email protected]>
Signed-off-by: Tyrie Vella <[email protected]>
@tyrielv
Tyrie Vella (tyrielv) force-pushed the tyrielv/auth-config-telemetry branch from d47ff63 to f9a81d6 Compare November 9, 2026 18:42
Tyrie Vella (tyrielv) and others added 3 commits November 9, 2026 11:11
Share the Git config reader and transient retry policy with authentication diagnostics. Keep raw output, privacy controls, and all attempts within the existing deadline.

Assisted-by: GPT-6.1 Sol
Co-authored-by: Copilot <[email protected]>
Signed-off-by: Tyrie Vella <[email protected]>
Add clangarm64/bin to the safe Git installation layouts. Add unit tests for Windows paths and quoted paths with spaces and mixed-case layout names.

Assisted-by: GPT-6.1 Sol
Co-authored-by: Copilot <[email protected]>
Signed-off-by: Tyrie Vella <[email protected]>
Rename GitConfigReader to GitProcessConfigReader to identify its GitProcess scope. Update production and test references without behavior changes.

Assisted-by: GPT-6.1 Sol
Co-authored-by: Copilot <[email protected]>
Signed-off-by: Tyrie Vella <[email protected]>
@tyrielv
Tyrie Vella (tyrielv) marked this pull request as ready for review November 9, 2026 19:41
@KeithIsSleeping

Copy link
Copy Markdown

[KeithBot]: ⚠️ 1 issue · iteration 1 (27a5039)

  1. 🟡 Medium Auth config snapshot always fails during gvfs clone: src doesn't exist yet

Validation

  • ❌ gvfs clone E2E vs loopback 401 server
  • ⚠️ Helper chain vs real git 2.56 oracle — partial
  • ✅ GVFS.UnitTests full suite, head + base
  • ✅ PR + auth fixtures 224/224 at head
  • ✅ CI run 42685117236 on head SHA

🤖 KeithBot · claude-opus-5.5, gpt-6.1-sol, gemini-4-argon · reply on a thread to dispute

…lone

Use the credential-fill working directory for authentication diagnostics before clone creates src. Add a regression that checks serialized telemetry with an absent working directory.

Assisted-by: GPT-6.1 Sol
Co-authored-by: Copilot <[email protected]>
Signed-off-by: Tyrie Vella <[email protected]>
@KeithIsSleeping

Copy link
Copy Markdown

[KeithBot]: ✅ Resolved · iteration 2 (42bea89)

  • Auth config snapshot always fails during gvfs clone: src doesn't exist yet: fixed
  • New changes since iteration 1: no new issues

Validation

  • ✅ Original 401 gvfs clone repro at head
  • ✅ New pre-clone test + production-env test
  • ✅ Positive control on iteration-1 code
  • ✅ Full GVFS.UnitTests at head and base
  • ✅ Real-git contexts with System32 cwd
  • ✅ CI run 42699827844 on head SHA

Approving.

🤖 KeithBot · claude-opus-5.5, gpt-6.1-sol, gemini-4-argon · reply on a thread to dispute

@tyrielv
Tyrie Vella (tyrielv) merged commit f24560f into microsoft:master Nov 9, 2026
35 checks passed
This was referenced Nov 9, 2026
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.

2 participants