Initial setup
For the initial setup we will
- discover existing access tokens of a GitLab instance.
- configure and run
tocli, the token-operator CLI.
Discovering existing tokens
To discover all existing tokens of a GitLab instance, we provide a small shell script that can also be modified easily. The output is compatible with token-operator and can be used to define your configuration.
If you use an access token of an account with admin permissions, the script will also list all tokens of users.
Downloading token-operator
For releases and binaries, please refer to https://gitlab.com/sickit/token-operator/-/releases
Running token-operator in a container
You can also run token-operator CLI in a container:
Configuring token-operator self-rotating GitLab access token
For the initial setup, we will use the GitLab access token you will create below and rotate itself.
It will be stored in a vault named tocli-setup as item tocli-pat, or adjust the vault attributes below to your needs.
Create the file tocli-initial-setup.yaml with the following contents:
Running token-operator with 1Password vault
Prerequisites
- Create a personal access token in GitLab with scopes
apifor the token-operator calledtocli-pat. The person creating the PAT must have permissions to edit access tokens that are in the configuration. - Create a 1Password service account with read/write access to the vault where you want to store your GitLab tokens.
Running token-operator with HashiCorp Vault (Enterprise version)
Prerequisites
- Create a personal access token in GitLab with scopes
apifor the token-operator calledtocli-pat. The person creating the PAT must have permissions to edit access tokens that are in the configuration. - Provide
--vault.type hashicorpand--vault.urlto a HashiCorp Vault instances along with the--vault.tokenthat has permissions to create and update vault items in the configuration. - Add
licenseto the config or use--licenseon the command line to provide an Enterprise license key.
For an Enterprise license key, please contact us at toop@sickit.eu.
Example output
Here is an example console output with --log.format console or LOG_FORMAT=console: