Credentials and permissions
Encyclopedia home · Search machine-readable catalog
The broken snippets are deliberate negative examples. Use only in an isolated fixture repository or lab.
F063
Read-only release job cannot push package
Symptom. denied: permission_denied: write_package.
Root cause. Publish requires the registry's package write permission.
Broken example
permissions: {contents: read}Corrected example
permissions: {contents: read, packages: write}Verification. Use an approved protected release job and confirm intended package ownership.
Correction validation syntax-validated.
F064
Cross-repository API call uses default token
Symptom. HTTP 403 or 404.
Root cause. GitHub default token generally targets current repo.
Broken example
GH_TOKEN="$GITHUB_TOKEN" gh workflow run ci.yml --repo "$TARGET_REPO"Corrected example
GH_TOKEN="${APP_INSTALLATION_TOKEN:?}" gh workflow run ci.yml --repo "${TARGET_REPO:?}"Verification. Use scoped GitHub App token allowing dispatch in the target.
Correction validation syntax-validated.
F065
OIDC token permission absent
Symptom. unable to request OIDC token.
Root cause. Workflow cannot request OIDC token without permission.
Broken example
permissions: {contents: read}Corrected example
permissions: {contents: read, id-token: write}Verification. Verify protected claims and cloud role trust before calling provider.
Correction validation syntax-validated.
F066
Cloud role subject mismatch
Symptom. Not authorized to perform sts:AssumeRoleWithWebIdentity.
Root cause. Role trust policy doesn't match repo/environment subject.
Broken example
role-to-assume: arn:aws:iam::000000000000:role/unrelatedCorrected example
role-to-assume: ${{ vars.STAGING_DEPLOY_ROLE }}Verification. Compare exact intended issuer, audience and subject to reviewed IAM conditions.
Correction validation syntax-validated.
F067
CI expects secret in fork PR
Symptom. auth token is empty on fork.
Root cause. Fork runs cannot access normal private secrets.
Broken example
pull_request: {}Corrected example
pull_request: {}
push: {branches: [main]}Verification. Run a separate privileged job only on a trusted push and test fork path without secrets.
Correction validation syntax-validated.
F068
Docker login receives blank username
Symptom. Cannot perform an interactive login.
Root cause. Registry auth needs nonempty user and scoped secret.
Broken example
docker login "$REGISTRY" --password-stdin < token.txtCorrected example
printf '%s' "${REGISTRY_TOKEN:?}" | docker login "${REGISTRY:?}" -u "${REGISTRY_USER:?}" --password-stdinVerification. Check inputs exist without printing token.
Correction validation syntax-validated.
F069
SSH server fingerprint not provisioned
Symptom. Host key verification failed.
Root cause. Trusted host keys missing.
Broken example
ssh deploy@"$HOST" trueCorrected example
ssh -o StrictHostKeyChecking=yes -o UserKnownHostsFile=ci/known_hosts deploy@"$HOST" trueVerification. Confirm reviewed fingerprint via an independent trusted source.
Correction validation syntax-validated.
F070
Kubernetes identity lacks deployment patch
Symptom. deployments.apps is forbidden.
Root cause. RBAC permits reads but not patch.
Broken example
kubectl -n staging set image deployment/web web="$IMAGE"Corrected example
kubectl auth can-i patch deployments -n staging | grep -Fx yes
kubectl -n staging set image deployment/web web="$IMAGE"Verification. Bind the namespace-specific reviewed Role and recheck effective permissions.
Correction validation syntax-validated.
F071
Credential accidentally included in logs
Symptom. protected input visible or masked unexpectedly.
Root cause. Shell tracing expands secrets into logs.
Broken example
set -x
deploy --token "$DEPLOY_TOKEN"Corrected example
set +x
DEPLOY_TOKEN="${DEPLOY_TOKEN:?}" ./ci/deploy-from-env.shVerification. Revoke affected tokens and verify test logs contain no synthetic secret.
Correction validation syntax-validated.
F072
Permission granted at incorrect scope
Symptom. checkout can't clone private repository.
Root cause. Workflow defaults disable repository read.
Broken example
permissions: {}
jobs:
verify:
runs-on: ubuntu-latest
steps: [{uses: actions/checkout@v4}]Corrected example
permissions: {}
jobs:
verify:
permissions: {contents: read}
runs-on: ubuntu-latest
steps: [{uses: actions/checkout@v4}]Verification. Grant only job-level contents read and verify succeeds.
Correction validation syntax-validated.