Repository navigation
hack/dev: add combination-takeover fixture (closes #86) - #152
Conversation
Add a ServiceAccount (combo-takeover-sa) bound to two ClusterRoles whose individual grants look routine but together form a full cluster-takeover path: combo-role-writer — create roles/clusterroles (rbac group) combo-escalate-gate — escalate verb on clusterroles (rbac group) The per-role scanner cannot produce a combo_role_escalation finding because it evaluates each Role in isolation. The Effective Access Graph (evaluate_combo_findings / issue kaaval#84) aggregates both rule sets for the subject and fires combo_role_escalation (CRITICAL, score >= 14). Closes kaaval#86 Part of kaaval#47 Signed-off-by: Maqbool Ahmed <[email protected]>
38440e0 to
08025a0
Compare
|
Merged — thanks @Maqbool61. The trap itself is well built, and I verified it does what you designed it to do: One detail I want to call out because it was a deliberate choice and it mattered: setting I did correct three of the explanatory comments in #157, because they describe behaviour the scanner doesn't produce, and this file is what the next person reads before touching #84:
Worth reading the diff on #157 since the third one changes what #84 actually means. None of it touches your YAML. That's three merged now (#52, #59, #133, plus this) — if you want the next piece of the Effective Access Graph, #87 (surface effective-access findings in CLI and dashboard) is the natural follow-on from the remediation work you just did in #133, and it's unassigned. Say the word and it's yours. |
…output (#157) The fixture YAML is right, but three of its explanatory comments describe behaviour the scanner does not produce, which would send the next person working on #84 chasing a phantom: - combo-role-writer was documented as producing NO per-role finding; its ClusterRoleBinding raises segmentation_violation like every other ClusterRoleBinding over a namespaced ServiceAccount. - combo-escalate-gate was documented as privilege_escalation_verbs MEDIUM; the rule scores HIGH whenever the role is cluster-scoped, and MEDIUM only for a namespaced Role. - The verify block said combo_role_escalation arrives once #84 lands. evaluate_combo_findings() already reports it today (#105/#131/#145) — what #84 adds is surfacing it through the per-role scan path. Verified by running the scan and evaluate_combo_findings() against the fixture. Follow-up to #152 (@Maqbool61). Signed-off-by: Vamshi Krishna Santhapuri <[email protected]>
Adds release-notes entries for the five contributor PRs merged today: Grype ingestion (#123, @Diyaaa-12), combo-escalation remediation and rule catalog (#133, @Maqbool61), the combination-takeover fixture (#152, @Maqbool61), the Postgres-unreachable test skip (#151, @HeaTTap — first contribution), and the CIS 5.1.6 acceptance check moving into CI (#124, @donkk11). Also records the fixture-comment correction from #157. Signed-off-by: Vamshi Krishna Santhapuri <[email protected]>
…#128) GET /rbac/combo-scan/demo shipped an ~80-line hardcoded graph as a permanent public route. It is removed; the graph now lives in hack/dev/combo-scan-graph.json, and docs/api.md documents POST /rbac/combo-scan with a curl smoke check against that file. The demo's separate role-and-escalate role is dropped because combo_role_escalation already has its dedicated combo-takeover fixture in hack/dev/rbac-fixtures.yaml (kaaval#86/kaaval#152). rbac-fixtures.yaml itself is left unchanged: the published-image smoke test greps for CRITICAL=1 and test_issue7_acceptance pins its token_automount findings. tests/test_combo_scan_fixture.py asserts all four combo rule_types fire from the fixtures, and that the route is gone from the API and /docs. Closes kaaval#128 Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: shariqueahmad108-ship-it <[email protected]>
…#128) GET /rbac/combo-scan/demo shipped an ~80-line hardcoded graph as a permanent public route. It is removed; the graph now lives in hack/dev/combo-scan-graph.json, and docs/api.md documents POST /rbac/combo-scan with a curl smoke check against that file. The demo's separate role-and-escalate role is dropped because combo_role_escalation already has its dedicated combo-takeover fixture in hack/dev/rbac-fixtures.yaml (kaaval#86/kaaval#152). rbac-fixtures.yaml itself is left unchanged: the published-image smoke test greps for CRITICAL=1 and test_issue7_acceptance pins its token_automount findings. tests/test_combo_scan_fixture.py asserts all four combo rule_types fire from the fixtures, and that the route is gone from the API and /docs. Closes kaaval#128 Signed-off-by: shariqueahmad108-ship-it <[email protected]>
What
Adds a combination-takeover fixture to
hack/dev/rbac-fixtures.yamlas specified in #86 (part of #47 "Rollout shape" step 2).The fixture is a
ServiceAccountbound to two benign-lookingClusterRoles whose combined grants form a full cluster-takeover path — acombo_role_escalationfinding that only the Effective Access Graph (evaluate_combo_findings/ #84) can surface.Objects added
ClusterRolecombo-role-writercreateonroles/clusterroles(rbac group) — half 1ClusterRolecombo-escalate-gateescalateonclusterroles(rbac group) — half 2ServiceAccountcombo-takeover-saautomountServiceAccountToken: false)ClusterRoleBindingcombo-role-writer-bindingClusterRoleBindingcombo-escalate-gate-bindingAll five objects carry the label
kaaval.dev/fixture: combo-takeoverso they can be selected or torn down as a unit.Why this combo
combo-role-writeralone → no finding (create on RBAC objects has no standalone rule in the per-role scanner)combo-escalate-gatealone →privilege_escalation_verbs(MEDIUM — one isolated role, no cluster-takeover conclusion)combo_role_escalation(CRITICAL, score 14.25): the subject can create a role with arbitrary verbs and then escalate into it without a privilege check — full cluster takeoverThis is the exact demo asset the issue calls for: the role-centric scan misses the combination path; the Effective Access Graph catches it.
Testing
All 27 existing
test_effective_access.pytests pass unchanged.Smoke-test against the fixture graph:
Applied cleanly to a kind cluster:
Acceptance criteria checklist
kubectl apply -f hack/dev/rbac-fixtures.yaml)combo_role_escalationfinding for the subjectevaluate_combo_findingsreportscombo_role_escalation(CRITICAL) forcombo-takeover-saCloses Combination-takeover fixture in hack/dev/rbac-fixtures.yaml #86
Part of Effective Access Graph: identity-centric RBAC aggregation #47