pipeline.access.scoped-to-need
Automated delivery acts with the narrowest access the task needs
A pipeline job holds only the permissions its task requires, for only as long as the task runs, so a compromised or misused run cannot reach beyond its purpose.
Assertion
for every pipeline job j: the identity j assumes grants only the permissions j's task requires, and that identity is scoped to j rather than shared and standingRationale
The expectation is that an automated run can do what its task needs and no more. A pipeline is a tempting target precisely because it holds the keys to change real systems, and a job that carries broad, standing access turns any compromise of that job — a malicious dependency, an injected command, a leaked token — into access across everything the job could ever touch. Scoping the access to the task bounds the blast radius: the worst a misused run can do is the thing it was allowed to do anyway.
This is least privilege stated as an expectation, not a rule that names a single mechanism. The responsibility is to keep the grant close to the need in both breadth and time; how that grant is issued is the team’s to decide.
Observation
The expectation combines capabilities that narrow access along two axes:
- short-lived credentials, assumed at run time and expiring with the job,
so there is no standing key to steal or to outlive the person who made it
(the companion control
pipeline.deploy.no-long-lived-cloud-keysasserts exactly this for deployments); - scoped identity, bound to the repository, branch, or job that uses it rather than shared across a fleet, so a grant cannot be borrowed sideways; and
- task-shaped permissions, a role whose policy matches what the job does, reviewed when the job’s work changes rather than widened to make a failure go away.
A suitable check reads the identity a job assumes and the permissions it carries and confirms that the grant is scoped to the job and no broader than its task. The catalog does not prescribe a federation mechanism or a policy language; the property — narrow in scope, short in life — is the same wherever the job runs.
This control is planned. The expectation is defined and reviewed; no collector is reading pipeline identities and their grants yet.
Remediation
Have jobs assume a role at run time through the forge’s identity provider rather than hold a stored key, bind that role’s trust to the specific job that uses it, and shape its policy to the task. When a job’s work grows, widen the policy as a reviewed change, and when a job is retired, retire its role with it. Widening a grant to clear a permission error, and leaving it widened, is the drift this expectation is meant to catch.