-
Notifications
You must be signed in to change notification settings - Fork 39
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
base: master
Are you sure you want to change the base?
Changes from 2 commits
8a361e0
f99eca5
f8fbda0
58d1ad6
7084d4b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# permissions to scale Camel K resources. | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: appstudio-api-permissions | ||
rules: | ||
- apiGroups: | ||
- appstudio.redhat.com | ||
- tekton.dev | ||
- jvmbuildservice.io | ||
resources: | ||
- "*" | ||
verbs: | ||
# TODO fix after changing the ADR and associated appstudio teemplates | ||
- "*" | ||
- apiGroups: | ||
- managed-gitops.redhat.com | ||
- results.tekton.dev | ||
resources: | ||
- "*" | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- update | ||
- patch | ||
- delete | ||
- create | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- secrets | ||
- configmaps | ||
verbs: | ||
# TODO fix after changing the ADR and associated appstudio teemplates | ||
- "*" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: appstudio-api-permissions | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: appstudio-api-permissions | ||
subjects: | ||
- kind: ServiceAccount | ||
name: controller-manager | ||
namespace: system |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: edit-manager-rolebinding | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: edit | ||
subjects: | ||
- kind: ServiceAccount | ||
name: controller-manager | ||
namespace: system |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -89,9 +89,8 @@ type Reconciler struct { | |
//+kubebuilder:rbac:groups=toolchain.dev.openshift.com,resources=nstemplatesets/status,verbs=get;update;patch | ||
//+kubebuilder:rbac:groups=toolchain.dev.openshift.com,resources=nstemplatesets/finalizers,verbs=update | ||
|
||
//+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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just trying to understand - what is this controller doing with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is needed to be able to apply sandbox templates https://github.com/codeready-toolchain/host-operator/blob/master/deploy/templates/nstemplatetiers/base1ns/ns_dev.yaml#L21-L37 |
||
//+kubebuilder:rbac:groups=rbac.authorization.k8s.io;authorization.openshift.io,resources=rolebindings;roles;clusterroles;clusterrolebindings,verbs=get;list;watch;create;update;patch;delete | ||
//+kubebuilder:rbac:groups=quota.openshift.io,resources=clusterresourcequotas,verbs=get;list;watch;create;update;patch;delete | ||
//+kubebuilder:rbac:groups=networking.k8s.io,resources=networkpolicies,verbs=get;list;watch;create;update;patch;delete | ||
//+kubebuilder:rbac:groups=appstudio.redhat.com,resources=environments,verbs=get;list;watch;create;update;delete | ||
|
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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