Skip to content

Address review follow-up on WSLContainerRegistryAllowlist policy - #41306

Merged
beena352 merged 2 commits into
microsoft:masterfrom
beena352:users/beenachauhan/wslc-allowlist-review-followup
Aug 11, 2026
Merged

Address review follow-up on WSLContainerRegistryAllowlist policy#41306
beena352 merged 2 commits into
microsoft:masterfrom
beena352:users/beenachauhan/wslc-allowlist-review-followup

Conversation

@beena352

Copy link
Copy Markdown
Contributor

Summary of the Pull Request

Follow-up to #41211 addressing review nits: open the allowlist sub-key directly, throw an "invalid policy" error at the read site, and tighten build-block test assertions to full-message pattern match.

PR Checklist

  • Closes: Follow-up to Add registry allowlist support to image builds #41211
  • Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
  • Tests: Added/updated if needed and all pass
  • Localization: All end user facing strings can be localized
  • Dev docs: Added/updated if needed
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

  • ReadRegistryAllowlistSnapshotFromPoliciesRoot now opens the WSLContainerRegistryAllowlist sub-key directly in a single RegOpenKeyExW, then passes it to ReadRegistryAllowlistSnapshot(HKEY subKey)
  • Invalid-policy failure is thrown at the read site with MessageRegistryAllowlistPolicyInvalid instead of translated later in BuildImage
  • PolicyTests.cpp build-block assertions replaced with VerifyPatternMatch on the exact BuildKit denial line

Validation Steps Performed

Copilot AI lite review requested due to automatic review settings August 10, 2026 19:54

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 is a follow-up to the earlier registry allowlist enforcement work, refining how the WSLContainerRegistryAllowlist policy is read and improving the corresponding PolicyTests assertions for BuildKit denial output.

Changes:

  • Refactors allowlist snapshot reading to open the allowlist sub-key directly from the policies root.
  • Updates policy tests to assert BuildKit denial output via wildcard pattern matching (explicit vs implicit alpine reference).
  • Simplifies snapshot logic testing to exercise the “from policies root” path.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
test/windows/PolicyTests.cpp Tightens build-block test assertions to match the full BuildKit denial line using VerifyPatternMatch, and consolidates allowlist snapshot tests around the “from policies root” helper.
src/windows/inc/wslpolicies.h Refactors allowlist snapshot reading to take the allowlist sub-key directly and opens that sub-key in one RegOpenKeyExW call from HKLM.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/windows/inc/wslpolicies.h
Copilot AI review requested due to automatic review settings August 10, 2026 20:12

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 2 out of 2 changed files in this pull request and generated no new comments.

@beena352
beena352 marked this pull request as ready for review August 10, 2026 20:16
@beena352
beena352 requested a review from a team as a code owner August 10, 2026 20:16
@beena352
beena352 merged commit e343c5e into microsoft:master Aug 11, 2026
9 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