MicroVM GitHub Runners

SecurityThreat model and controls

What an attacker controls, what they can reach, and what stops them.

ThreatControl
Malicious job (PR author, compromised dependency) persists into later jobsOne Firecracker VM per job, terminated afterwards, no reuse (ADR-001). JIT runners accept exactly one job.
Job reads another repository's secretsThe runner role is limited to gha/<owner>/<repo>/* and to data tagged with its gha-repo-id, and capped by the boundary, which scopes everything to the role's own repository tags. Even a widened identity policy cannot exceed the boundary, and the RCP of org-guardrails denies cross-repository access to secrets, queues, tables and logs.
Job steals the GitHub App keyThe key is readable only by the broker role. The secret's resource policy denies everyone else, and the boundary explicitly denies it.
Repository deploy role escalates (new role, removed boundary)iam:CreateRole requires the shared boundary, a name of its own and its own repository tags. Removing a boundary, creating policy versions, users or access keys is denied.
Repository claims another repository's identity by changing tagsThe boundary only counts gha-repo-id on a role named for that id. A retagged role, for example deploy-B carrying A's id, gets nothing. The boundary stops a repository's own roles from setting or removing gha-repo-id and gha-repo with another value. Other principals in the account are stopped only by the SCP of org-guardrails, which leaves only exempt administrators and the tagger able to set these tags. See IAM design.
Workflow obtains another repository's deploy session from the tagger (phase 2)The tagger takes the repository only from a verified GitHub OIDC token (RS256, JWKS key, exact issuer and audience <prefix>-tagger, time claims). The owner must be allowed and its numeric id must match, the registry entry must match the full name, the token's Environment must equal the entry's, a pinned repository_id must match (no access for a recreated repository of the same name), and each jti works once. Only the tagger can set the gha-* session tags (deploy role trust and SCP). Sessions carry SourceIdentity for CloudTrail.
Repository asks the broker for another repository's tokenThe broker runs the presigned GetCallerIdentity itself (regional STS host only, no SSRF). It requires the role <prefix>-<sha256(repo)[:10]>-control in its own account and an onboarded repository, and scopes the token to that one repository.
Job kills other runnersThe runner role has no MicroVM permissions. The control role can only Get/Terminate VMs of its own image ARN.
JIT config replay or theftNever in the run payload. Stored as a KMS SecureString under a per-runner name, read and deleted by the VM in /run, and deleted again on cleanup.
Forged webhookConstant-time HMAC-SHA256 check, wrong repository rejected, 1 MB body cap. Optional AWS_IAM mode behind a central ingress with WAF.
Data exfiltration from a jobNo NAT in the account. All traffic goes through the central egress and its firewall allow-list. MicroVMs use NO_INGRESS; shell and auth tokens are denied by the boundary.
Supply chain (runner, Lambda code, actions)Runner tarball SHA-256 pinned, reproducible builds, SLSA build provenance and SBOM on every release, consumers verify with gh attestation verify, optional Lambda code signing, every action pinned by commit SHA.
Secrets in Terraform stateThe webhook secret is ephemeral and written with secret_string_wo. The App key is set out of band. State is encrypted with KMS and versioned. The bucket denies uploads that ask for another encryption than SSE-KMS; an upload without the header gets the platform key.

IdentitiesWho can do what

RoleUsed byCanCannot
<prefix>-brokerToken broker (platform)Read the App key, decrypt with the platform keyAnything else
<prefix>-deploy-<id>The repo's deploy workflow (OIDC, Environment runners)Create and update its own resources within the boundaryLeave its boundary, touch other ids, read the App key
<prefix>-deploy-entryDeploy workflows of allowed owners (OIDC, any Environment), phase 2Invoke the taggerAnything else
<prefix>-taggerTagger (platform), phase 2Read the registry, record token ids, assume <prefix>-deploy with session tagsAnything else
<prefix>-deployTagged sessions from the tagger, phase 2The same as <prefix>-deploy-<id>, for the repository in its session tagsAct for any repository other than its session tags'
<prefix>-<id>-controlDispatcher, sweeperClaim jobs, write JIT params, run and terminate its own VMs, get tokens from the brokerRead job secrets
<prefix>-<id>-webhookWebhookRead the webhook secret, send to its queueAnything else
<prefix>-<id>-runnerEvery job (ambient)Read and delete its JIT param, read repo CI secrets and parameters, write runtime logsMicroVM APIs, other repos, App key

Rule for workflow authors: the runner role is available to every job, including pull requests from anyone with write access. Keep only CI-grade secrets under gha/<owner>/<repo>/. For deployments use GitHub OIDC with roles whose trust is bound to a protected Environment (repo:<owner>/<repo>:environment:production).

Hardening checklistBefore production