Skip to content

Token prefixes: Runner Authentication Tokens

What does this MR do and why?

Adds support for instance wide token prefixes for runner authentication tokens.

Instance wide token prefix have been added with !179852 (merged)

The new prefix format is: #{instance_prefix}#{token_type_prefix}. E.g. for runner authentication tokens, we'd get: #{instance_prefix}glrt-. By default, the prefix is empty. However, we can now customize the instance prefix to create a new prefix: mycompanyname-glrt-.

With this custom prefix, it is easier to identify leaked tokens, because we can now skip all leaked tokens that start with glrt. Now, we only need to look at tokens starting with mycompanyname-glrt-.

🛠️ with ❤️ at Siemens

References

Issue: #388379

How to set up and validate locally

  1. Enable feature flag via rails c:
Feature.enable(:custom_prefix_for_all_token_types)
  1. Create a new runner. You should now see a token without an instance wide prefix.
  2. Now, change the instance wide token prefix: Admin area > General > Account and limit > Instance token prefix, e.g. to mycustomprefix
  3. When you create another runner, you should now see that the prefix starts with mycustomprefix- before glrt.
  4. When you have a look at the list of runners, you should see that short_sha does not include the mycustomprefix-glrt part.

MR acceptance checklist

MR Checklist ( @nwittstruck)

Related to #388379

Edited by Nicholas Wittstruck

Merge request reports

Loading