A Source-Control Breach Should Not Grant Production API Authority
December 1, 2026
Source control is where software changes begin. It should not be the credential that authorizes every later action in production.
That boundary became urgent after 1Password's November 25 security-incident update, which drew more than 1,700 points in the Hacker News discussion. The company reported that an attacker accessed an employee's corporate GitHub account, copied private source, pushed malicious code to backend services, reached CI/CD, and obtained limited customer account information. It also reported that customer vault contents and their protecting keys were not affected, that it had implemented containment measures and restored clean versions of the affected service, and that potentially exposed internal credentials were being rotated.
The root-cause analysis was still pending when this article was written. The incident therefore should not be used to guess the initial access method or claim which missing control would have prevented it. It does provide a concrete architecture question: how many independent trust decisions must succeed between a source change and sensitive API access?
Key Takeaways
- Repository, build, deployment, runtime, and gateway-control identities should be separate principals with different permissions and revocation paths.
- A protected branch is important, but a valid repository event does not prove that the resulting artifact is safe.
- Short-lived CI credentials reduce secret exposure; their trust policy still needs the narrowest provider-supported combination of issuer, audience, repository/workflow, environment, and event context.
- Signed provenance helps a deployer verify where an artifact came from. It does not prove that the source logic is benign.
- Runtime API policy can reduce blast radius only for traffic that traverses the controlled gateway path.
Model Five Identities, Not One Pipeline
A diagram labeled “GitHub Actions deploys production” often hides several authorities:
| Identity | Legitimate job | Permission that should not come with it |
|---|---|---|
| Repository identity | Propose or approve a source change | Read production data or edit every deployment environment |
| Build identity | Read pinned source and produce an artifact plus evidence | Deploy arbitrary artifacts or change runtime policy |
| Deployment identity | Promote an approved digest into one environment | Rebuild source, mint broad runtime credentials, or administer unrelated services |
| Runtime workload identity | Call the APIs required by one deployed service | Change its own gateway policy or call administrative APIs |
| Gateway-control identity | Create routes, credentials, and policy under an owned scope | Run as the application or bypass deployment approval |
These identities can use one platform, but they should not collapse into one long-lived token. Compromising a repository account may allow a malicious change. Reaching the build system may expose another set of capabilities. Neither event should automatically grant an application permission to query every customer API or let a deployment job rewrite organization-wide gateway policy.
The separation also improves incident response. Security teams can freeze repository actions, disable one workload identity, rotate a gateway credential, or stop one deployment environment without replacing every secret at once.
Bind CI Credentials to the Job Context
Long-lived cloud keys stored in CI turn a workflow compromise into reusable authority. GitHub Actions supports OpenID Connect token exchange, allowing a job to request a short-lived token and exchange it with a cloud provider. The provider's trust policy can check claims such as repository, workflow context, event, audience, branch, tag, or environment.
Use the narrowest context the provider supports. A production role might accept only the expected issuer and audience, one repository, one reusable workflow at a pinned revision, and the production environment. GitHub recommends environment protection rules when environments participate in OIDC policy. Its deployment-environment documentation also supports branch/tag restrictions, reviewers, and controls that prevent bypassing protection rules.
OIDC changes credential delivery; it does not decide whether code is trustworthy. A malicious workflow that satisfies an overly broad subject policy can still obtain a valid short-lived token. Conversely, a safe artifact can be blocked by a misconfigured trust policy. Test positive and negative cases:
- approved workflow, repository, branch, and environment;
- pull-request or fork context attempting production access;
- renamed or unpinned reusable workflow;
- unexpected event type or audience;
- expired token and revoked environment approval.
Record why each case was allowed or denied. Treat a caller-controlled label or a matching repository name as one condition, not proof of intent.
Verify the Artifact at the Deployment Boundary
The next trust decision is what gets deployed. NIST SP 800-204D recommends an isolated build platform, enforced build policies, and concurrent generation of attestation evidence. This separates “someone pushed code” from “an approved build system produced this exact artifact under the expected process.”
An attestation can bind an artifact digest to source revision, repository, workflow, builder, and other build context. GitHub's artifact-attestation documentation describes provenance that includes the repository, organization, environment, commit SHA, and triggering event. Verify the immutable digest rather than re-resolving a mutable tag during deployment.
Admission policy can make that evidence actionable. Sigstore's Kubernetes policy-controller can validate signatures and attestations for container images and resolve tags at admission. Its enforcement is namespace-scoped and opt-in by default, so installing the controller alone does not mean every workload is protected.
Keep the non-claim explicit: provenance establishes an artifact's origin and process evidence. It does not prove that reviewed source is non-malicious, that tests cover every behavior, or that a compromised but authorized builder cannot sign a bad artifact. Required review, isolated builds, attestations, admission policy, and runtime limits cover different failure modes.
Keep Deployment and Runtime API Authority Separate
A deployment job needs enough permission to promote an approved artifact and update the intended workload. It usually does not need a database administrator token, a gateway super-admin key, or the runtime credential that the service will present to downstream APIs.
Prefer a secret or workload-identity system that delivers runtime authority to the running workload after deployment. Give each service identity a narrow audience, short lifetime, and explicit route/method permissions. Do not reuse one shared API key across CI, canaries, production, and emergency scripts. API7's gateway secrets-management guide explains why revocation evidence matters as much as rotation mechanics.
At the gateway, authorize the deployed workload rather than the repository actor. A payment worker may call POST /settlements but not export customer profiles. A deployment pipeline may update the worker image but should not call either business API. Keep gateway administrative endpoints on a separately authenticated and restricted path.
Apache APISIX and API7 Gateway can apply caller authentication, route policy, schema checks, traffic limits, and audit records to requests that pass through them. That can contain a compromised workload's API activity, especially when the application cannot reach sensitive origins directly. It cannot inspect a code push, prove artifact provenance, remove malicious code, or govern direct egress that bypasses the gateway. The internal API security boundaries must include network paths as well as gateway configuration.
Rehearse a Cross-Boundary Response
When repository or CI compromise is suspected, rotate everything is not a sufficiently ordered plan. Build a dependency-aware sequence:
- Freeze affected deployments and preserve repository, workflow, identity-provider, registry, gateway, and runtime evidence.
- Revoke compromised human sessions and disable the relevant workflow-to-cloud trust while leaving unrelated recovery access available.
- Inventory every credential the build and deployment systems could read or mint, including downstream tokens rather than only stored secrets.
- Compare deployed digests and attestations with the last trusted release. Quarantine artifacts whose provenance or build environment cannot be established.
- Rebuild from a reviewed revision on a clean, isolated builder and produce new evidence.
- Rotate reachable deployment, gateway-control, and runtime credentials in an order that preserves revocation testing.
- Restore one canary with the fixed identities, then verify allowed API calls, denied calls, direct-origin blocks, and audit records before fleet rollout.
Rotation should close old authority, not merely add a new credential. Test that the replacement works and the old credential fails at every node. Search for alternate ingress, direct service addresses, old workloads, scheduled jobs, and cached credentials that could preserve access.
The incident's data scope also matters. 1Password reported that some invitation, provisioning, and recovery-link tokens were among the collected account records, while vault data remained unaffected. That distinction shows why incident inventories should record each data class, token prerequisites, expiry, and compensating verification rather than labeling an entire platform “breached” or “safe.”
Conclusion
A secure delivery chain is a sequence of independent decisions: who may change source, which builder may produce an artifact, which digest may enter an environment, what the workload may call, and who may change gateway policy. One repository identity should not answer all five.
Use short-lived job credentials, protected environments, isolated builds, verifiable provenance, digest-based admission, runtime workload identity, and route-level API policy together. API7 Gateway can provide the runtime enforcement and audit boundary for managed API traffic, while source-control, build, and deployment systems retain their own responsibilities. Start by drawing the five identities for one sensitive service; any arrow labeled “same admin token” is a concrete place to reduce blast radius.



