icon

Replace long-lived deployment secrets with workload identity

Security editorial team
Replace long-lived deployment secrets with workload identity
  • Author:
  • Sunny Security Labs

    Security editorial team

A deployment credential stored in continuous integration may outlive the workflow that created it and remain valid in copied jobs or retired projects. Workload identity lets a supported CI platform exchange a signed identity assertion for short-lived cloud credentials. The cloud trust rule becomes the control that decides which jobs receive access.

Decide which job can deploy

Create a role for a specific environment and restrict its permissions to the resources it needs. Configure trust using the issuer, expected audience and appropriately constrained subject or other claims supported by your platform. Connect production access to approved repositories, branches, workflows or protected environments as appropriate. Review how workflows triggered by forks, reusable jobs and manual runs are represented in those claims.

Roll out with visibility

Begin with a nonproduction environment and preserve the existing deployment path during the pilot. Check an approved job and an ordinary job that should receive no deployment access. Confirm that cloud audit events show enough context to connect a granted credential to the particular workflow run. Keep the token exchange and credential values out of verbose logs. Repeat the process for each target environment and document the role owner.

Retire the old credential

After confirming that scheduled and emergency deployment paths work through the new role, revoke the static credential and remove it from CI settings and secret stores. Search your authorized configuration inventory for duplicate references. Schedule a short review when the repository name, branch rules or workflow ownership changes. The same identity control should remain understandable to the person who takes over the release pipeline. Make any audit lookup instructions available from the deployment runbook.

Sources

Request a quote
Book a consultation