Rotating Gitlab's Service Account tokens with specified expiry

47 Views Asked by At

I am currently using a Gitlab service account with its token and I want to set up a CICD job that automates the rotation of the service account tokens.

However from the documenation, it seems there isn't a field where I can set the expiry date of the rotated tokens unlike the user's personal access token rotation api.

Trying it out and rotating service account tokens only gives it a 7 duration.

I would like to know if its possible to set an expiry for service account tokens' rotation.

If not, I would have to use Gitlab's scheduler to rotate the tokens every 6-7 days. Another method i could think of its to revoke and create the service account tokens manually and set the job to run every x months. (this way, i could control the "expiry" per say)

Would love to hear everyone's suggestions on this issue.

0

There are 0 best solutions below