From e6bc5d215e117a6a4e9972d1d5a5291d362a499d Mon Sep 17 00:00:00 2001 From: dhimaz0445 Date: Fri, 13 Nov 2026 09:08:32 +0000 Subject: [PATCH] chore: publish IntegraCI build modules dafcf6d0e87d --- .integraci/modules-dafcf6d0e87d | 1 + SHA256SUMS | 8 ++++---- cosign/README.md | 8 ++++---- cosign/attestation/tlog.go | 18 ++++++++++++++++++ cosign/attestation/tlog_test.go | 14 ++++++++++++++ cosign/main.go | 25 +++++++++++++++++++------ 6 files changed, 60 insertions(+), 14 deletions(-) create mode 100644 .integraci/modules-dafcf6d0e87d diff --git a/.integraci/modules-dafcf6d0e87d b/.integraci/modules-dafcf6d0e87d new file mode 100644 index 0000000..3e8b2c8 --- /dev/null +++ b/.integraci/modules-dafcf6d0e87d @@ -0,0 +1 @@ +dafcf6d0e87d \ No newline at end of file diff --git a/SHA256SUMS b/SHA256SUMS index ec310c6..2a4d189 100644 --- a/SHA256SUMS +++ b/SHA256SUMS @@ -12,19 +12,19 @@ bf2a7cc0471112aeaac0bddd350cbb67bb12fa976cf209c7d9d135319e400650 container-paas 8384f7eb844429c4bd4e6f23420994b723fb28336ad11c81d28afbbf32ab2a91 contract-test/go.mod 6c6439ee349a3ca0b8285535a71fdabac880a796a29888bd993f81273f011fb8 contract-test/go.sum e97b3de1b6f7261f88d2d79b36d4ef85ee56ef092182fd42c1a5d7e0b5c0bdad contract-test/main.go -6c1c291360634da415bcf04d9200b6149f0767451cb6d7d790db20ac30112c8a cosign/README.md +e55368ebc9f7826658b42694244750837823bf99168b0d715c6b1873f7db58c3 cosign/README.md ac92964aa87ea6c6fd0ba9249002d51dfb178f360c60a542cc12fc7ff78c6f17 cosign/attestation/attestation.go 753933a9a4c5bdf9f90a5655fdbc51ac171e1e1f6548cf6dd1e364c1fea07f20 cosign/attestation/attestation_test.go dc476bb7e89af327a748b7295d3cd383633cf6f835e7eaae17fcd51110735157 cosign/attestation/gate.go 9f95de1a60db48bd38cc713a495d2e5045894a331b48ea1126ce8ac82a47be2b cosign/attestation/gate_test.go c54df14db2bccbedcdfc4a899b092c235e4436f6a0eaa35371412d2eeb92e91b cosign/attestation/platformsign.go 8e9ac620253412be4acab7ac2fb0a32fc7b85cc4e25b4fb85f7c66eb2182f5b9 cosign/attestation/platformsign_test.go -9ab4c5bf3f850f2cdd8ef52efb1b71f07be978480ee39d0d129fc6f506154102 cosign/attestation/tlog.go -72701f946a2ac8b4486ceb845be3ccb588e8cd78b3a6811342d02ba82dd96231 cosign/attestation/tlog_test.go +e40a73acd98d349996b99e93e70ff41c119c623067dbdc698ed9c2d0d5d9dc0a cosign/attestation/tlog.go +6f062cce5d15b86bd927d1620f8eaefcf250d4f0b3a5d119ad82bbb4fd3f76d7 cosign/attestation/tlog_test.go 26be32bc776ba9621cc6a74680c05bbf2c2657680203f03e980a2587c9203fdf cosign/attestation/verify.go cb9be7964dcd1acbde95b9cedc4d2425e1dc94c3e2e2668bebcd2ed9624795c1 cosign/attestation/verify_test.go 181473ba7df06a1db3daee1cf07660efe9c5d997e9f7c9ae4ef8a0ec31cd8932 cosign/dagger.json -7910468e658bc0ca74c563398623dad659ce9e4c5f896380349141920145ea1a cosign/main.go +9910fdfca44d8086debaa3ccf8f4ae197c24d34bdce1372e099a0515263d5a42 cosign/main.go 866063328765c65cd8a5caef012d519499504f95de558b78f305fb9d80fd55f8 cosign/platform_sign.go 901c3ac8cf91649c2bebeaf9abeaf9372ae7c998dc29ef64697058d46ade1051 cosign/policy/attestation_gate.rego 2b69f6a327c02952411943153297a8d2d459dd59d9182bfdaae6b5d2b1dccf24 dast-scan/README.md diff --git a/cosign/README.md b/cosign/README.md index 437a214..ab4a70f 100644 --- a/cosign/README.md +++ b/cosign/README.md @@ -135,8 +135,8 @@ dagger -m ./dagger/cosign call attest-sbom \ ```bash dagger -m ./dagger/cosign call attest-provenance \ --image ghcr.io/integraci/payments-api:1.2.3@sha256:<64 hex image digest> \ - --builder-id "https://github.com/integraci/integraci/.github/workflows/release.yml@refs/tags/v1.2.3" \ - --source-uri "git+https://github.com/integraci/integraci@refs/tags/v1.2.3" \ + --builder-id "https://github.com/integraci-co/integraci/.github/workflows/release.yml@refs/tags/v1.2.3" \ + --source-uri "git+https://github.com/integraci-co/integraci@refs/tags/v1.2.3" \ --source-digest "$(git rev-parse HEAD)" \ --invocation-id "${{ github.run_id }}" \ --keyless @@ -165,8 +165,8 @@ dagger -m ./dagger/cosign call attest-provenance \ ```bash dagger -m ./dagger/cosign call verify-provenance \ --image ghcr.io/integraci/payments-api:1.2.3@sha256:<64 hex> \ - --expected-builder-id "https://github.com/integraci/integraci/.github/workflows/release.yml@refs/tags/v1.2.3" \ - --expected-source-repo "https://github.com/integraci/integraci" \ + --expected-builder-id "https://github.com/integraci-co/integraci/.github/workflows/release.yml@refs/tags/v1.2.3" \ + --expected-source-repo "https://github.com/integraci-co/integraci" \ --issuer-regex 'https://token\.actions\.githubusercontent\.com' ``` diff --git a/cosign/attestation/tlog.go b/cosign/attestation/tlog.go index 273ce35..7323626 100644 --- a/cosign/attestation/tlog.go +++ b/cosign/attestation/tlog.go @@ -169,3 +169,21 @@ func CheckRegex(flag, re string) error { } return nil } + +// UnpublishedSignatureNotice is printed (and returned in SignResult.Notice) +// by the gpg and in-toto cases of SignMethod. Both produce their output inside +// a throwaway container and neither pushes nor exports it, so no one (the +// platform or a human) can check that signature afterwards. The step keeps +// succeeding (owner rule 2026-11-08: pipelines already rendered with these +// methods must keep working); it just stops claiming a usable signature. +// Empty for every other method. +func UnpublishedSignatureNotice(method string) string { + switch method { + case "gpg", "in-toto": + return "WARNING: --method " + method + " produced a signature that is NOT published " + + "(not pushed to the registry, not exported), so it cannot be verified by the " + + "platform or anyone else. A deploy that requires a signed artifact will be refused. " + + "Use --method cosign for a signature the platform verifies." + } + return "" +} diff --git a/cosign/attestation/tlog_test.go b/cosign/attestation/tlog_test.go index 49a36f3..d1a6ce4 100644 --- a/cosign/attestation/tlog_test.go +++ b/cosign/attestation/tlog_test.go @@ -200,3 +200,17 @@ func TestRekorURLRefusesUnsafeValues(t *testing.T) { t.Fatalf("a plain https URL must pass: %v", err) } } + +func TestUnpublishedSignatureNotice(t *testing.T) { + for _, m := range []string{"gpg", "in-toto"} { + n := UnpublishedSignatureNotice(m) + if !strings.Contains(n, "NOT published") || !strings.Contains(n, m) { + t.Fatalf("%s: notice must say the signature is not published and name the method, got %q", m, n) + } + } + for _, m := range []string{"cosign", "notation", "none", ""} { + if n := UnpublishedSignatureNotice(m); n != "" { + t.Fatalf("%s publishes a signature (or claims none); want no notice, got %q", m, n) + } + } +} diff --git a/cosign/main.go b/cosign/main.go index 31029fc..3529d6e 100644 --- a/cosign/main.go +++ b/cosign/main.go @@ -221,8 +221,12 @@ func (m *Cosign) Sign( // (keyless) and prints a deprecation notice: pipelines rendered before // 2026-10-18 make exactly that call and must keep working. // - notation: NotaryProject `notation sign` (COSE) using the supplied key. -// - gpg: GPG detached-sign of the image manifest. -// - in-toto: in-toto CLI attestation (link metadata) over the manifest. +// Pushed as an OCI referrer; the platform does NOT verify it (cosign only). +// - gpg: GPG detached-sign of the image manifest. NOT published: the +// .asc stays in the step's container, so nothing can verify it. +// - in-toto: in-toto CLI attestation (link metadata). NOT published either. +// gpg and in-toto print attestation.UnpublishedSignatureNotice and still +// succeed, so pipelines already rendered with them keep running. // - none: no-op skip (mirrors the adapter's _comment_skip). // // Usage (keyed cosign — the default): @@ -393,10 +397,15 @@ func (m *Cosign) SignMethod( if _, err := c.WithExec([]string{"sh", "-c", script}).Sync(ctx); err != nil { return nil, fmt.Errorf("gpg sign failed: %w", err) } + // The .asc stays in the container: say so instead of naming it as if + // it could be fetched (attestation.UnpublishedSignatureNotice). + notice := attestation.UnpublishedSignatureNotice("gpg") + fmt.Fprintln(os.Stderr, notice) return &SignResult{ Image: imageRef, - Signature: imageRef + " (gpg detached manifest.json.asc)", + Signature: imageRef + " (gpg detached signature, not published)", Success: true, + Notice: notice, }, nil case "in-toto": @@ -415,10 +424,14 @@ func (m *Cosign) SignMethod( if _, err := c.WithExec([]string{"sh", "-c", script}).Sync(ctx); err != nil { return nil, fmt.Errorf("in-toto attestation failed: %w", err) } + // The link file stays in the container (attestation.UnpublishedSignatureNotice). + notice := attestation.UnpublishedSignatureNotice("in-toto") + fmt.Fprintln(os.Stderr, notice) return &SignResult{ Image: imageRef, - Signature: imageRef + " (in-toto link attestation)", + Signature: imageRef + " (in-toto link attestation, not published)", Success: true, + Notice: notice, }, nil default: @@ -523,8 +536,8 @@ func (m *Cosign) Verify( // // dagger call attest-provenance \ // --image ghcr.io/integraci/payments-api:1.2.3@sha256:<64 hex image digest> \ -// --builder-id https://github.com/integraci/integraci/.github/workflows/release.yml@refs/tags/v1.2.3 \ -// --source-uri git+https://github.com/integraci/integraci@refs/tags/v1.2.3 \ +// --builder-id https://github.com/integraci-co/integraci/.github/workflows/release.yml@refs/tags/v1.2.3 \ +// --source-uri git+https://github.com/integraci-co/integraci@refs/tags/v1.2.3 \ // --source-digest "$(git rev-parse HEAD)" \ // --build-type https://actions.github.io/buildtypes/workflow/v1 \ // --invocation-id ${{ github.run_id }} \