More module refactoring#595
Conversation
Signed-off-by: Aram Price <aram.price@broadcom.com>
WalkthroughThis pull request extends kernel module hardening in BOSH Linux stemcells by blacklisting three additional kernel modules: 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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. Comment |
There was a problem hiding this comment.
Pull request overview
This PR extends the stemcell “system_kernel_modules” hardening stage to block additional kernel modules from being loadable via modprobe, and updates the corresponding OS image spec shared examples to enforce that behavior.
Changes:
- Add
esp4,esp6, andrxrpcto/etc/modprobe.d/blacklist.confasinstall <module> /bin/true. - Add Serverspec/RSpec shared-example assertions ensuring those lines are present.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| stemcell_builder/stages/system_kernel_modules/apply.sh | Adds additional module-load prevention entries for esp4, esp6, and rxrpc. |
| bosh-stemcell/spec/support/os_image_linux_kernel_modules_shared_examples.rb | Adds test expectations that the new module blacklisting is present. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@stemcell_builder/stages/system_kernel_modules/apply.sh`:
- Around line 24-26: The change blacklists kernel modules via the lines "install
esp4 /bin/true" and "install esp6 /bin/true", which will prevent ESP from
loading and break the CF IPsec Add-on; to fix, either remove or gate these two
install lines behind a conditional (e.g., a build-time flag or detection of
whether CF IPsec Add-on is present) so operators who still need ESP keep module
loading, and add a clear comment and release-note/upgrade guidance that
documents the change and its impact on the CF IPsec Add-on and ubuntu-jammy so
operators can migrate or opt-in to the blacklist before deployment.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 704a0801-c998-4b03-a0cb-8c7b9dc00456
📒 Files selected for processing (2)
bosh-stemcell/spec/support/os_image_linux_kernel_modules_shared_examples.rbstemcell_builder/stages/system_kernel_modules/apply.sh
Note: per Gemini, these modules have the following uses.
Encapsulating Security Payload (esp4/esp6): These modules are utilized when Cloud Foundry operators deploy the IPsec Add-on. This add-on secures traffic between internal components (like the GoRouter and Diego Cells) by encrypting the data packets at the kernel level.
AF_RXRPC (rxrpc): This is part of the standard network stack included in the stemcell kernel. While rarely used by modern Cloud Foundry applications, it remains a monitored component for security compliance.
Mitigation for https://github.com/V4bel/dirtyfrag