Skip to content

Refactor bosh dir protection#179

Merged
selzoc merged 4 commits into
windows-2019from
refactor-bosh-dir-protection
May 11, 2026
Merged

Refactor bosh dir protection#179
selzoc merged 4 commits into
windows-2019from
refactor-bosh-dir-protection

Conversation

@selzoc
Copy link
Copy Markdown
Member

@selzoc selzoc commented May 11, 2026

No description provided.

selzoc and others added 4 commits May 11, 2026 16:37
This reverts commit 777a8f8.

ai-assisted=yes
[TNZ-94650]
Co-authored-by: Brian Upton <brian.upton@broadcom.com>
This reverts commit b96c788.

ai-assisted=yes
[TNZ-94650]
Co-authored-by: Chris Selzo <chris.selzo@broadcom.com>
Co-authored-by: Brian Upton <brian.upton@broadcom.com>
This reverts commit c1c2384.

ai-assisted=yes
[TNZ-94650]
Co-authored-by: Chris Selzo <chris.selzo@broadcom.com>
Co-authored-by: Brian Upton <brian.upton@broadcom.com>
In the previous few PRs, we tightened the ACLs for all of the
directories that Protect-Dir ran against.  This lead to unsuccessful
stemcells where the bosh agent could not start.

Instead, we revert all of that, and take a more targeted approach where
the c:\bosh and c:\var\vcap\bosh\bin directories are the ONLY place we
tighten the ACLs.

An important insight was separating the inheritance icacls call from the
granting icacls call.

ai-assisted=yes
[TNZ-94650]

Co-authored-by: Brian Upton <brian.upton@broadcom.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 11, 2026

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

Walkthrough

This pull request refactors Windows directory ACL protection into two distinct strategies. A new Protect-BoshDir function applies explicit filesystem permissions recursively to BOSH-specific directories using icacls, then disables inheritance only at the root. The existing Protect-Dir function is simplified to always apply cacls operations first, then conditionally disable inheritance. The Install-Agent sequence is updated to call Protect-BoshDir for C:\bosh and C:\var\vcap\bosh\bin, while Protect-Dir handles C:\var and C:\Windows\Panther. ACL validation in acceptance tests is split: general allowlist checking via Test-FolderAcls across multiple directories, and BOSH-specific write-access denial enforcement via a new Test-BoshDirAcls helper targeting BOSH paths only.

Suggested reviewers

  • aramprice
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive No description was provided by the author; the pull request description field is empty. Add a description explaining the rationale for the refactoring, the specific changes made, and why the new Protect-BoshDir function was introduced separately from Protect-Dir.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Refactor bosh dir protection' directly matches the main changes across the codebase, which involve reorganizing how BOSH directory protection is handled through new functions and modified ACL validation logic.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor-bosh-dir-protection

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@selzoc selzoc merged commit 77c47c3 into windows-2019 May 11, 2026
14 of 15 checks passed
@selzoc selzoc deleted the refactor-bosh-dir-protection branch May 11, 2026 23:42
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