Skip to content

docs(rbac): document the four combo-escalation rule_types - #142

Closed
shariqueahmad108-ship-it wants to merge 1 commit into
kaaval:mainfrom
shariqueahmad108-ship-it:docs/combo-rule-catalog-129
Closed

shariqueahmad108-ship-it wants to merge 1 commit into
kaaval:mainfrom
shariqueahmad108-ship-it:docs/combo-rule-catalog-129

Conversation

@shariqueahmad108-ship-it

Copy link
Copy Markdown
Contributor

What this changes

#105 shipped combo_role_escalation, combo_bind_escalation, impersonation_grant, and privileged_pod_creation, but none of them made it into docs/rbac-rules.md - every other rule has a row there, these four (the highest severity ones) didn't.

Gave them their own table instead of folding into the main one, since the main table's trigger column says "any rule in the Role/ClusterRole" and that's not true here - these only fire on a subject's aggregate rule set across every binding. Tried to make that distinction clear for someone who hasn't read effective_access.py.

Closes #129

Type

  • Docs

Checklist

  • N/A — docs only, no test suite behavior changed
  • N/A — no test changes needed (this is the doc issue itself)
  • Citations verified — reused CIS 5.1.8 for the three verb-based rules (same control already cited for privilege_escalation_verbs, just a stronger combo-confirmed signal). privileged_pod_creation has no matching CIS 5.1 combination control, so RBAC Good Practices + OWASP K03, same pattern already used in this file for exec_attack_grant/segmentation_violation. Didn't invent anything new.
  • N/A — not a new rule
  • Docs updated (this PR is the doc update)
  • Conventional commit messages

How you verified it

