Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Replace wildcards in RBAC objects with explicit resources and verbs #6129

Merged
merged 4 commits into from
Nov 3, 2024

Conversation

legal90
Copy link
Contributor

@legal90 legal90 commented Sep 3, 2024

According to Kubernetes documentation and various k8s security guidelines, wildcards in resource and verb entries should be avoided:

Warning

Using wildcards in resource and verb entries could result in overly permissive access being granted to sensitive resources. For instance, if a new resource type is added, or a new subresource is added, or a new custom verb is checked, the wildcard entry automatically grants access, which may be undesirable. The principle of least privilege should be employed, using specific resources and verbs to ensure only the permissions required for the workload to function correctly are applied.

Refs:

This PR could be seen as a continuation of a previous work for hardening the RBAC: kedacore/charts#625
It replaces * with explicit verbs and resources, according to KEDA needs.

Checklist

Relates to kedacore/charts#682

@legal90 legal90 requested a review from a team as a code owner September 3, 2024 18:22
config/rbac/role.yaml Outdated Show resolved Hide resolved
@JorTurFer
Copy link
Member

JorTurFer commented Sep 11, 2024

/run-e2e
Update: You can check the progress here

@legal90 legal90 force-pushed the rbac-no-wildcards branch 2 times, most recently from 0d56c96 to da55007 Compare September 13, 2024 08:40
@zroubalik
Copy link
Member

zroubalik commented Sep 18, 2024

/run-e2e
Update: You can check the progress here

@zroubalik
Copy link
Member

zroubalik commented Sep 24, 2024

/run-e2e
Update: You can check the progress here

@legal90 legal90 force-pushed the rbac-no-wildcards branch from da55007 to aa1b7bf Compare October 4, 2024 06:32
@JorTurFer
Copy link
Member

JorTurFer commented Oct 16, 2024

/run-e2e
Update: You can check the progress here

@JorTurFer
Copy link
Member

JorTurFer commented Oct 16, 2024

/run-e2e internal
Update: You can check the progress here

@JorTurFer
Copy link
Member

JorTurFer commented Oct 30, 2024

/run-e2e internal
Update: You can check the progress here

@JorTurFer
Copy link
Member

JorTurFer commented Oct 31, 2024

/run-e2e rabbit
Update: You can check the progress here

Copy link
Member

@JorTurFer JorTurFer left a comment

Choose a reason for hiding this comment

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

Looking good, only 1 comment inline
PTAL @wozniakjan

@JorTurFer
Copy link
Member

JorTurFer commented Oct 31, 2024

/run-e2e subresource_scale_test
Update: You can check the progress here

Copy link
Member

@wozniakjan wozniakjan left a comment

Choose a reason for hiding this comment

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

lgtm, assuming e2e tests pass

config/rbac/role.yaml Show resolved Hide resolved
@JorTurFer
Copy link
Member

JorTurFer commented Nov 3, 2024

/run-e2e
Update: You can check the progress here

@JorTurFer
Copy link
Member

@legal90 , could you fix DCO? it was broken during last commit -> https://github.com/kedacore/keda/pull/6129/checks?check_run_id=32323819193

@JorTurFer JorTurFer mentioned this pull request Nov 3, 2024
28 tasks
Signed-off-by: Mikhail Zholobov <legal90@gmail.com>
Signed-off-by: Mikhail Zholobov <legal90@gmail.com>
Signed-off-by: Mikhail Zholobov <legal90@gmail.com>
According to the PR review comment.

Signed-off-by: Mikhail Zholobov <legal90@gmail.com>
@legal90
Copy link
Contributor Author

legal90 commented Nov 3, 2024

@JorTurFer Yes sure! I fixed the DCO and rebased the branch now.

@JorTurFer
Copy link
Member

JorTurFer commented Nov 3, 2024

/run-e2e
Update: You can check the progress here

@JorTurFer JorTurFer enabled auto-merge (squash) November 3, 2024 20:07
@JorTurFer JorTurFer merged commit 83e3685 into kedacore:main Nov 3, 2024
19 checks passed
mpechner-akasa pushed a commit to nrichardson-akasa/keda that referenced this pull request Nov 29, 2024
…rbs (kedacore#6129)

* fix: Replace wildcards in RBAC objects with explicit resources and verbs

Signed-off-by: Mikhail Zholobov <legal90@gmail.com>

* Update changelog

Signed-off-by: Mikhail Zholobov <legal90@gmail.com>

* Revert the deletion of RBAC rule "allow to get any resource"

Signed-off-by: Mikhail Zholobov <legal90@gmail.com>

* Rollback the RBAC rule for "*/scale"

According to the PR review comment.

Signed-off-by: Mikhail Zholobov <legal90@gmail.com>

---------

Signed-off-by: Mikhail Zholobov <legal90@gmail.com>
Signed-off-by: michael pechner <mike.pechner@akasa.com>
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