Repository navigation
image.yml: build the runtime image and push it to the QA registry by OIDC - #104
Conversation
…OIDC A dispatch-only workflow that builds deploy/compose/Dockerfile for linux/amd64 at a tag or full commit on main (SOURCE_REVISION set to the commit), records the image ID and archive sha256 before any third-party code runs, scans the archive with a hash-pinned Trivy (report only for qa), and pushes it from the acr-qa environment after an approval, signing in to Azure by workload identity federation with no stored credential. The digest is read back by a pull and recorded in the job summary, a job output and image-release.json. The Azure IDs and the registry name are variables, never in the file. The approval re-check is release.yml's own script; checkout and the artifact actions are at release.yml's pins. Prod promotion by digest and the Opensoft-Tenant digest bump are marked, not built. tests/test_image_workflow.py runs each step's own script hermetically, as tests/test_release_workflow.py does; docs/image-release.md is the operator's page and the one-time setup. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review |
Reviewer's GuideConfigurationAdd a dispatch-only workflow that builds and scans a runtime image, then pushes and verifies it in the approval-gated QA registry using Azure OIDC.
DocumentationDocument how to run the image workflow and configure its GitHub environment and Terraform-provisioned Azure identity and registry permissions.
TestsAdd hermetic tests for the workflow’s gates, artifact integrity, scan behavior, OIDC push flow, release record, and operator setup guidance.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
…site asserts SonarCloud on #104: githubactions:S6506, the one vulnerability that failed the quality gate, flagged `curl -L` following a redirect with no protocol limit. The download now passes `--proto '=https' --tlsv1.2`, and a test pins it. python:S9073's six composite assertions in tests/test_image_workflow.py are split. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
…sions the Azure side
Brett Heap ruled on 2026-11-17 ("Secrets", "Terraform"; openxFactory#656
comment 6936600205, item 5):
* AZURE_CLIENT_ID, AZURE_TENANT_ID and AZURE_SUBSCRIPTION_ID are read from
secrets.* on the acr-qa environment, so GitHub masks them in this public
repository's run logs. ACR_NAME stays vars.*: the registry's name is part
of the image reference and the digest output. Only the push job, which names
the environment, reads them. The settings step names a missing or malformed
secret or variable and prints no value.
* docs/image-release.md no longer gives hand az identity create, federated
credential create or role assignment create commands. It states the end
state (issuer, audience, subject and how to read its prefix, the role and the
ABAC alternative), says an operator provisions it through Terraform, keeps
the read-only az checks, and sets the three IDs with gh secret set --env
acr-qa, from a command's output.
* The header cites the governing ruling (item 4) where it said none existed.
* tests: the three IDs are read from secrets, twice each, never from vars; a
secret is read only in a job that names acr-qa; no other step mentions one;
the page holds no creating az command, no typed secret value and no estate
identifier.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Pushed The governing record. Brett Heap's ruling on openxFactory#656. Item 4 names "Secrets".
"Terraform". Checks.
|
Brett Heap ruled on 2026-11-17 ("Remove tenant name from #104") that this
public repository does not name the estate's deployment repository or a path
inside it.
* The workflow header, the record step's summary text and the operator page's
"Next step" say "the deployment repository" and "the QA overlay's image
digest". The future bump job's variable and secret names, which carried the
repository's name, are DEPLOY_BUMP_CLIENT_ID and DEPLOY_BUMP_PRIVATE_KEY,
its repository is a <DEPLOYMENT_REPOSITORY> placeholder, and the page no
longer names the tool that deploys what merges there.
* tests: the workflow, the operator page and the test file itself hold none of
the deployment repository's name, a gitops/ path, kustomization.yaml or the
estate's domain (the strings are built from parts, so the test file does not
spell them); the release record's step summary is held to the same list and
to the new wording.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
brettheap
left a comment
There was a problem hiding this comment.
Codex expert-panel review of 079517346dd73cd2d43bfb6e55a3e0c6290e858c against this PR's main base.
No actionable code findings. Reviewed revision/tag resolution and main ancestry, fixed-SHA checkout, action/tool pins, build/push separation, archive hash and image-ID verification, environment approval checks, OIDC permissions, configuration validation, digest read-back, and release metadata. The report-only scan matches the documented QA ruling.
Validation: static workflow/script/test review across architecture, security, performance, QA, API/integrity, reliability, maintainability, and CI/release roles. GitHub now reports validate, acceptance, and SonarCloud SUCCESS at this head. The tests were inspected rather than rerun.
The documented Azure validation limit remains: a real federated sign-in, registry login and ACR push have not been demonstrated. Complete the authorized Terraform/environment setup and first approved QA run to establish that integration evidence. Preserve the draft status until the owner's readiness decision; this review does not establish production readiness or clear the documented setup prerequisites.
…-safe, validate secret values Hardening from a local review of 0795173. * Both jobs now read the acr-qa environment's deployment branch policies (a new step with one script, held equal in the two jobs by a test) and require exactly one policy, the branch main. Another branch, a wildcard, a tag policy, an empty or truncated list, an answer in an unexpected shape and a failed read each refuse. The endpoint answers to actions: read, which both jobs already hold. The header and the operator page say that the environment's own configuration is the control and that these checks are the reviewed copy of the workflow noticing a misconfiguration. * The archive's artifact is named image-<run attempt>, the build job records the ID its upload returned, and the push job downloads that ID and no name. The two reports use overwrite, so a rerun of failed jobs does not meet a name its run already holds. * The operator page covers the user-assigned managed identity alone, and its secret-setting snippet reads each ID into a variable, checks that it is a GUID, and only then passes it to gh secret set on standard input. * tests: the limit step against twenty answers in each job, the artifact names, overwrite and download-by-ID, the page's scope, and the page's own snippet run against stand-in az and gh commands. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
|
Sorry @brettheap, you've used your own review budget of 250,000 diff characters for the last 7 days. You can request another review in 5 days and 6 hours by commenting |



