Add OpenShift Route security check#1212
Conversation
Add insecure-route-termination check that flags OpenShift Routes with InsecureEdgeTerminationPolicy: Allow, which permits plaintext HTTP on credential-bearing endpoints.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Central YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughAdds a built-in YAML check for OpenShift Routes that flags ChangesInsecure route termination
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
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 `@tests/checks/insecure-route-termination.yml`:
- Around line 1-45: Add the missing Bats coverage for the insecure route
termination check so the new fixture is exercised by the harness. Update
e2etests/bats-tests.sh with a case for
tests/checks/insecure-route-termination.yml, using the same pattern as the other
check tests. Make the assertion target the fire-allow-insecure Route and verify
the expected diagnostic for insecureEdgeTerminationPolicy set to Allow, while
keeping the Redirect/None and non-Route resources as non-failing cases.
🪄 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: Central YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: 177f5147-3046-47b9-8672-cb10c7e73836
📒 Files selected for processing (2)
pkg/builtinchecks/yamls/insecure-route-termination.yamltests/checks/insecure-route-termination.yml
- Add bats test case for insecure-route-termination check - Regenerate docs/generated/checks.md and templates.md
Move insecure-route-termination test to correct alphabetical position in bats-tests.sh to satisfy check-bats-tests.sh verification.
Summary
insecure-route-terminationcheck for OpenShift Routes withInsecureEdgeTerminationPolicy: Allowcel-expressiontemplate withobjectKinds: [Any]and a kind guard for Route objectsNew Check
insecure-route-terminationNotes
objectKinds: [Any]with aobject.kind == 'Route'guard since Route is an OpenShift-specific CRDTest plan