Skip to content

API Key/Token scopes to prevent creating another api key/token #8011

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

Closed
Emyrk opened this issue Jun 13, 2023 · 2 comments
Closed

API Key/Token scopes to prevent creating another api key/token #8011

Emyrk opened this issue Jun 13, 2023 · 2 comments
Labels
enterprise Enterprise-license / premium functionality stale This issue is like stale bread.

Comments

@Emyrk
Copy link
Member

Emyrk commented Jun 13, 2023

Currently the only supported scopes are ScopeAll and ScopeApplicationConnect. With the addition of this issue: #7657, we might want to add a new scope that prevents creating new apikeys/tokens.

This is so an admin can make a token for a user, and that user cannot extend create additional api keys from that. This is just to add control options in the more "headless" usage of coder.

@ammario
Copy link
Member

ammario commented Jun 13, 2023

How do you envision scoping to work in the long-term? Think, one year out? Our auth layer is pretty complex and has been difficult for others to debug, so I think it's worth thinking long-term about adding new features and hopefully simplifying the code on the way.

@Emyrk
Copy link
Member Author

Emyrk commented Aug 21, 2023

If we stay with a system of declarative permissions, then scopes will continue to work.

If we move to a new rbac/authz, we will have to convert any of the declarative scopes. I cannot imagine it being too difficult.

The way we enforce scopes now is to just run both the user's perms and the scope's perms through authz. If any return "false" (unauthorized), we reject the call. To be efficient though we do both of this in a single pass.

It's hard to be predictive of what a different authz system can be though.

@github-actions github-actions bot added the stale This issue is like stale bread. label Feb 18, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enterprise Enterprise-license / premium functionality stale This issue is like stale bread.
Projects
None yet
Development

No branches or pull requests

2 participants