-
Notifications
You must be signed in to change notification settings - Fork 53
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
Feature/add sso roles #480
Open
klinch0
wants to merge
3
commits into
aenix-io:main
Choose a base branch
from
klinch0:feature/add-sso-roles
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+232
−11
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ description: Separated tenant namespace | |
icon: /logos/tenant.svg | ||
|
||
type: application | ||
version: 1.5.0 | ||
version: 1.6.0 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
apiVersion: v1.edp.epam.com/v1 | ||
kind: KeycloakRealmGroup | ||
metadata: | ||
name: {{ include "tenant.name" . }}-view | ||
namespace: {{ include "tenant.name" . }} | ||
spec: | ||
name: {{ include "tenant.name" . }}-view | ||
realmRef: | ||
name: keycloakrealm-cozy | ||
kind: ClusterKeycloakRealm | ||
|
||
--- | ||
|
||
apiVersion: v1.edp.epam.com/v1 | ||
kind: KeycloakRealmGroup | ||
metadata: | ||
name: {{ include "tenant.name" . }}-use | ||
namespace: {{ include "tenant.name" . }} | ||
spec: | ||
name: {{ include "tenant.name" . }}-use | ||
realmRef: | ||
name: keycloakrealm-cozy | ||
kind: ClusterKeycloakRealm | ||
|
||
--- | ||
|
||
apiVersion: v1.edp.epam.com/v1 | ||
kind: KeycloakRealmGroup | ||
metadata: | ||
name: {{ include "tenant.name" . }}-admin | ||
namespace: {{ include "tenant.name" . }} | ||
spec: | ||
name: {{ include "tenant.name" . }}-admin | ||
realmRef: | ||
name: keycloakrealm-cozy | ||
kind: ClusterKeycloakRealm | ||
|
||
--- | ||
|
||
apiVersion: v1.edp.epam.com/v1 | ||
kind: KeycloakRealmGroup | ||
metadata: | ||
name: {{ include "tenant.name" . }}-super-admin | ||
namespace: {{ include "tenant.name" . }} | ||
spec: | ||
name: {{ include "tenant.name" . }}-super-admin | ||
realmRef: | ||
name: keycloakrealm-cozy | ||
kind: ClusterKeycloakRealm |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,3 +88,143 @@ roleRef: | |
kind: Role | ||
name: {{ include "tenant.name" . }} | ||
apiGroup: rbac.authorization.k8s.io | ||
--- | ||
kind: Role | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: {{ include "tenant.name" . }}-view | ||
namespace: {{ include "tenant.name" . }} | ||
rules: | ||
- apiGroups: ["apps.cozystack.io"] | ||
resources: ["*"] | ||
verbs: ["get", "list", "watch"] | ||
- apiGroups: ["helm.toolkit.fluxcd.io"] | ||
resources: ["helmreleases"] | ||
verbs: ["get", "list", "watch"] | ||
- apiGroups: [""] | ||
resources: ["pods", "pods/log"] | ||
verbs: ["get", "list", "watch"] | ||
--- | ||
kind: RoleBinding | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: {{ include "tenant.name" . }}-view | ||
namespace: {{ include "tenant.name" . }} | ||
subjects: | ||
- kind: Group | ||
name: {{ include "tenant.name" . }}-view | ||
apiGroup: rbac.authorization.k8s.io | ||
roleRef: | ||
kind: Role | ||
name: {{ include "tenant.name" . }}-view | ||
apiGroup: rbac.authorization.k8s.io | ||
--- | ||
kind: Role | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: {{ include "tenant.name" . }}-use | ||
namespace: {{ include "tenant.name" . }} | ||
rules: | ||
- apiGroups: ["apps.cozystack.io"] | ||
resources: ["*"] | ||
verbs: ["get", "list", "watch"] | ||
kvaps marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- apiGroups: ["helm.toolkit.fluxcd.io"] | ||
resources: ["helmreleases"] | ||
verbs: ["get", "list", "watch"] | ||
- apiGroups: [""] | ||
resources: ["pods", "pods/log"] | ||
verbs: ["get", "list", "watch"] | ||
kvaps marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- apiGroups: ["kubevirt.io"] | ||
resources: ["virtualmachines"] | ||
verbs: ["get", "list"] | ||
- apiGroups: ["subresources.kubevirt.io"] | ||
resources: ["virtualmachineinstances/console", "virtualmachineinstances/vnc"] | ||
verbs: ["get", "list"] | ||
kvaps marked this conversation as resolved.
Show resolved
Hide resolved
|
||
--- | ||
kind: RoleBinding | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: {{ include "tenant.name" . }}-use | ||
namespace: {{ include "tenant.name" . }} | ||
subjects: | ||
- kind: Group | ||
name: {{ include "tenant.name" . }}-use | ||
apiGroup: rbac.authorization.k8s.io | ||
roleRef: | ||
kind: Role | ||
name: {{ include "tenant.name" . }}-use | ||
apiGroup: rbac.authorization.k8s.io | ||
--- | ||
kind: Role | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: {{ include "tenant.name" . }}-admin | ||
namespace: {{ include "tenant.name" . }} | ||
rules: | ||
- apiGroups: ["helm.toolkit.fluxcd.io"] | ||
resources: ["helmreleases"] | ||
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"] | ||
- apiGroups: [""] | ||
resources: ["pods/log", "pods"] | ||
verbs: ["get", "list", "watch", "delete"] | ||
kvaps marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- apiGroups: ["kubevirt.io"] | ||
resources: ["virtualmachines"] | ||
verbs: ["get", "list"] | ||
- apiGroups: ["subresources.kubevirt.io"] | ||
resources: ["virtualmachineinstances/console", "virtualmachineinstances/vnc"] | ||
verbs: ["get", "list"] | ||
- apiGroups: ["apps.cozystack.io"] | ||
resources: ["buckets", "clickhouses", "ferretdb", "foos", "httpcaches", "kafkas", "kuberneteses", "mysqls", "natses", "postgreses", "rabbitmqs", "redises", "seaweedfses", "tcpbalancers", "virtualmachines", "vmdisks", "vminstances"] | ||
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"] | ||
|
||
--- | ||
kind: RoleBinding | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: {{ include "tenant.name" . }}-admin | ||
namespace: {{ include "tenant.name" . }} | ||
subjects: | ||
- kind: Group | ||
name: {{ include "tenant.name" . }}-admin | ||
apiGroup: rbac.authorization.k8s.io | ||
roleRef: | ||
kind: Role | ||
name: {{ include "tenant.name" . }}-admin | ||
apiGroup: rbac.authorization.k8s.io | ||
--- | ||
kind: Role | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: {{ include "tenant.name" . }}-super-admin | ||
namespace: {{ include "tenant.name" . }} | ||
rules: | ||
- apiGroups: ["helm.toolkit.fluxcd.io"] | ||
resources: ["helmreleases"] | ||
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"] | ||
- apiGroups: [""] | ||
resources: ["pods/log", "pods"] | ||
verbs: ["get", "list", "watch", "delete"] | ||
Comment on lines
+204
to
+206
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. 🛠️ Refactor suggestion Standardize permissions between related resources Same inconsistency as admin role between pods and virtualmachines permissions. - apiGroups: [""]
resources: ["pods/log", "pods"]
verbs: ["get", "list", "watch", "delete"]
- apiGroups: ["kubevirt.io"]
resources: ["virtualmachines"]
- verbs: ["get", "list"]
+ verbs: ["get", "list", "watch", "delete"] Also applies to: 207-209 |
||
- apiGroups: ["kubevirt.io"] | ||
resources: ["virtualmachines"] | ||
verbs: ["get", "list"] | ||
- apiGroups: ["subresources.kubevirt.io"] | ||
resources: ["virtualmachineinstances/console", "virtualmachineinstances/vnc"] | ||
verbs: ["get", "list"] | ||
- apiGroups: ["apps.cozystack.io"] | ||
resources: ["*"] | ||
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"] | ||
|
||
--- | ||
kind: RoleBinding | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: {{ include "tenant.name" . }}-super-admin | ||
namespace: {{ include "tenant.name" . }} | ||
subjects: | ||
- kind: Group | ||
name: {{ include "tenant.name" . }}-super-admin | ||
apiGroup: rbac.authorization.k8s.io | ||
roleRef: | ||
kind: Role | ||
name: {{ include "tenant.name" . }}-super-admin | ||
apiGroup: rbac.authorization.k8s.io |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
apiVersion: v2 | ||
name: cozy-keycloak-configure | ||
version: 0.0.0 # Placeholder, the actual version will be automatically set during the build process |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
keycloak-operator: | ||
clusterReconciliationEnabled: true |
Oops, something went wrong.
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.
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.
Restrict wildcard access to specific resources
Using
resources: ["*"]
for apps.cozystack.io is overly permissive, even for read-only access. Consider explicitly listing the allowed resources as done in the admin role.📝 Committable suggestion