GitLab
Follow
Rotate a leaked GitLab token and let GitLab Duo fix the code
GitLab secret detection alerts users to exposed Personal Access Tokens (PATs) on their default branch. Previously, remediating these exposed tokens was a complex, manual process that often led to pipeline disruptions or insecure practices. Manual fixes required identifying the token owner, revoking the token, generating a secure replacement, storing it properly, and updating all affected scripts and CI/CD jobs. This tedious process frequently resulted in leaked tokens remaining active for extended periods or fixes being implemented insecurely.GitLab 19.6 introduces a beta feature for GitLab Ultimate users to directly remediate leaked GitLab PATs from the vulnerability page. By selecting "Rotate and fix," GitLab automatically revokes the compromised token and creates a secure replacement. This new token is stored in GitLab Secrets Manager, ensuring it's accessible across different environments. Additionally, the GitLab Duo Agent Platform is utilized to open a merge request that updates CI/CD jobs to use the new secret.The merge request allows for a review of the changes before merging, completing the remediation process. Crucially, the new token's value is never exposed to the user or the agents, enhancing security. This integrated approach, combining secret detection, Secrets Manager, and the Duo Agent Platform, effectively closes the gap between detecting a leak and securely resolving it. The "Rotate and fix" function streamlines this process, preventing the prolonged exposure of sensitive credentials. The feature is available for GitLab Ultimate users and supports GitLab PATs, with plans to expand to other secret types. Automation tools are also available to batch-rotate tokens across entire groups.