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: limit usage of * in RBAC #440

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

MatousJobanek
Copy link
Contributor

@MatousJobanek MatousJobanek commented May 15, 2023

because * includes also escalate permissions

there needs to be a follow-up on appstudio side as well

KUBESAW-178

@openshift-ci openshift-ci bot requested review from alexeykazakov and sbryzak May 15, 2023 17:08
@MatousJobanek
Copy link
Contributor Author

/retest

@@ -0,0 +1,36 @@
# permissions to scale Camel K resources.
Copy link
Contributor

Choose a reason for hiding this comment

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

is this up to date with the actual purpose of this role?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. bad copy-paste - fixed in f8fbda0

//+kubebuilder:rbac:groups="",resources=namespaces;limitranges,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups="",resources=namespaces;resourcequotas,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=rbac.authorization.k8s.io;authorization.openshift.io,resources=rolebindings;roles;clusterroles;clusterrolebindings,verbs=*
//+kubebuilder:rbac:groups="",resources=namespaces;limitranges;resourcequotas;pods/exec,verbs=get;list;watch;create;update;patch;delete
Copy link
Contributor

@mfrancisc mfrancisc May 16, 2023

Choose a reason for hiding this comment

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

just trying to understand - what is this controller doing with pods/exec resources ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@mfrancisc mfrancisc left a comment

Choose a reason for hiding this comment

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

Thanks for addressing my comments 👍

@MatousJobanek
Copy link
Contributor Author

unfortunately, this won't be as easy as it seems to be. It's very hard to reference to an already existing ClusterRole which is no managed by OLM and it's impossible to do that in e2e (or dev) environment where we deploy two versions of member-operator. The reason is that the OLM doesn't know which SA in which namespace the ClusterRole should be assigned to. Plus, there is also a conflict in the name of the created ClusterRoleBinding.

@openshift-ci
Copy link

openshift-ci bot commented May 16, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alexeykazakov, MatousJobanek, mfrancisc, rajivnathan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [MatousJobanek,alexeykazakov]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci
Copy link

openshift-ci bot commented May 16, 2023

@MatousJobanek: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e 58d1ad6 link true /test e2e

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@MatousJobanek MatousJobanek marked this pull request as draft May 17, 2023 06:46
@sonarcloud
Copy link

sonarcloud bot commented May 17, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
10.7% 10.7% Duplication

@MatousJobanek
Copy link
Contributor Author

I moved the PR to a draft until I figure out how to solve the problem I mentioned in my previous comment #440 (comment)

@codecov
Copy link

codecov bot commented May 17, 2023

Codecov Report

Merging #440 (7084d4b) into master (e41f6e4) will not change coverage.
The diff coverage is n/a.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #440   +/-   ##
=======================================
  Coverage   82.17%   82.17%           
=======================================
  Files          28       28           
  Lines        3298     3298           
=======================================
  Hits         2710     2710           
  Misses        445      445           
  Partials      143      143           
Impacted Files Coverage Δ
...ontrollers/memberstatus/memberstatus_controller.go 96.36% <ø> (ø)
...trollers/nstemplateset/nstemplateset_controller.go 72.84% <ø> (ø)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants