Skip to content

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

yaml
permissions: {contents: read}

Corrected example

yaml
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

bash
GH_TOKEN="$GITHUB_TOKEN" gh workflow run ci.yml --repo "$TARGET_REPO"

Corrected example

bash
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

yaml
permissions: {contents: read}

Corrected example

yaml
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

yaml
role-to-assume: arn:aws:iam::000000000000:role/unrelated

Corrected example

yaml
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

yaml
pull_request: {}

Corrected example

yaml
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

bash
docker login "$REGISTRY" --password-stdin < token.txt

Corrected example

bash
printf '%s' "${REGISTRY_TOKEN:?}" | docker login "${REGISTRY:?}" -u "${REGISTRY_USER:?}" --password-stdin

Verification. 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

bash
ssh deploy@"$HOST" true

Corrected example

bash
ssh -o StrictHostKeyChecking=yes -o UserKnownHostsFile=ci/known_hosts deploy@"$HOST" true

Verification. 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

bash
kubectl -n staging set image deployment/web web="$IMAGE"

Corrected example

bash
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

bash
set -x
deploy --token "$DEPLOY_TOKEN"

Corrected example

bash
set +x
DEPLOY_TOKEN="${DEPLOY_TOKEN:?}" ./ci/deploy-from-env.sh

Verification. 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

yaml
permissions: {}
jobs:
  verify:
    runs-on: ubuntu-latest
    steps: [{uses: actions/checkout@v4}]

Corrected example

yaml
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.