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

feat(security): create reduced permissions ServiceAccount for Cryostat #229

Merged
merged 1 commit into from Aug 9, 2021

Conversation

ebaron
Copy link
Member

@ebaron ebaron commented Aug 9, 2021

Currently, the operator configures the Cryostat deployment to use the operator's own Service Account. The vast majority of the permissions the operator requires are not needed by Cryostat. This PR creates a separate set of RBAC objects for Cryostat to use.

The operator creates an additional ClusterRole with permissions to create TokenReviews and SelfSubjectAccessReviews.

Each Cryostat CR gets its own:

  • ServiceAccount
  • Role, with read access to Endpoints and Routes
  • RoleBinding to bind the Role to its ServiceAccount
  • ClusterRoleBinding to bind the shared ClusterRole to its ServiceAccount

In order to ensure that the cluster-scoped ClusterRoleBinding doesn't suffer a name collision, the operator creates it with the following name: cryostat-hhhh where hhhh is SHA256 sum of the CR's namespace/name. Since this is cluster-scoped, the binding can't be owned by the Cryostat CR and thus can't be garbage collected. Instead, it's deleted using the existing finalizer logic in the Cryostat controller.

Fixes: #221
Depends on: cryostatio/cryostat#599

@ebaron ebaron merged commit deb0ee1 into cryostatio:main Aug 9, 2021
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.

Create RBAC with reduced permissions for Cryostat deployment
2 participants