Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -497,13 +497,23 @@ describe("Pylon Prime publication verification", () => {
stableWorkflowPath: PRIME_STABLE_WORKFLOW,
stableWorkflowSha256: "0f04d1f55f54312d933087d88de6883e8408bb0cd9f060d3b5851d710698b1af",
},
{
publicationPolicyRevision: 3,
previewWorkflowPath: PRIME_PREVIEW_WORKFLOW,
previewWorkflowSha256: "16f68e46801eccca5e7e99736f346b5ffd96ce7188792d4ac8fbc4580408a736",
stableWorkflowPath: PRIME_STABLE_WORKFLOW,
stableWorkflowSha256: "96e4f3ccd889a17a391f00b4398d132a4234b5bc337045fedd3605f4eb74c331",
},
]);
});

it.each([
{ preview: 1, build: 1, promotion: 1 },
{ preview: 2, build: 2, promotion: 2 },
{ preview: 1, build: 1, promotion: 2 },
{ preview: 3, build: 3, promotion: 3 },
{ preview: 1, build: 1, promotion: 3 },
{ preview: 2, build: 2, promotion: 3 },
])("verifies independent build and promotion policies: %j", async (policies) => {
const fixture = syntheticPublication("stable", policies);
const verifySourcePolicy = vi.fn(validVerification.verifySourcePolicy);
Expand Down Expand Up @@ -535,9 +545,9 @@ describe("Pylon Prime publication verification", () => {
});

it.each([
{ preview: 3, build: 2, promotion: 2 },
{ preview: 2, build: 3, promotion: 2 },
{ preview: 2, build: 2, promotion: 3 },
{ preview: 4, build: 3, promotion: 3 },
{ preview: 3, build: 4, promotion: 3 },
{ preview: 3, build: 3, promotion: 4 },
])("rejects an unknown policy revision in any manifest position: %j", async (policies) => {
await expect(
verifyPrimePublicationFixture(syntheticPublication("stable", policies), validVerification),
Expand All @@ -547,13 +557,15 @@ describe("Pylon Prime publication verification", () => {
it.each([
{ preview: 1, build: 2, promotion: 2 },
{ preview: 2, build: 1, promotion: 2 },
{ preview: 2, build: 3, promotion: 3 },
{ preview: 3, build: 2, promotion: 3 },
])("rejects a stable build policy different from its exact preview: %j", async (policies) => {
await expect(
verifyPrimePublicationFixture(syntheticPublication("stable", policies), validVerification),
).rejects.toThrow(/Stable manifest does not bind the exact verified preview/u);
});

it.each([1, 2])("checks actual fetched workflow bytes under policy %i", async (revision) => {
it.each([1, 2, 3])("checks actual fetched workflow bytes under policy %i", async (revision) => {
const fixture = syntheticPublication("preview", {
preview: revision,
build: revision,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,13 @@ export const PRIME_PUBLICATION_POLICIES = Object.freeze([
stableWorkflowPath: PRIME_STABLE_WORKFLOW,
stableWorkflowSha256: "0f04d1f55f54312d933087d88de6883e8408bb0cd9f060d3b5851d710698b1af",
}),
Object.freeze({
publicationPolicyRevision: 3,
previewWorkflowPath: PRIME_PREVIEW_WORKFLOW,
previewWorkflowSha256: "16f68e46801eccca5e7e99736f346b5ffd96ce7188792d4ac8fbc4580408a736",
stableWorkflowPath: PRIME_STABLE_WORKFLOW,
stableWorkflowSha256: "96e4f3ccd889a17a391f00b4398d132a4234b5bc337045fedd3605f4eb74c331",
}),
]);

function publicationPolicyFor(revision: number) {
Expand Down
8 changes: 4 additions & 4 deletions docs/internals/prime-agent-distribution-verification.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ Unknown recipes, policy revisions, fields, assets, or tag shapes fail closed. Th
both publication workflow byte digests. A publication workflow change therefore needs a new reviewed
policy revision rather than a permissive parser change.

The immutable registry retains revision 1 and adds revision 2 from the reviewed publication changes
in [Prime Agent PR #56](https://github.com/pylon-code/prime-agent/pull/56). Each revision pins its own
The immutable registry retains revisions 1 and 2 and supports revision 3, which uses the pinned
GitHub REST client to upload release assets. Each revision pins its own
exact preview and stable workflow bytes. A stable receipt's build policy must equal its verified
preview's policy; its promotion policy is checked independently against the promotion commit and tree.
This permits a revision-1 preview to be promoted under revision 2 without changing its original build
provenance. Network verification and real-artifact graduation resolve the same frozen policies.
This permits a preview built under an earlier supported policy to be promoted under revision 3
without changing its original build provenance. Network verification and real-artifact graduation resolve the same frozen policies.

The server uses `@sigstore/bundle`, `@sigstore/core`, `@sigstore/tuf`, and `@sigstore/verify` directly.
It requires a current Sigstore bundle with an inclusion proof, one verified Rekor timestamp, one
Expand Down
Loading