What and why
Brett Heap asked on 2026-11-17 for a pipeline that can publish the openDox runtime image to the QA registry: "lets setup so that we can have a pipeline that can deploy to it" … "go ahead with the pipeline". Until now the QA image would come from a hand-run
az acr build. This adds.github/workflows/image.yml, a dispatch-only workflow. The build job does the following:revisioninput (a tag, or a full 40-character commit) and refuses it unless it is on this repository'smain;acr-qaenvironment to name a required reviewer, and its deployment limit to be exactly one policy, the branchmain(it reads the list of policies);deploy/compose/Dockerfileforlinux/amd64withSOURCE_REVISION=<full commit>;The push job runs in
acr-qaafter an approval. It does the following:release.yml's own script, byte for byte;azure/login,id-token: write, no stored credential);az acr login, thendocker push, then pulls the image back by digest;digestandimage-release.json(image,digest,source_revision,ref,target).The workflow names no Azure ID or registry name. The three Azure IDs are environment secrets of
acr-qa(secrets.AZURE_CLIENT_ID,secrets.AZURE_TENANT_ID,secrets.AZURE_SUBSCRIPTION_ID), which GitHub masks in this public repository's run logs. The registry's name is the variablevars.ACR_NAME: it is part of the image reference and the digest output, and masking it would garble both. The push job, the only job that namesacr-qa, reads them, and refuses, naming the secret or the variable, when one is unset or malformed. No step prints a value. Every action is pinned by full commit SHA, and checkout and the artifact actions are atrelease.yml's pins.docs/image-release.mdis the operator's page.DRAFT
The shared protocol treats
.github/workflows/as a governed invariant in every repository, and puts deployment orchestration under OpenSpec before implementation. When this PR was opened no record named the workflow. The governing record now exists: Brett Heap's ruling on openxFactory#656 (2026-11-17). Item 4 names.github/workflows/image.ymlas a governed workflow: a commit thatmaincontains, built on manual dispatch, behind theacr-qaenvironment with a required reviewer, pushed to the QA registry only, with a report-only scan. Promotion to production is not covered and needs its own ruling. Item 5 rules how Azure access is made: the identity, its federated credential and the registry role are created through Terraform, and the client, tenant and subscription IDs are held as environment secrets. This PR stays a draft, because whether it leaves draft is Brett Heap's call. It also cannot be exercised end to end until the Azure identity exists (see below).Where this departs from the design it was given
GET repos/opensoft/openDox-code/actions/oidc/customization/subanswereduse_immutable_subject: true, prefixrepo:opensoft@638385/openDox-code@1358690966on 2026-11-17). The subject is thereforerepo:opensoft@638385/openDox-code@1358690966:environment:acr-qa, notrepo:opensoft/openDox-code:environment:acr-qa, which would never match. The docs read the prefix from the API rather than hard-coding it.AcrPushalone, and how. Microsoft's roles overview namesContainer Registry Contributor and Data Access Configuration Administratoras the role foraz acr login, and that role can delete the registry. It is not needed.AcrPushis exactlyregistries/pull/readandregistries/push/write, with no read of the registry resource. The Azure CLI's_get_credentials(acr/_docker_utils.py) catches the resultingResourceNotFound, falls back to<name><cloud suffix>and exchanges the Entra token on the data plane. That only works with no--resource-group, and a test pins its absence. If the registry is in ABAC mode (rbac-abac),AcrPushis not honoured; the docs giveContainer Registry Repository Writerwith a condition scoping it to theopendox-runtimerepository.az acr buildneeds broader rights: confirmed. It needsContainer Registry Tasks Contributor(scheduleRun/action,listBuildSourceUploadUrl/action, and create, run or delete any task), plus a registry read for the CLI's lookup.revision, notref, to keep it distinct from the "Use workflow from" branch. Being separate from the dispatched ref is what letsmain's reviewed copy of the file buildv0.1.0, which predates it.ACR_NAMEis an environment variable, all onacr-qa, not the repository (item 5 of the ruling above; Brett Heap, 2026-11-17: "Secrets"). A lateracr-prodcarries the same names with prod's values. An environment's secrets reach only a job that names it, after its approval: the push job. The build job names no secret.release.yml, and its limit's list is read. The build job refuses unlessacr-qanames a required reviewer and has a custom deployment limit, and a further step, run again in the push job, reads the policy list and requires exactly one entry, the branchmain: a wildcard, another branch, a tag policy, an empty or truncated list, an unexpected answer and a failed read each refuse. The endpoint answers toactions: read, which both jobs already hold (GitHub's permissions table for "List deployment branch policies"), so no permission was added. The real control is the environment's own configuration, which GitHub enforces and a branch's copy of the workflow cannot change. These checks aremain's reviewed copy noticing a misconfigured environment; they do not bind a branch, and the header and the docs say so. GitHub would otherwise create the environment unprotected on the first dispatch.image-<run attempt>, the build job records the ID that upload returned, and the push job downloads that ID and no name, so it can only load the archive of its own build job's attempt (and still checks the sha256 and image ID). Thescanandimage-releasereports useoverwrite: true.aquasecurity/trivy-action. That action's tags were rewritten to an infostealer on 2026-03-19, and a SHA pin covers only the action's files, not the Trivy it downloads. The workflow fetches Trivy 0.76.1 (published 2026-10-21) and checks the tarball's sha256 before unpacking. The digest agreed across the release's checksum file, GitHub's asset digest and a download.actions/create-github-app-token. That action now takesclient-id;app-idis deprecated.attestations: write, and for a public repository it writes a permanent public Sigstore entry naming the image. A CycloneDX SBOM is uploaded as an artifact instead.image-release.json'simageis registry-relative (opendox-runtime:<tag>), and atargetfield is added. No output or artifact names the registry host.One-time setup by an operator (not done here)
The Azure side is provisioned through Terraform by an operator, never by hand
az(Brett Heap, 2026-11-17: "Terraform").docs/image-release.md§ "One-time setup by an operator" states the end state those resources must have, with placeholders, and keeps only read-onlyazchecks:gh api …/actions/oidc/customization/sub.https://token.actions.githubusercontent.com, audienceapi://AzureADTokenExchangeand subject<prefix>:environment:acr-qa.AcrPush, or in ABAC mode (rbac-abac, read fromroleAssignmentMode)Container Registry Repository Writerwith a condition scoping it to theopendox-runtimerepository.acr-qawith a required reviewer,prevent_self_review: false(aspypihas), and a deployment-branch policy list of exactlymain.gh secret set --env acr-qathe three Azure IDs, each read into a shell variable, checked to be a GUID, and only then passed on standard input (so an expiredazlogin cannot write an empty secret, and nothing is typed inline), andgh variable set ACR_NAME --env acr-qa. The page covers the user-assigned managed identity alone.Tested, and not tested
actionlint1.7.12, with shellcheck: 0 errors.tests/test_image_workflow.py: 143 cases. Each extracts and runs a step's own script with stand-ingh,docker,azandcurland a redirected git remote, so nothing reaches a network. Deliberate breaks of the workflow each turned tests red: dropping the annotated-tag peel, naming a resource group, skipping the pulled-image check, accepting a commit offmain, and, for the secrets ruling, readingAZURE_CLIENT_IDorAZURE_TENANT_IDfromvars, naming an Azure ID in another step, adding a handaz identity createto the page, typing a secret's value on agh secret setline, and naming the deployment repository or a path inside it in the workflow, the page or the step summary. The new cases pin the three IDs tosecrets(twice each, nevervars), a secret to a job that namesacr-qa, and the operator page to read-onlyazcommands,gh secret setfrom a command's output, and placeholders only. The workflow, the page and the test file are held to naming no deployment repository, no path inside one and no estate domain. The settings step is exercised with each secret unset (empty, as GitHub supplies it), malformed, and with no value printed. For the review round: the deployment limit step runs against twenty answers (a wildcard, an extra branch, a tag policy, an empty list, a truncated list, other shapes, a failed read, and the good case) in each job; the artifact names,overwriteand download-by-ID are pinned; and the page's own secret-setting snippet is run against stand-inazandghcommands, where an expired login, an empty answer and a non-GUID answer never reachgh secret set. Deliberate breaks that turned these red: a limit step accepting any name, accepting a tag policy, or differing between the jobs; the archive under a fixed name; a download by name; a report withoutoverwrite; the snippet without its check; and an app registration offered again.The step scripts were also run outside CI against real tools. Against the live repository, read-only, the revision gate:
v0.1.0todede32b4…;main's head;main, a short SHA,release/1and a foreign commit.The environment check refused (
acr-qadoes not exist yet). With Docker 29,v0.1.0built; the real Trivy download passed its checksum; the scan found 1 CRITICAL and 119 HIGH; the QA verdict passed, and a CRITICAL,HIGH gate refused. The load and push steps then pushed to a throwaway localregistry:2, using a stand-inaz: the digest was read back by pull and the image ID matched.Also run locally:
tests/test_release_workflow.py,tests/test_leg_shape.py, and every test that enumeratesdocs/or the tree (566 cases), all passing. Whole-suite collection goes from 5910 to 6053 (measured on this branch atebf2ed4): this file's 143 cases and nothing else.Not tested: a rerun. How the rerun-safe artifact names behave rests on the pinned actions' own
action.ymland source, read at the pinned commits, and on the structure the tests pin; no rerun was executed.Not tested: the Azure half.
azure/login, the federated credential match,az acr login's fallback against a real registry, and the push to ACR cannot run until the identity, role, environment, secrets and variable exist. A secret's masking in the run logs is likewise unobserved until a run executes. The CI runner uses Docker 28.0.4, not the Docker 29 I tested with. The image-ID comparisons are like-for-like in either store, but the first real run is their first test there.Notes
submitverb, route and control (plan 038) #96 also left the floors.deploy/:python:3.12-slim), not digest.🤖 Generated with Claude Code
Summary by Sourcery
Add an approval-gated, OIDC-backed pipeline to build, scan, and publish verified runtime images to the QA registry.
New Features:
Enhancements:
CI:
Deployment:
Documentation:
Tests: