Skip to content

Commit cbc9656

Browse files
committed
include feedback from review and add suffix to the token
1 parent ae26216 commit cbc9656

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

text/0032-improved-api-tokens.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Improve on Sentry's API token implementation to a more secure pattern. We will h
3333
1. Using hashed values in the database
3434
2. Only display the token once to the end user upon creation
3535
3. Allow users to _name_ the tokens ([#9600](https://github.com/getsentry/sentry/issues/9600))
36-
4. Use a predictable prefix to integrate with various secret scanning services (ex. Github's Secret Scanning)
36+
4. Use a predictable prefix and suffix to integrate with various secret scanning services (ex. Github's Secret Scanning)
3737

3838
# Motivation
3939

@@ -60,7 +60,7 @@ A notice in the Sentry UI should be presented to suggest the user rotate and gen
6060

6161
We need a predictable token format in order to integrate properly with secret scanning services. Our current format is a 64 character alphanumeric string. This is insufficient and would likely produce a high amount of false positives in tooling like [TruffleHog](https://github.com/trufflesecurity/trufflehog), [detect-secrets](https://github.com/Yelp/detect-secrets), [Github's Secret Scanning](https://docs.github.com/en/code-security/secret-scanning/about-secret-scanning), etc.
6262

63-
The suggested pattern is `snty[a-zA-Z]_[a-zA-Z0-9]{64}`. The character _after_ `snty` will be used to identify the token type.
63+
The suggested pattern is `snty[a-zA-Z]_[a-zA-Z0-9]{64}io`. The character _after_ `snty` will be used to identify the token type.
6464

6565
For example:
6666

@@ -133,12 +133,12 @@ Instead of slowly generating the hashed token values over time of the legacy tok
133133

134134
## Option #3
135135

136-
To avoid the two different token versions, we could automatically prepend the prefix `sntyx_` (with `x` just being a placeholder here). We would then follow a similar approach to Option #1 or Option #2 to generate the hashed values.
136+
To avoid the two different token versions, we could automatically prepend the prefix `sntyx_` (with `x` just being a placeholder here) and suffix `io`. We would then follow a similar approach to Option #1 or Option #2 to generate the hashed values.
137137

138138
### Drawbacks
139139

140-
- Users would not be able to benefit from the Github Secrets Scanning since they would still be using their 64 character alphanumeric string without the prefix.
141-
- Authentication views/logic would become more complex with branching code to handle the with and without prefix cases.
140+
- Users would not be able to benefit from the Github Secrets Scanning since they would still be using their 64 character alphanumeric string without the prefix and suffix.
141+
- Authentication views/logic would become more complex with branching code to handle the with and without prefix + suffix cases.
142142

143143
# Unresolved questions
144144

0 commit comments

Comments
 (0)