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

[Request] Multitenant RBAC #630

Open
grzesuav opened this issue Aug 30, 2024 · 6 comments
Open

[Request] Multitenant RBAC #630

grzesuav opened this issue Aug 30, 2024 · 6 comments
Labels
feat New feature or request

Comments

@grzesuav
Copy link

Describe the feature

According to https://github.com/cryostatio/cryostat-operator/blob/cryostat-v3.0/config/crd/bases/operator.cryostat.io_cryostats.yaml#L4887 feature,

he SubjectAccessReview or TokenAccessReview that all clients (users visiting the application via web browser as well
                          as CLI utilities and other programs presenting Bearer auth tokens) must pass in order to access the application.
                          If not specified, the default role required is "create pods/exec" in the Cryostat application's installation namespace.

what we usually need is to have permission per target namespace, not cryostat namespace

Anything other information?

Related discussion - #622 (comment)

@grzesuav grzesuav added feat New feature or request needs-triage Needs thorough attention from code reviewers labels Aug 30, 2024
@andrewazores
Copy link
Member

The current solution to this problem is to create separate Cryostat instances for each team (installation namespace). Solving this so that a single Cryostat instance can be configured to enforce RBAC across different teams/namespaces and keep their data separate from each other would require quite a large API redesign and rearchitecture of the auth proxy system, so it's unlikely this will be done any time soon.

@andrewazores andrewazores changed the title [Request] Better user mapping with RBAC [Request] Multitenant RBAC Aug 30, 2024
@andrewazores andrewazores removed the needs-triage Needs thorough attention from code reviewers label Aug 30, 2024
@grzesuav
Copy link
Author

Got it, however separate cryostat instance per team is difficult to set up - we need to expose public address via our infra so it would require to have a lot of addresses (cryostat-teamA. xxx) - having that somehow handled in cryostat -like pluggable way to chime in, to add validation if given user can do start/stop recording would be desired.

It would be good to have some design doc which could be idea-proofed against different use case - in mid/large scale companies it would be a must

@andrewazores
Copy link
Member

This would go back to the original discussion and abandoned implementation from the old codebase: cryostatio/cryostat-legacy#1409

This becomes difficult because it means that Cryostat has to somehow determine the origin of the JFR data and tag that data with the origin at the time that the data is persisted to storage, or written to database. Then later on read, it must perform the RBAC check for the requesting user against that data. This isn't hard conceptually, but it does get complicated with the realities of trying to ensure that data is fully segregated in the S3 object storage, for example, and it means that the Cryostat application needs to be aware of the RBAC system - it is not aware of this at all anymore in 3.0, relying entirely on the auth proxy instead.

Then the next difficulty comes in making this whole system generic enough that it can be disabled or removed seamlessly, so that Cryostat remains usable for non-Kubernetes use cases, like Podman or Docker (Swarm).

So I'd really love to implement something like that, but it's seriously a large amount of design and work, and I don't think our team is going to have the bandwidth to work on this. But I would gladly participate in any community-driven design discussions and would very happily review and accept PRs.

@grzesuav
Copy link
Author

grzesuav commented Sep 2, 2024

From my perspective it is not much about data access as rather an application access- I doubt our application owner would be happy if someone else would start recording and have some unwanted performance overhead

@andrewazores
Copy link
Member

I understand your point, but at the same time I don't think we can design and release some feature that only provides additional access controls for application access and not for accessing the associated data. Otherwise, unauthorized users may not be able to start recordings on your containers and incur some performance overhead, but they would be able to download JFR files from those containers or from the Cryostat Archives, and those JFR files may contain sensitive information - either from custom JFR events, or even because JFR events can capture environment variables and therefore may capture deployment secrets like database keys. So if we do anything here to add additional layers of access controls and concepts of user groups and group ownership, it must be designed to fully cover everything, or else it's a serious footgun for the end user.

@grzesuav
Copy link
Author

grzesuav commented Sep 5, 2024

got it ! Thanks for explaining, for sure it is bigger topic than I had in mind

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants