Skip to content

Commit 638fb92

Browse files
authored
Merge pull request #1060 from crazy-max/sigstore-fix-verified-blob
sigstore: default blob attestation verification to SLSA provenance v1
2 parents 76d6a50 + ab22ca5 commit 638fb92

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

__tests__/sigstore/sigstore.test.itg.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const maybeIdToken = runTest && process.env.ACTIONS_ID_TOKEN_REQUEST_URL ? descr
3636
beforeAll(async () => {
3737
const cosignInstall = new CosignInstall();
3838
const cosignBinPath = await cosignInstall.download({
39-
version: 'v3.0.4'
39+
version: 'v3.0.6'
4040
});
4141
await cosignInstall.install(cosignBinPath);
4242
}, 100000);

src/sigstore/sigstore.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ export interface SigstoreOpts {
5555
imageTools?: ImageTools;
5656
}
5757

58+
const COSIGN_PREDICATE_SLSA_PROVENANCE_V1 = 'slsaprovenance1';
59+
5860
export class Sigstore {
5961
private readonly cosign: Cosign;
6062
private readonly imageTools: ImageTools;
@@ -352,7 +354,8 @@ export class Sigstore {
352354
'verify-blob-attestation',
353355
'--new-bundle-format',
354356
'--certificate-oidc-issuer', 'https://token.actions.githubusercontent.com',
355-
'--certificate-identity-regexp', opts.certificateIdentityRegexp
357+
'--certificate-identity-regexp', opts.certificateIdentityRegexp,
358+
'--type', opts.predicateType ?? COSIGN_PREDICATE_SLSA_PROVENANCE_V1
356359
]
357360
if (opts.noTransparencyLog || !signedRes.tlogID) {
358361
// if there is no tlog entry, we skip tlog verification but still verify the signed timestamp

src/types/sigstore/sigstore.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ export interface SignProvenanceBlobsResult extends ParsedBundle {
7373
}
7474

7575
export interface VerifySignedArtifactsOpts {
76+
predicateType?: string;
7677
certificateIdentityRegexp: string;
7778
noTransparencyLog?: boolean;
7879
}

0 commit comments

Comments
 (0)