Verify authority and provenance before deployment
Constrain workflow inputs and dependencies, obtain short-lived cloud credentials and verify the identity behind a release artifact.
A signed binary from the wrong builder
A distribution archive verifies cryptographically, but its attestation names a different repository. Production expects the release workflow in the product repository. What should the deployment do?
Work through the decision
Check the archive digest and verify the identity of the source and build workflow against the release policy. Reject the promotion if identity differs. A valid signature can establish who made the statement while leaving the artifact outside the approved release path.
Gate a deployment on its environment
A job declares the environment it intends to deploy to. Configure required reviewers, allowed branches or tags and other rules on that environment as supported by the plan. The environment's secrets become available to the job after the protection rules pass.
Evaluate an action as a dependency
Inspect the publisher, source at the chosen revision, dependency chain, required permissions and release history. A verified publisher label is one signal. Review what the action will receive and how closely its implementation matches the job's need.
Treat event text as input data
A pull request title or comment is user-controlled. Pass such data through a defined input or environment variable and quote it appropriately in the shell. Validate expected forms and give jobs only necessary rights. Avoid rendering an event field directly into an executable command.
Limit the built-in token
GITHUB_TOKEN is issued for the job and scoped to the repository subject to effective permissions. Set minimal defaults and elevate only the job that needs more. A personal access token follows its owner's grants and lifetime. Use a deliberately scoped alternative when the built-in token cannot meet a cross-repository need.
Federate a workload identity
Configure cloud trust for the intended issuer, audience and subject, such as a particular repository and protected environment. A job with id-token: write can request an OIDC token and exchange it for temporary cloud credentials. Cloud-side policy determines the resulting role.
Pin the dependency that actually runs
A full-length commit SHA fixes a repository action reference to a specific revision. Treat tags, including major versions, as movable unless a specific immutability guarantee covers them. Check publisher and commit provenance before updating the pin.
Enforce action use policy
Restrict permitted action owners or references through organization and repository settings within enterprise limits. Use review rules for changes to workflow files and a documented path for exceptions. A reviewer requirement on deployment is separate from checking which dependency is allowed to execute.
Verify what was built
An artifact attestation binds a digest to information about its build, such as its originating workflow and repository. Generate provenance for the output and verify the artifact against the expected identity before deployment. An attestation does not establish that the source code is free of defects.
A role that only production may assume
An organization wants cloud deploys with no permanent key in CI. A fork PR can run tests, but only an approved release may assume the production role. Which controls must agree?
Check your reasoning
Keep PR validation read-only. Give the deployment job id-token: write, require the protected environment, and configure the cloud trust policy to match the expected issuer, audience and repository or environment subject. The cloud role grants only the release operation. Review and pin production actions separately.
Check the bytes and the claimed builder
Use Python 3 to model the two decisions that follow signature verification. The local model uses an assumed verified identity and does not itself verify an attestation.
from hashlib import sha256
approved = sha256(b"release v1").digest()
def accept(content, verified_builder):
return sha256(content).digest() == approved and verified_builder == "org/release"
print(accept(b"release v1", "org/release"))
print(accept(b"release v2", "org/release"))
print(accept(b"release v1", "other/build"))
Expected output and interpretation
True
False
FalseA matching digest alone accepts the wrong producer. A matching builder alone accepts changed bytes. In production, verify the signed provenance before applying either policy check.
GitHub documentation · GH-200 skills outline
Continue in GitHub Foundations. Separate identity, read access and merge authority.
Verify authority and provenance before deployment quiz
Answer 8 questions. Check each answer for an explanation.