Skip to content

feat(windows): collect RSA key container handles#8908

Draft
sinmentis wants to merge 3 commits into
mainfrom
shunlyu/ab-37351719-sysinternals-handle
Draft

feat(windows): collect RSA key container handles#8908
sinmentis wants to merge 3 commits into
mainfrom
shunlyu/ab-37351719-sysinternals-handle

Conversation

@sinmentis

Copy link
Copy Markdown
Contributor

What changed

  • bundle Sysinternals Handle in supported Windows VHDs
  • add RSA key container handle output to on-demand Windows node logs
  • validate the binary and archived diagnostic output

Why

This gives support engineers the handle ownership data needed to diagnose RSA key container leaks in Windows gMSA scenarios without downloading tools during an incident.

Compatibility

The collector skips Handle when it runs on an older VHD that doesn't include the binary, so newer CSE scripts remain compatible with supported older images.

Validation

  • go test ./...
  • cd e2e && go test . -run '^$' && go vet .
  • PowerShell parser validation for all changed .ps1 files
  • Windows VHD content test updated for Handle\handle64.exe
  • Windows E2E log archive validation updated for Handle output

AB#37351719

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: b7e09cea-7439-4207-b1d5-fe87321cc149
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: b7e09cea-7439-4207-b1d5-fe87321cc149
Copilot AI review requested due to automatic review settings July 13, 2026 03:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR enhances Windows diagnostics in AgentBaker by baking Sysinternals Handle into Windows VHDs and capturing RSA key container handle ownership in the on-demand Windows log bundle, enabling faster investigation of gMSA-related RSA key container leaks without incident-time downloads.

Changes:

  • Download and cache Sysinternals Handle in Windows VHD build tooling.
  • Extend collect-windows-logs.ps1 to run handle64.exe for rsa-key-container and add the output to the log archive.
  • Update Windows VHD content tests and Windows E2E log archive validation to include/verify the new artifact.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
vhdbuilder/packer/windows/configure-windows-vhd.ps1 Adds Sysinternals Handle download/extract into c:\aks-tools\Handle during VHD build.
vhdbuilder/packer/test/windows-vhd-content-test.ps1 Validates Handle\handle64.exe exists on the built VHD.
staging/cse/windows/debug/collect-windows-logs.ps1 Collects RSA key container handle output (when Handle is present) into the log bundle.
e2e/validators.go Expands and validates the log archive contains the new Handle output file.

Comment thread e2e/validators.go Outdated
Comment thread staging/cse/windows/debug/collect-windows-logs.ps1 Outdated
Keep validation compatible with older VHDs and exclude empty Handle output from log archives.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: b7e09cea-7439-4207-b1d5-fe87321cc149
Copilot AI review requested due to automatic review settings July 13, 2026 04:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.

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