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

DXCDT-335: Store access token in OS keyring #645

Merged
merged 2 commits into from
Feb 13, 2023

Conversation

willvedd
Copy link
Contributor

@willvedd willvedd commented Feb 9, 2023

🔧 Changes

Up until now, the Auth0 access token was stored in a local JSON config file. While the token is short-lived, it does possess a wide range of scopes and could be problematic if exposed. A theoretical attack vector could be a malicious package/process traversing a filesystem in hopes of finding an Auth0 CLI configuration file with a valid access token.

Similarly to other secrets in the Auth0 CLI, it is propsed to store the access token in the OS keyring. However, there are OS-specific size limits that we need to be aware of. In order to integrate nicely across all platforms, we are sharding the access token across a number of separate secrets in the keyring.

Not all OSs have a keyring installed by default, notably bare linux distros. In these cases, we continue to write the access token to the local configuration file directly. Presumably, these cases would most likely occur in CI or automated jobs where the process is short-lived and token discarded shortly after use.

Notably, the Github CLI stores their Oauth tokens in a local JSON configuration file much like the current implementation. However, the community has an outstanding request to store in the keyring, much like this PR is attempting to accomplish.

📚 References

🔬 Testing

  • Several sets of unit tests added to cover numerous situations
  • E2E tests passing in CI (no keyring enabled)
  • E2E tests pass locally (keyring enabled)
  • General manual testing with first-class command and api invocations

📝 Checklist

  • All new/changed/fixed functionality is covered by tests (or N/A)
  • I have added documentation for all new/changed functionality (or N/A)

@willvedd willvedd marked this pull request as ready for review February 10, 2023 19:05
@willvedd willvedd requested a review from a team as a code owner February 10, 2023 19:05
@sergiught sergiught force-pushed the DXCDT-335-store-access-token-keyring branch from a5940f6 to ac25ef7 Compare February 13, 2023 16:30
@willvedd
Copy link
Contributor Author

🎉

@willvedd willvedd merged commit 686a9c0 into main Feb 13, 2023
@willvedd willvedd deleted the DXCDT-335-store-access-token-keyring branch February 13, 2023 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants