-
Notifications
You must be signed in to change notification settings - Fork 881
Share coder_app
and ports with groups
#13361
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
Comments
It would be nice if we could access users' groups in Terraform (as a data source?) since customers like to use generalized templates with team-specific options. |
It will be soon be possible to get a user's groups with A good candidate for a feature request for https://github.com/coder/terraform-provider-coder |
@matifali Interesting. I'll open a different issue there since this may impact shared ports as well. Do you envision that enabling this flow? Some conditional to check that the group matches? resource "coder_app" "code-server" {
agent_id = coder_agent.dev.id
slug = "code-server"
...
count = contains(data.coder_workspace_owner.me.groups, "data-sci") ? 1 : 0
share = "authenticated"
} If we could just pass the group name/id to the resource "coder_app" "code-server" {
agent_id = coder_agent.dev.id
slug = "code-server"
...
share = "group"
group = "data-sci" # or group id
} |
@stirby I think a better way would be to be able to set resource "coder_app" "code-server" {
agent_id = coder_agent.dev.id
slug = "code-server"
...
share = "owner|matifali|data-sci|authenticated|public"
} Setting
This is increasing the share level as we move from BONUS: If this can be done from the dashboard share-ports UI too. |
I don't think that kind of string abuse is a good idea. In the Also, we have tended to represent RBAC state in the DB as opposed to in Terraform. There are good reasons to do this consistently, e.g. when a Group is deleted or renamed we don't want Templates to fail. Instead, I propose we add another share-level in between "owner" and "authenticated": "template". When a URL is shared to the "template", anyone that can use the template can also visit the URL. |
|
I was thinking about supporting group/user names/IDs directly but stopped because of this exact collision.
I'm fine with this. Some customers still use general templates across multiple teams. December update: I was wrong. After discussion with multiple customers, I realize that template-per-team is not a typical pattern. For example, devcontainer-centric development may mean only one template for the entire org. |
This comment was marked as outdated.
This comment was marked as outdated.
Just adding a comment: templates-per-team is not how we organize our templates. One template is used by the entire company, and teams are subsets of that. I think of templates as the structure around how you define what a workspace is, and groups as a permission structure. Doing this on the code level is also insufficient. For my use case, what's needed is sharing workspaces to a user or group, as the two entities that represent access control in the Coder app. The workflow should look like this:
|
I would also be interested in this feature |
Currently,
coder_app
s can be shared with either all authenticated users on a deployment or publicly. This allows users to expose services or demo work across teams, but does not provide sufficient RBAC control for most scenarios.Resource separation is team-based in most deployments, and exposing ports widely across the deployment supersedes this isolation pattern. For example, a data science team will want to share Jupyter notebooks with teammates, but not expose the sensitive data to all users. This challenge is especially apparent as customers scale to multiple templates, groups and organizations.
To remedy this, we should add new sharing scope (e.g.
group
,template
,organization
) tocoder_app
s and sharable ports.User-to-user sharing is not in the scope of this work as it further convoludes resource access. For that discussion, see our Shared workspaces thread.
The text was updated successfully, but these errors were encountered: