Skip to content

fix: surface RBAC severity changes in scan diffs - #100

Merged
rrskris merged 1 commit into
kaaval:mainfrom
floze-the-genius:batch69-kaaval-01-issue-99
Jul 26, 2026
Merged

rrskris merged 1 commit into
kaaval:mainfrom
floze-the-genius:batch69-kaaval-01-issue-99

Conversation

@floze-the-genius

@floze-the-genius floze-the-genius commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

What this changes

  • adds a stable severity_changed bucket to RBAC scan diffs
  • reports the latest finding together with previous_severity for escalations and de-escalations
  • keeps identical-severity findings in unchanged_count and preserves added/resolved semantics
  • includes severity_changed: [] in empty and unchanged response shapes

Closes #99.

Dependency: this follow-up is stacked on #82 because the diff endpoint is not yet on main. The first commit carries #82 unchanged; the issue #99 implementation is the second commit. Please merge #82 first.

Type

  • New detection rule / finding source
  • Bug fix
  • Feature
  • Docs
  • Refactor / chore

Checklist

  • Full control-plane test suite passes
  • Added/updated tests for the behavior change
  • New rule ships with a remediation and a verified benchmark citation (not applicable: no new rule)
  • Added a fixture to hack/dev/rbac-fixtures.yaml if it is a new rule (not applicable)
  • Docs updated (not applicable: response contract is covered by tests and OpenAPI)
  • Conventional commit messages
  • Every commit includes a DCO sign-off

The new #99 commit intentionally has no Signed-off-by trailer because no DCO certification has been provided or authorized for it. The earlier #82 commit is carried unchanged from its existing branch.

How you verified it

  • KAAVAL_ADMIN_PASSWORD=test-admin-password ../.venv/bin/python -m pytest tests/test_rbac_diff.py -v - 9 passed
  • CI-equivalent backend suite with PostgreSQL 16: pytest tests/ --cov=app --cov-fail-under=60 - 77 passed, 64.02% coverage
  • python -m compileall -q control-plane/app control-plane/tests
  • git diff --check

AI assistance

Implemented with OpenAI Codex. I reviewed the final diff and validated the focused and full test suites listed above.

@floze-the-genius
floze-the-genius force-pushed the batch69-kaaval-01-issue-99 branch from e88c3e2 to ceb489e Compare July 19, 2026 11:39
@floze-the-genius

Copy link
Copy Markdown
Contributor Author

Correction: I removed the Signed-off-by trailer from the new #99 commit because no DCO certification was provided or authorized for it. This is a legal-attestation boundary, not a code-quality issue. The implementation and validation are unchanged; maintainers can decide whether a contributor DCO or another policy-compliant path is required.

@rrskris rrskris mentioned this pull request Jul 19, 2026
4 of 11 tasks
@rrskris

rrskris commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator

#82 is merged, so this can now shed its carried commit — please rebase onto main so only the #99 change remains.

Two things before this can go in:

  1. DCO: the severity_changed commit has no Signed-off-by, and the DCO check is failing. The project requires it on every commit (see CONTRIBUTING) — git commit --amend -s after the rebase does it. The sign-off is your certification of the DCO (developercertificate.org), which only you can add — that's why I can't waive it.

  2. After the rebase, the diff should be just rbac_service.py + test_rbac_diff.py deltas on top of main.

The implementation itself reads right — escalations and de-escalations both land in severity_changed with previous_severity, and unchanged_count now counts only truly-unchanged keys, which is exactly what #99 asked for. Once it's rebased and signed off I'll do the final pass.

@floze-the-genius
floze-the-genius force-pushed the batch69-kaaval-01-issue-99 branch from ceb489e to af06fdf Compare July 20, 2026 11:04
@floze-the-genius

Copy link
Copy Markdown
Contributor Author

Rebased this PR onto the current main, dropping the already-merged #82 commit. The remaining commit is now signed off, and the final diff is limited to rbac_service.py and test_rbac_diff.py. The focused tests pass locally, and the refreshed DCO and CI checks are green.

@rrskris rrskris left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified locally: rebased cleanly onto main, the diff is exactly the two files you named (rbac_service.py + test_rbac_diff.py), sign-off is present, and the full suite goes 77 → 79 with your two new cases. All checks green.

The severity_changed bucket is the right call — an escalation hiding in unchanged was the actual bug in #99, and keying on the finding identity while comparing severity separately is the clean way to catch it.

Thanks for the careful rebase and for flagging the DCO boundary explicitly rather than just adding a trailer.

@rrskris
rrskris merged commit abac060 into kaaval:main Jul 26, 2026
7 checks passed
rrskris added a commit that referenced this pull request Jul 26, 2026
Adds Unreleased entries for the five PRs merged today, following the existing
"Contributed by [@user](link) (#PR)" convention:

- #106 Trivy report ingestion adapter (@Diyaaa-12)
- #108 CIS 5.1.6 token_automount rule (@donkk11)
- #103 Helm chart skeleton (@girosole60)
- #100 severity_changed bucket in the RBAC scan diff (@floze-the-genius)
- #118 / #119 doc and scanner-RBAC corrections

Notes the doc corrections explicitly rather than folding them in silently: the
--output table had been missing sarif and junit since those shipped, api.md
never documented GET /rbac/scan/diff, and the claim that Kaaval would not flag
its own scanner role stopped being true when segmentation_violation landed.

Signed-off-by: Vamshi Krishna Santhapuri <[email protected]>
rrskris added a commit that referenced this pull request Aug 5, 2026
@floze-the-genius shipped three PRs, but only the bugfix (#100) appeared in the
changelog — the two features it built on, GET /rbac/scan/diff (#82) and the
kaaval doctor preflight (#80), were missing entirely. Anyone reading the release
notes would see the fix to a feature whose arrival was never recorded.

Scope of each entry was taken from the merge commits rather than the issue
titles: #80 adds the CLI command and typed health results on top of the deep
health checks that #75 already provided, so it is credited for the wrapper it
actually wrote, not for the checks themselves.

Prep for the v1.2.0 release notes, so the credit ships in the release rather
than as a later correction.

Signed-off-by: Vamshi Krishna Santhapuri <[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.

RBAC scan diff: severity_changed bucket (escalations shouldn't hide in unchanged)

2 participants