Skip to content

fix(checks): improve detection logic for AVD-KSV-0050#514

Merged
simar7 merged 3 commits intoaquasecurity:mainfrom
syedazeez337:fix/ksv0050-detection-logic
Jan 27, 2026
Merged

fix(checks): improve detection logic for AVD-KSV-0050#514
simar7 merged 3 commits intoaquasecurity:mainfrom
syedazeez337:fix/ksv0050-detection-logic

Conversation

@syedazeez337
Copy link
Contributor

The check now only flags truly critical verbs (escalate, bind, impersonate) on roles/rolebindings. Regular CRUD operations (create, update, delete, deletecollection) are not flagged as Kubernetes RBAC prevents privilege escalation by default.

As explained in the issue, Kubernetes API prevents roles from being created with more privileges than the authorizer unless escalate or bind permissions are present. Only escalate, bind, and impersonate directly allow privilege escalation.

Refs: #9826
Refs: #9744

The check now only flags truly critical verbs (escalate, bind, impersonate)
on roles/rolebindings. Regular CRUD operations (create, update, delete,
deletecollection) are not flagged as Kubernetes RBAC prevents privilege
escalation by default.

As explained in the issue, Kubernetes API prevents roles from being created
with more privileges than the authorizer unless escalate or bind permissions
are present. Only escalate, bind, and impersonate directly allow privilege
escalation.

Refs: #9826
Refs: #9744
@syedazeez337 syedazeez337 requested a review from simar7 as a code owner December 29, 2025 10:47
@CLAassistant
Copy link

CLAassistant commented Dec 29, 2025

CLA assistant check
All committers have signed the CLA.

# custom:
# id: KSV-0050
# long_id: kubernetes-no-manage-rbac-resources
# long_id: kubernetes-no-privilege-escalation-rbac
Copy link
Contributor

Choose a reason for hiding this comment

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

The old identifier must be added to the alias to maintain compatibility if someone is already using it in ignore rules.

@nikpivkin
Copy link
Contributor

Hi @syedazeez337 !

Thanks for your contribution! I left a comment.

Can you run make docs to update docs?

…-0050

Add the old long_id 'kubernetes-no-manage-rbac-resources' to aliases
to maintain compatibility for users with existing ignore rules.

Run 'make docs' to regenerate documentation.
@syedazeez337
Copy link
Contributor Author

Hi @nikpivkin , I have update the docs and made the change you asked for. Let me know if everything looks good

# custom:
# id: KSV-0050
# long_id: kubernetes-no-manage-rbac-resources
# long_id: kubernetes-no-privilege-escalation-rbac
Copy link
Contributor

Choose a reason for hiding this comment

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

I meant that if long_id or any other identifier changes, it should be added to the alias.

…V-0050

Keep the original 'no-manage-rbac-resources' alias that existed in main
to maintain backward compatibility for users with existing ignore rules.
@simar7 simar7 added this pull request to the merge queue Jan 27, 2026
Merged via the queue into aquasecurity:main with commit aa22dae Jan 27, 2026
5 checks passed
@syedazeez337
Copy link
Contributor Author

Hi @nikpivkin , thank you for your support and guidance and @simar7 thank you for approving the PR. I would like to get more involved in the project. Let me know if there is community I can join so the I can be part of the conversation.

@nikpivkin
Copy link
Contributor

Hi @syedazeez337, thanks!

Issues and Discussions in the Trivy repository are great places to follow ongoing conversations, suggest ideas, and engage with the developers.

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.

4 participants