Repository navigation
fix(deploy): grant the scanner serviceaccounts/pods read for CIS 5.1.6 - #119
Merged
Merged
Conversation
The token_automount rule added in #108 reads ServiceAccount automount settings and pod specs. Both fetches are wrapped in their own try/except, so a scanner without those permissions logs a warning and silently returns no automount findings — meaning the rule shipped dark for anyone following the documented in-cluster deployment. Adds read-only get/list on core serviceaccounts and pods to both the kaaval-scanner-reader ClusterRole in deploy/cronjob.yaml and the documented kaaval-scanner role in docs/ci-integration.md. Also corrects a stale claim next to that role. The docs asserted Kaaval "would not flag it"; scanning deploy/cronjob.yaml shows it does, and has since the segmentation_violation rule landed in #52 — a namespaced ServiceAccount granted cluster scope via ClusterRoleBinding is exactly what that rule looks for. Verified the two added grants introduce no new findings (3 before, 3 after), so the least-privilege story holds; the parenthetical was simply wrong. Replaced it with the actual result and why it is expected. Signed-off-by: Vamshi Krishna Santhapuri <[email protected]>
Invigil —
|
| Gate | Check | Effort | Why | Fix |
|---|---|---|---|---|
| G4 | OpenSSF Scorecard >= 7 | hours | score 6.7 < 7 | triage the Scorecard findings (branch protection, token perms, pinned deps) to reach >=7 |
30 passing · 1 failing · 4 skipped · report-only
5 tasks done
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #108, as promised in that review.
The gap
token_automountreads ServiceAccount automount settings and pod specs vialist_service_account_for_all_namespaces()andlist_pod_for_all_namespaces(). Both are wrapped in their owntry/except ApiException— good defensive design, since it means a scanner lacking those permissions still returns the binding-based rules instead of failing the scan outright.The consequence is that the rule fails quietly. The
kaaval-scanner-readerClusterRole indeploy/cronjob.yamland thekaaval-scannerrole documented indocs/ci-integration.mdboth grant onlyrbac.authorization.k8s.ioresources, so anyone deploying as documented gets a logged warning and zero automount findings.--manifestsmode was never affected.This adds read-only
get/liston coreserviceaccountsandpodsto both.Also: a stale dogfooding claim
The docs said, next to that role:
That is not true, and wasn't before this PR either. Scanning
deploy/cronjob.yaml:Identical before and after this change — so the two added grants introduce no new findings and the least-privilege claim genuinely holds. The
segmentation_violationhas been firing since #52: a namespaced ServiceAccount granted cluster scope through a ClusterRoleBinding is precisely what that rule detects, and it is unavoidable for a cluster-wide read.Rather than delete the sentence, I replaced it with the real result and why it's expected. A scanner that trips its own rule by design, and says so, is a better advert for the rule than a claim that quietly went stale.
Verified with
python -m app.cli scan rbac --manifests deploy/cronjob.yaml.