-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
rfc(feature): Option for organizations to disallow use of user API tokens #68
Draft
mdtro
wants to merge
5
commits into
main
Choose a base branch
from
mdtro/org-user-api-token-options
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.
Draft
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
7aedff2
initial draft for org option to disallow user api tokens
mdtro 75cc2c9
rename file to match PR number
mdtro 805274b
simplified rfc
mdtro f5e3ddb
added note about a future policy system to measure token age
mdtro a16869e
add unanswered question about api application tokens
mdtro 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 |
---|---|---|
@@ -0,0 +1,86 @@ | ||
- Start Date: 2023-01-18 | ||
- RFC Type: feature | ||
- RFC PR: - | ||
- RFC Status: `draft` | ||
|
||
# Summary | ||
|
||
Provide an option to organization owners to disallow all user interaction with | ||
their organization that is using a user API token for authentication. | ||
|
||
# Motivation | ||
|
||
Sentry treats users and organizations as two separate entities. | ||
A user can be a part of multiple organizations. | ||
|
||
An organization may have stricter requirements or a lower risk appetite | ||
compared to a user. We provide options for organizations to require SSO and 2FA | ||
to be enabled on a user account that wishes to interact with their organization. | ||
However, a user can authenticate with a user API token, which inherently | ||
does not require controls like a 2FA prompt. | ||
|
||
As a result, protecting the user API token lies solely on the user. | ||
|
||
Leaking secrets in source control, personal computers infected with malware, or | ||
vendor breaches can lead to these tokens being compromised and exposes | ||
an organization to increased risk. | ||
|
||
If a user API token is leaked, an organization owner has two options: | ||
|
||
1. Coordinate with the user to rotate their API token. | ||
2. Remove the user from their organization. | ||
|
||
An organization owner **cannot** delete another user's API token. | ||
|
||
This also assumes the organization owner is made aware of the leaked token. | ||
Currently, notification would only go to the user who owns the token. | ||
|
||
# Proposed Solution | ||
|
||
Owners should have more control on how user API tokens | ||
interact with their organization. | ||
|
||
In the majority of cases organization owners have requested the ability | ||
to disallow interaction with their organization via a user API | ||
token completely. These organizations typically follow our recommended | ||
practice of using a custom integration for automation tasks. | ||
|
||
**I'm proposing we add a toggle option under the organization settings | ||
to disallow usage of user API tokens for authentication to their organization.** | ||
|
||
## Pros | ||
|
||
- Solves the concern for the majority of customers who are concerned about | ||
user API tokens | ||
- Relatively simple implementation | ||
|
||
## Cons | ||
|
||
- Organization owners do not have a way to determine if | ||
their users are using personal API tokens | ||
- An organization upon enabling this may find some of their automation | ||
or integrations broken | ||
|
||
# Supporting Data | ||
|
||
Secret or API token leaks are commonplace: | ||
|
||
- [CircleCI's recent breach (Jan 2023)](https://circleci.com/blog/jan-4-2023-incident-report/) | ||
- [Heroku and TravisCI token leaks](https://github.blog/2022-04-15-security-alert-stolen-oauth-user-tokens/) | ||
|
||
# Related Work | ||
|
||
- [Improved API Tokens](https://github.com/getsentry/rfcs/pull/32) | ||
|
||
# Potential Future Work | ||
|
||
- Allow organizations to require an SSO flow to authorize a user token before use. | ||
- Instead of a simple on/off toggle, we could create a more complex _policy_ system | ||
allowing user API tokens to be used for certain scopes within an org, meet | ||
required maximum lifetimes, etc. | ||
|
||
# Unanswered Questions | ||
|
||
- How do we account for API application tokens? | ||
- Should they still be allowed? | ||
- What about those that are created in the backend by using integrations? |
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.
Is this a setting that we would enable by default for new orgs?