grep -n "combo_role_escalation\|combo_bind_escalation\|impersonation_grant\|privileged_pod_creation" docs/rbac-rules.md (the check the issue itself specifies) - all four now appear. Also ran the control-plane test suite on this branch to make sure nothing else broke: 114 passed (SQLite override, no Postgres locally - same as noted on #131).

@rrskris

rrskris commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Holding this one, and I owe you a clear explanation rather than a silent close — you didn't do anything wrong here.

#133 (opened a day before this) also closes #129 and adds a combo-rules section to the same file. The two don't conflict in git — your section goes in after the notes block, theirs after the main table, so both apply cleanly and the merged file ends up with ## Combination-escalation rules (Effective Access Graph) twice, 90 lines apart. I merged both locally to check; that's a real outcome, not a worry.

So one of them has to give way, and it has to be this one. #133 also closes #88 — it adds the remediation.py entries for these four rule_types in the same PR. That makes its table the one that has to be authoritative, because the citations in the doc have to match what the code actually emits to a user. Concretely: your table cites OWASP K03 for privileged_pod_creation; #133's remediation entry carries CIS 5.1.4 + RBAC Good Practices and no K03. A docs-only PR can't know what the code half is going to say, and that gap is the whole reason to prefer the PR that changes both together. Nothing to do with the quality of what you wrote.

Two things in here are better than #133's, and I'm not letting them evaporate:

Your placement is the correct one. Putting the combo section after the per-role notes rather than between the main table and its notes is right — #133's insertion point splits that table from the prose explaining it. I've asked them to move theirs to where you put yours.

Your api_groups note is the part #133 genuinely doesn't have, and after #131 lands it stops being optional — #133's trigger column says create on roles/clusterroles with no mention of group, which will be incomplete the moment your fix is in. I deliberately did not ask #133 to write that note, because it's the documentation half of your own #125 fix and it should be yours.

So: once #131 and #133 are both merged, rebase this on main and cut it down to just the api_groups bullet appended to the existing section. Small diff, lands as its own commit, and it's the piece only you were positioned to write. I'll review it same-day.

If you'd rather not do the rebase, say so and I'll close this with credit in the changelog — no hard feelings either way. But I'd rather you got the commit.

Sorry you hit this. Two people solving the same open issue in the same week is a queue-management failure on my end, not yours — #129 should have been assigned when Maqbool asked for it on #88. I've started assigning good first issues on request so this stops happening. From here on: comment on an issue before you start and I'll assign it same-day, and then it's yours.

And to be concrete about that, rather than leaving you to guess what's safe to pick up — nothing on the tracker is assigned right now except my own design issues, so all of these are open:

Your #143 is still in my queue and I'll review it this week — this isn't a signal about that one.

Three PRs in two weeks, and the one substantive review I gave you came back fixed correctly the first time. I'd rather keep you contributing than win an argument about a docs section, so if any of the above appeals, claim it and it's yours.

@rrskris

rrskris commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

The _role_is_privileged() follow-up I mentioned above is #144 — unassigned, and the natural next step from your #131.

@rrskris

rrskris commented Aug 13, 2026 •

Copy link
Copy Markdown
Collaborator

Both blockers are now merged: #131 landed on 2026-08-05 and #133 went in today, so the section this needs to attach to is on main.

The docs now have ## Combination-escalation rules (Effective Access Graph) after the per-role notes block — your placement, which #133 moved to as asked. What's still missing is the part I said should be yours: the api_groups bullet.

So the ask is what I described before, unchanged: rebase on main and cut this down to just that one bullet appended to the existing "Notes on the combination rules" list. Roughly the four lines you already wrote —

api_groups matters here — roles/clusterroles/rolebindings/clusterrolebindings only count in the rbac.authorization.k8s.io group; users/groups/serviceaccounts/pods only count in the core group (""). A CRD reusing one of those resource names in an unrelated group does not trigger these rules (see #125).

— which is accurate against the code as merged. I checked _has_resource in effective_access.py after both fixes: it intersects rule.api_groups against _RBAC_API_GROUP / _CORE_API_GROUP, so a CRD in an unrelated group does not trigger, exactly as you describe. #133's trigger column says nothing about api_groups, so the gap you identified is real and still open.

One nuance worth folding in while you're there, because it's the one case your bullet doesn't cover: when a rule omits api_groups entirely (or sets it empty), _has_resource deliberately returns True rather than assuming core-group-only — the reasoning is in a comment above the branch, that a scanner should resolve missing information toward reporting a possible finding. Real PolicyRules always carry apiGroups, so this doesn't weaken your point; but a sentence noting that an unspecified group is treated as "could match" would make the bullet complete, and it's the kind of thing someone reading the rule catalog to explain a finding will want.

Everything else in this PR is now covered by the merged section, so the rest can go. Small diff, your commit, and it documents your own #125/#131 fix.

I'll review it same-day — and thanks for waiting through this one; the queue collision was mine to avoid.

If you'd rather not do the rebase, say so and I'll close with changelog credit, no hard feelings. #144 (_role_is_privileged()) is also still unassigned and still the strongest claim you have on anything in the tracker.

@shariqueahmad108-ship-it

Copy link
Copy Markdown
Contributor Author

Done — rebased on main and cut down to just the api_groups bullet, appended to the "Notes on the combination rules" list. Folded in the unspecified-api_groups nuance you flagged: a rule that omits api_groups is treated as unspecified and still counts, matching the "resolve missing information toward a possible finding" reasoning in _has_resource. 8-line diff, single commit — ready when you are. And no worries at all on the queue collision.

…aval#129)

Rebased on main and cut down to the single api_groups bullet reserved for this
PR — the combination-escalation section itself landed via kaaval#133.

Documents that roles/clusterroles/rolebindings/clusterrolebindings only count in
the rbac.authorization.k8s.io group and users/groups/serviceaccounts/pods only
in the core group, so a CRD reusing one of those resource names in an unrelated
group does not trigger these rules (kaaval#125). Also notes that a rule which omits
api_groups is treated as unspecified and still counts, matching _has_resource in
effective_access.py.

Signed-off-by: shariqueahmad108-ship-it <[email protected]>
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.

docs: rbac-rules.md rows for the four combination-escalation rule_types

2 participants