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

Security: can set array of auth tokens #417

Merged
merged 2 commits into from
Apr 17, 2023
Merged

Conversation

AgnesToulet
Copy link
Contributor

To rotate authentication tokens in a distributed environment, updating the renderer token means breaking the rendering features in Grafana until the Grafana instances are updated with the right token.

Allowing to set up an array of authentication tokens allows to rotate tokens without downtime.

Notes:

  • In environment variables, tokens can be set as space delimited strings (as tokens could contain commas).
  • Still support setting the auth token as a string to not introduce a breaking change.

@AgnesToulet AgnesToulet added the type/enhancement New feature or request label Apr 14, 2023
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding this back as I'm not sure why it was deleted as it's still used in the Makefile.

Copy link

@undef1nd undef1nd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tested by setting an array of tokens in the renderer's config file, as well as via AUTH_TOKEN env var, and running renderer as a service. Have not noticed any issues. Would be great if someone could test it as a plugin.

src/config.ts Outdated Show resolved Hide resolved
Copy link
Member

@spinillos spinillos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested by HTTP and Plugin and its working well

Co-authored-by: Selene <selenepinillos@gmail.com>
@AgnesToulet AgnesToulet merged commit d6741ee into master Apr 17, 2023
@AgnesToulet AgnesToulet deleted the auth-token-array branch April 17, 2023 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants