@enactprotocol/trust 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hash.d.ts +53 -0
- package/dist/hash.d.ts.map +1 -0
- package/dist/hash.js +104 -0
- package/dist/hash.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/keys.d.ts +41 -0
- package/dist/keys.d.ts.map +1 -0
- package/dist/keys.js +130 -0
- package/dist/keys.js.map +1 -0
- package/dist/sigstore/attestation.d.ts +245 -0
- package/dist/sigstore/attestation.d.ts.map +1 -0
- package/dist/sigstore/attestation.js +324 -0
- package/dist/sigstore/attestation.js.map +1 -0
- package/dist/sigstore/cosign.d.ts +90 -0
- package/dist/sigstore/cosign.d.ts.map +1 -0
- package/dist/sigstore/cosign.js +457 -0
- package/dist/sigstore/cosign.js.map +1 -0
- package/dist/sigstore/index.d.ts +17 -0
- package/dist/sigstore/index.d.ts.map +1 -0
- package/dist/sigstore/index.js +21 -0
- package/dist/sigstore/index.js.map +1 -0
- package/dist/sigstore/oauth/client.d.ts +38 -0
- package/dist/sigstore/oauth/client.d.ts.map +1 -0
- package/dist/sigstore/oauth/client.js +71 -0
- package/dist/sigstore/oauth/client.js.map +1 -0
- package/dist/sigstore/oauth/index.d.ts +47 -0
- package/dist/sigstore/oauth/index.d.ts.map +1 -0
- package/dist/sigstore/oauth/index.js +66 -0
- package/dist/sigstore/oauth/index.js.map +1 -0
- package/dist/sigstore/oauth/server.d.ts +29 -0
- package/dist/sigstore/oauth/server.d.ts.map +1 -0
- package/dist/sigstore/oauth/server.js +145 -0
- package/dist/sigstore/oauth/server.js.map +1 -0
- package/dist/sigstore/policy.d.ts +85 -0
- package/dist/sigstore/policy.d.ts.map +1 -0
- package/dist/sigstore/policy.js +351 -0
- package/dist/sigstore/policy.js.map +1 -0
- package/dist/sigstore/signing.d.ts +94 -0
- package/dist/sigstore/signing.d.ts.map +1 -0
- package/dist/sigstore/signing.js +477 -0
- package/dist/sigstore/signing.js.map +1 -0
- package/dist/sigstore/types.d.ts +541 -0
- package/dist/sigstore/types.d.ts.map +1 -0
- package/dist/sigstore/types.js +5 -0
- package/dist/sigstore/types.js.map +1 -0
- package/dist/sigstore/verification.d.ts +66 -0
- package/dist/sigstore/verification.d.ts.map +1 -0
- package/dist/sigstore/verification.js +317 -0
- package/dist/sigstore/verification.js.map +1 -0
- package/dist/types.d.ts +61 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +0 -1
|
@@ -0,0 +1,541 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sigstore-related type definitions for attestation and verification
|
|
3
|
+
*/
|
|
4
|
+
import type { Bundle } from "sigstore";
|
|
5
|
+
export type SigstoreBundle = Bundle;
|
|
6
|
+
/**
|
|
7
|
+
* Supported OIDC providers for keyless signing
|
|
8
|
+
*/
|
|
9
|
+
export type OIDCProvider = "github" | "google" | "microsoft" | "gitlab" | "custom";
|
|
10
|
+
/**
|
|
11
|
+
* OIDC identity information extracted from tokens
|
|
12
|
+
*/
|
|
13
|
+
export interface OIDCIdentity {
|
|
14
|
+
/** OIDC provider that issued the token */
|
|
15
|
+
provider: OIDCProvider;
|
|
16
|
+
/** Subject identifier (e.g., email or user ID) */
|
|
17
|
+
subject: string;
|
|
18
|
+
/** Issuer URL */
|
|
19
|
+
issuer: string;
|
|
20
|
+
/** Email address if available */
|
|
21
|
+
email?: string;
|
|
22
|
+
/** Username for the provider (e.g., GitHub username) */
|
|
23
|
+
username?: string;
|
|
24
|
+
/** GitHub-specific: workflow repository */
|
|
25
|
+
workflowRepository?: string;
|
|
26
|
+
/** GitHub-specific: workflow ref (branch/tag) */
|
|
27
|
+
workflowRef?: string;
|
|
28
|
+
/** GitHub-specific: workflow trigger event */
|
|
29
|
+
workflowTrigger?: string;
|
|
30
|
+
/** Raw OIDC token claims */
|
|
31
|
+
claims?: Record<string, unknown>;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Options for OIDC authentication
|
|
35
|
+
*/
|
|
36
|
+
export interface OIDCOptions {
|
|
37
|
+
/** OIDC provider to use */
|
|
38
|
+
provider: OIDCProvider;
|
|
39
|
+
/** Custom issuer URL (for custom provider) */
|
|
40
|
+
issuerURL?: string;
|
|
41
|
+
/** Client ID for OIDC flow */
|
|
42
|
+
clientId?: string;
|
|
43
|
+
/** Redirect URI for OAuth flow */
|
|
44
|
+
redirectUri?: string;
|
|
45
|
+
/** Pre-obtained OIDC token (for CI/CD environments) */
|
|
46
|
+
token?: string;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Fulcio certificate information
|
|
50
|
+
*/
|
|
51
|
+
export interface FulcioCertificate {
|
|
52
|
+
/** PEM-encoded certificate chain */
|
|
53
|
+
certificateChain: string[];
|
|
54
|
+
/** Certificate serial number */
|
|
55
|
+
serialNumber: string;
|
|
56
|
+
/** Certificate not before time */
|
|
57
|
+
notBefore: Date;
|
|
58
|
+
/** Certificate not after time */
|
|
59
|
+
notAfter: Date;
|
|
60
|
+
/** Subject common name */
|
|
61
|
+
subject: string;
|
|
62
|
+
/** Certificate issuer */
|
|
63
|
+
issuer: string;
|
|
64
|
+
/** OIDC identity embedded in certificate */
|
|
65
|
+
identity: OIDCIdentity;
|
|
66
|
+
/** Raw certificate bytes (DER encoded) */
|
|
67
|
+
raw?: Uint8Array;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Options for requesting a Fulcio certificate
|
|
71
|
+
*/
|
|
72
|
+
export interface FulcioCertificateOptions {
|
|
73
|
+
/** Fulcio server URL (default: public Fulcio instance) */
|
|
74
|
+
fulcioURL?: string;
|
|
75
|
+
/** OIDC identity token */
|
|
76
|
+
identityToken: string;
|
|
77
|
+
/** Public key to certify */
|
|
78
|
+
publicKey: string;
|
|
79
|
+
/** Proof of possession signature */
|
|
80
|
+
proofOfPossession: string;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Rekor transparency log entry
|
|
84
|
+
*/
|
|
85
|
+
export interface RekorEntry {
|
|
86
|
+
/** Log entry UUID */
|
|
87
|
+
uuid: string;
|
|
88
|
+
/** Log entry index */
|
|
89
|
+
logIndex: number;
|
|
90
|
+
/** Integrated time (Unix timestamp) */
|
|
91
|
+
integratedTime: number;
|
|
92
|
+
/** Log ID */
|
|
93
|
+
logID: string;
|
|
94
|
+
/** Entry body (base64 encoded) */
|
|
95
|
+
body: string;
|
|
96
|
+
/** Signed Entry Timestamp (SET) */
|
|
97
|
+
signedEntryTimestamp: string;
|
|
98
|
+
/** Inclusion proof */
|
|
99
|
+
inclusionProof?: RekorInclusionProof;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Inclusion proof for a Rekor entry
|
|
103
|
+
*/
|
|
104
|
+
export interface RekorInclusionProof {
|
|
105
|
+
/** Log index */
|
|
106
|
+
logIndex: number;
|
|
107
|
+
/** Root hash of the tree at the time of inclusion */
|
|
108
|
+
rootHash: string;
|
|
109
|
+
/** Tree size at time of inclusion */
|
|
110
|
+
treeSize: number;
|
|
111
|
+
/** Hashes for the inclusion proof */
|
|
112
|
+
hashes: string[];
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Options for creating a Rekor entry
|
|
116
|
+
*/
|
|
117
|
+
export interface RekorEntryOptions {
|
|
118
|
+
/** Rekor server URL (default: public Rekor instance) */
|
|
119
|
+
rekorURL?: string;
|
|
120
|
+
/** Artifact hash */
|
|
121
|
+
artifactHash: string;
|
|
122
|
+
/** Signature over the artifact */
|
|
123
|
+
signature: string;
|
|
124
|
+
/** Signing certificate */
|
|
125
|
+
certificate: string;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* in-toto Statement (attestation envelope)
|
|
129
|
+
* @see https://github.com/in-toto/attestation/blob/main/spec/v1/statement.md
|
|
130
|
+
*/
|
|
131
|
+
export interface InTotoStatement<T = unknown> {
|
|
132
|
+
/** Statement type identifier */
|
|
133
|
+
_type: "https://in-toto.io/Statement/v1";
|
|
134
|
+
/** Subjects (artifacts) this attestation covers */
|
|
135
|
+
subject: InTotoSubject[];
|
|
136
|
+
/** Predicate type URI */
|
|
137
|
+
predicateType: string;
|
|
138
|
+
/** Predicate content */
|
|
139
|
+
predicate: T;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Subject of an in-toto statement
|
|
143
|
+
*/
|
|
144
|
+
export interface InTotoSubject {
|
|
145
|
+
/** Subject name (e.g., file path or artifact identifier) */
|
|
146
|
+
name: string;
|
|
147
|
+
/** Digest of the subject in various algorithms */
|
|
148
|
+
digest: {
|
|
149
|
+
sha256?: string;
|
|
150
|
+
sha512?: string;
|
|
151
|
+
[algorithm: string]: string | undefined;
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* SLSA Provenance predicate v1.0
|
|
156
|
+
* @see https://slsa.dev/spec/v1.0/provenance
|
|
157
|
+
*/
|
|
158
|
+
export interface SLSAProvenancePredicate {
|
|
159
|
+
/** Build definition */
|
|
160
|
+
buildDefinition: {
|
|
161
|
+
/** Build type URI */
|
|
162
|
+
buildType: string;
|
|
163
|
+
/** External parameters */
|
|
164
|
+
externalParameters: Record<string, unknown>;
|
|
165
|
+
/** Internal parameters */
|
|
166
|
+
internalParameters?: Record<string, unknown>;
|
|
167
|
+
/** Resolved dependencies */
|
|
168
|
+
resolvedDependencies?: SLSAResourceDescriptor[];
|
|
169
|
+
};
|
|
170
|
+
/** Run details */
|
|
171
|
+
runDetails: {
|
|
172
|
+
/** Builder information */
|
|
173
|
+
builder: {
|
|
174
|
+
/** Builder ID */
|
|
175
|
+
id: string;
|
|
176
|
+
/** Builder dependencies */
|
|
177
|
+
builderDependencies?: SLSAResourceDescriptor[];
|
|
178
|
+
/** Builder version */
|
|
179
|
+
version?: Record<string, string>;
|
|
180
|
+
};
|
|
181
|
+
/** Build metadata */
|
|
182
|
+
metadata?: {
|
|
183
|
+
/** Invocation ID */
|
|
184
|
+
invocationId?: string;
|
|
185
|
+
/** Start time */
|
|
186
|
+
startedOn?: string;
|
|
187
|
+
/** End time */
|
|
188
|
+
finishedOn?: string;
|
|
189
|
+
};
|
|
190
|
+
/** Byproducts of the build */
|
|
191
|
+
byproducts?: SLSAResourceDescriptor[];
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* SLSA Resource Descriptor
|
|
196
|
+
*/
|
|
197
|
+
export interface SLSAResourceDescriptor {
|
|
198
|
+
/** Resource URI */
|
|
199
|
+
uri?: string;
|
|
200
|
+
/** Resource digest */
|
|
201
|
+
digest?: {
|
|
202
|
+
sha256?: string;
|
|
203
|
+
sha512?: string;
|
|
204
|
+
[algorithm: string]: string | undefined;
|
|
205
|
+
};
|
|
206
|
+
/** Resource name */
|
|
207
|
+
name?: string;
|
|
208
|
+
/** Download location */
|
|
209
|
+
downloadLocation?: string;
|
|
210
|
+
/** Media type */
|
|
211
|
+
mediaType?: string;
|
|
212
|
+
/** Content (for inline resources) */
|
|
213
|
+
content?: string;
|
|
214
|
+
/** Annotations */
|
|
215
|
+
annotations?: Record<string, unknown>;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Transparency log entry in bundle format (for reference/extraction)
|
|
219
|
+
*/
|
|
220
|
+
export interface TransparencyLogEntry {
|
|
221
|
+
/** Log index */
|
|
222
|
+
logIndex: string;
|
|
223
|
+
/** Log ID */
|
|
224
|
+
logId: {
|
|
225
|
+
keyId: string;
|
|
226
|
+
};
|
|
227
|
+
/** Entry kind and version */
|
|
228
|
+
kindVersion: {
|
|
229
|
+
kind: "hashedrekord" | "intoto" | "dsse";
|
|
230
|
+
version: string;
|
|
231
|
+
};
|
|
232
|
+
/** Integrated time (Unix timestamp) */
|
|
233
|
+
integratedTime: string;
|
|
234
|
+
/** Inclusion promise */
|
|
235
|
+
inclusionPromise?: {
|
|
236
|
+
signedEntryTimestamp: string;
|
|
237
|
+
};
|
|
238
|
+
/** Inclusion proof */
|
|
239
|
+
inclusionProof?: {
|
|
240
|
+
logIndex: string;
|
|
241
|
+
rootHash: string;
|
|
242
|
+
treeSize: string;
|
|
243
|
+
hashes: string[];
|
|
244
|
+
checkpoint: {
|
|
245
|
+
envelope: string;
|
|
246
|
+
};
|
|
247
|
+
};
|
|
248
|
+
/** Canonicalized body */
|
|
249
|
+
canonicalizedBody: string;
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Options for signing an artifact
|
|
253
|
+
*/
|
|
254
|
+
export interface SigningOptions {
|
|
255
|
+
/** OIDC options for keyless signing */
|
|
256
|
+
oidc?: OIDCOptions;
|
|
257
|
+
/** Use public Sigstore infrastructure (default: true) */
|
|
258
|
+
usePublicInstance?: boolean;
|
|
259
|
+
/** Custom Fulcio URL */
|
|
260
|
+
fulcioURL?: string;
|
|
261
|
+
/** Custom Rekor URL */
|
|
262
|
+
rekorURL?: string;
|
|
263
|
+
/** Custom TSA (Timestamp Authority) URL */
|
|
264
|
+
tsaURL?: string;
|
|
265
|
+
/** Timeout in milliseconds */
|
|
266
|
+
timeout?: number;
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Result of a signing operation
|
|
270
|
+
*/
|
|
271
|
+
export interface SigningResult {
|
|
272
|
+
/** The signed bundle */
|
|
273
|
+
bundle: SigstoreBundle;
|
|
274
|
+
/** Signing certificate (if keyless signing used) */
|
|
275
|
+
certificate?: FulcioCertificate;
|
|
276
|
+
/** Rekor log entry */
|
|
277
|
+
rekorEntry?: RekorEntry;
|
|
278
|
+
/** Timestamp of signing */
|
|
279
|
+
timestamp: Date;
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Options for verifying an artifact
|
|
283
|
+
*/
|
|
284
|
+
export interface VerificationOptions {
|
|
285
|
+
/** Trust root to use (default: public Sigstore TUF root) */
|
|
286
|
+
trustRoot?: TrustRoot;
|
|
287
|
+
/** Expected identity to verify against */
|
|
288
|
+
expectedIdentity?: ExpectedIdentity;
|
|
289
|
+
/** Use public Sigstore infrastructure (default: true) */
|
|
290
|
+
usePublicInstance?: boolean;
|
|
291
|
+
/** Verify certificate transparency (default: true) */
|
|
292
|
+
verifyCertificateTransparency?: boolean;
|
|
293
|
+
/** Verify timestamp (default: true) */
|
|
294
|
+
verifyTimestamp?: boolean;
|
|
295
|
+
/** Timeout in milliseconds */
|
|
296
|
+
timeout?: number;
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Expected identity for verification
|
|
300
|
+
*/
|
|
301
|
+
export interface ExpectedIdentity {
|
|
302
|
+
/** Expected certificate subject (email or URI) */
|
|
303
|
+
subjectAlternativeName?: string;
|
|
304
|
+
/** Expected OIDC issuer */
|
|
305
|
+
issuer?: string;
|
|
306
|
+
/** Expected GitHub workflow repository */
|
|
307
|
+
workflowRepository?: string;
|
|
308
|
+
/** Expected GitHub workflow ref */
|
|
309
|
+
workflowRef?: string;
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Result of a verification operation
|
|
313
|
+
*/
|
|
314
|
+
export interface VerificationResult {
|
|
315
|
+
/** Whether verification succeeded */
|
|
316
|
+
verified: boolean;
|
|
317
|
+
/** Error message if verification failed */
|
|
318
|
+
error?: string;
|
|
319
|
+
/** Details about verification checks */
|
|
320
|
+
details: VerificationDetails;
|
|
321
|
+
/** Extracted identity from certificate */
|
|
322
|
+
identity?: OIDCIdentity;
|
|
323
|
+
/** Timestamp of artifact creation (from Rekor) */
|
|
324
|
+
timestamp?: Date;
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Detailed verification check results
|
|
328
|
+
*/
|
|
329
|
+
export interface VerificationDetails {
|
|
330
|
+
/** Signature verification passed */
|
|
331
|
+
signatureValid: boolean;
|
|
332
|
+
/** Certificate chain valid */
|
|
333
|
+
certificateValid: boolean;
|
|
334
|
+
/** Certificate within validity period (at signing time) */
|
|
335
|
+
certificateWithinValidity: boolean;
|
|
336
|
+
/** Rekor entry found and valid */
|
|
337
|
+
rekorEntryValid: boolean;
|
|
338
|
+
/** Inclusion proof verified */
|
|
339
|
+
inclusionProofValid: boolean;
|
|
340
|
+
/** Identity matches expected (if specified) */
|
|
341
|
+
identityMatches?: boolean;
|
|
342
|
+
/** Individual check errors */
|
|
343
|
+
errors: string[];
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* Trust root for Sigstore verification
|
|
347
|
+
*/
|
|
348
|
+
export interface TrustRoot {
|
|
349
|
+
/** Trusted certificate authorities (for Fulcio) */
|
|
350
|
+
certificateAuthorities: CertificateAuthority[];
|
|
351
|
+
/** Trusted transparency logs (for Rekor) */
|
|
352
|
+
transparencyLogs: TransparencyLog[];
|
|
353
|
+
/** Timestamp authorities */
|
|
354
|
+
timestampAuthorities?: TimestampAuthority[];
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Certificate authority configuration
|
|
358
|
+
*/
|
|
359
|
+
export interface CertificateAuthority {
|
|
360
|
+
/** CA subject */
|
|
361
|
+
subject: {
|
|
362
|
+
organization?: string;
|
|
363
|
+
commonName?: string;
|
|
364
|
+
};
|
|
365
|
+
/** Root certificate (PEM or DER) */
|
|
366
|
+
rootCertificate: string;
|
|
367
|
+
/** Certificate chain (if intermediate CAs) */
|
|
368
|
+
certificateChain?: string[];
|
|
369
|
+
/** Validity period */
|
|
370
|
+
validFor: {
|
|
371
|
+
start: Date;
|
|
372
|
+
end?: Date;
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* Transparency log configuration
|
|
377
|
+
*/
|
|
378
|
+
export interface TransparencyLog {
|
|
379
|
+
/** Log ID */
|
|
380
|
+
logId: string;
|
|
381
|
+
/** Log public key */
|
|
382
|
+
publicKey: string;
|
|
383
|
+
/** Log URL */
|
|
384
|
+
baseUrl: string;
|
|
385
|
+
/** Hash algorithm used */
|
|
386
|
+
hashAlgorithm: "sha256" | "sha384" | "sha512";
|
|
387
|
+
/** Validity period */
|
|
388
|
+
validFor: {
|
|
389
|
+
start: Date;
|
|
390
|
+
end?: Date;
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* Timestamp authority configuration
|
|
395
|
+
*/
|
|
396
|
+
export interface TimestampAuthority {
|
|
397
|
+
/** TSA subject */
|
|
398
|
+
subject: {
|
|
399
|
+
organization?: string;
|
|
400
|
+
commonName?: string;
|
|
401
|
+
};
|
|
402
|
+
/** TSA certificate chain */
|
|
403
|
+
certificateChain: string[];
|
|
404
|
+
/** Validity period */
|
|
405
|
+
validFor: {
|
|
406
|
+
start: Date;
|
|
407
|
+
end?: Date;
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* Trust policy for evaluating attestations
|
|
412
|
+
*/
|
|
413
|
+
export interface TrustPolicy {
|
|
414
|
+
/** Policy name */
|
|
415
|
+
name: string;
|
|
416
|
+
/** Policy version */
|
|
417
|
+
version: string;
|
|
418
|
+
/** Trusted publishers (by identity) */
|
|
419
|
+
trustedPublishers: TrustedIdentityRule[];
|
|
420
|
+
/** Trusted auditors (can vouch for tools) */
|
|
421
|
+
trustedAuditors: TrustedIdentityRule[];
|
|
422
|
+
/** Required attestation types */
|
|
423
|
+
requiredAttestations?: string[];
|
|
424
|
+
/** Minimum SLSA level required */
|
|
425
|
+
minimumSLSALevel?: 0 | 1 | 2 | 3 | 4;
|
|
426
|
+
/** Allow unsigned tools (default: false) */
|
|
427
|
+
allowUnsigned?: boolean;
|
|
428
|
+
/** Cache verification results */
|
|
429
|
+
cacheResults?: boolean;
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* Rule for matching trusted identities
|
|
433
|
+
*/
|
|
434
|
+
export interface TrustedIdentityRule {
|
|
435
|
+
/** Rule name/description */
|
|
436
|
+
name: string;
|
|
437
|
+
/** Identity type */
|
|
438
|
+
type: "email" | "github-workflow" | "gitlab-pipeline" | "uri";
|
|
439
|
+
/** Pattern to match (supports glob) */
|
|
440
|
+
pattern: string;
|
|
441
|
+
/** Expected OIDC issuer */
|
|
442
|
+
issuer?: string;
|
|
443
|
+
/** Required claims */
|
|
444
|
+
requiredClaims?: Record<string, string | string[]>;
|
|
445
|
+
}
|
|
446
|
+
/**
|
|
447
|
+
* Result of trust policy evaluation
|
|
448
|
+
*/
|
|
449
|
+
export interface TrustPolicyResult {
|
|
450
|
+
/** Whether the artifact is trusted */
|
|
451
|
+
trusted: boolean;
|
|
452
|
+
/** Trust level (0 = unsigned, 1-4 = SLSA levels) */
|
|
453
|
+
trustLevel: 0 | 1 | 2 | 3 | 4;
|
|
454
|
+
/** Matched publisher rule (if any) */
|
|
455
|
+
matchedPublisher?: TrustedIdentityRule;
|
|
456
|
+
/** Matched auditor rules (if any) */
|
|
457
|
+
matchedAuditors: TrustedIdentityRule[];
|
|
458
|
+
/** Policy evaluation details */
|
|
459
|
+
details: {
|
|
460
|
+
/** All verified attestations */
|
|
461
|
+
attestations: VerifiedAttestation[];
|
|
462
|
+
/** Policy violations */
|
|
463
|
+
violations: string[];
|
|
464
|
+
/** Warnings */
|
|
465
|
+
warnings: string[];
|
|
466
|
+
};
|
|
467
|
+
}
|
|
468
|
+
/**
|
|
469
|
+
* A verified attestation with metadata
|
|
470
|
+
*/
|
|
471
|
+
export interface VerifiedAttestation {
|
|
472
|
+
/** Attestation type */
|
|
473
|
+
type: string;
|
|
474
|
+
/** Predicate type */
|
|
475
|
+
predicateType: string;
|
|
476
|
+
/** Signer identity */
|
|
477
|
+
signer: OIDCIdentity;
|
|
478
|
+
/** Verification timestamp */
|
|
479
|
+
verifiedAt: Date;
|
|
480
|
+
/** Full attestation content */
|
|
481
|
+
attestation: InTotoStatement;
|
|
482
|
+
}
|
|
483
|
+
/**
|
|
484
|
+
* Enact tool attestation predicate
|
|
485
|
+
*/
|
|
486
|
+
export interface EnactToolPredicate {
|
|
487
|
+
/** Enact-specific predicate type */
|
|
488
|
+
type: "https://enact.tools/attestation/tool/v1";
|
|
489
|
+
/** Tool metadata */
|
|
490
|
+
tool: {
|
|
491
|
+
/** Tool name */
|
|
492
|
+
name: string;
|
|
493
|
+
/** Tool version */
|
|
494
|
+
version: string;
|
|
495
|
+
/** Tool publisher */
|
|
496
|
+
publisher: string;
|
|
497
|
+
/** Tool description */
|
|
498
|
+
description?: string;
|
|
499
|
+
/** Tool repository */
|
|
500
|
+
repository?: string;
|
|
501
|
+
};
|
|
502
|
+
/** Build information */
|
|
503
|
+
build?: {
|
|
504
|
+
/** Build timestamp */
|
|
505
|
+
timestamp: string;
|
|
506
|
+
/** Build environment */
|
|
507
|
+
environment?: Record<string, string>;
|
|
508
|
+
/** Source commit */
|
|
509
|
+
sourceCommit?: string;
|
|
510
|
+
};
|
|
511
|
+
/** Security audit information */
|
|
512
|
+
audit?: {
|
|
513
|
+
/** Auditor identity */
|
|
514
|
+
auditor: string;
|
|
515
|
+
/** Audit timestamp */
|
|
516
|
+
timestamp: string;
|
|
517
|
+
/** Audit result */
|
|
518
|
+
result: "passed" | "passed-with-warnings" | "failed";
|
|
519
|
+
/** Audit notes */
|
|
520
|
+
notes?: string;
|
|
521
|
+
};
|
|
522
|
+
}
|
|
523
|
+
/**
|
|
524
|
+
* Enact attestation bundle (tool manifest + attestations)
|
|
525
|
+
*/
|
|
526
|
+
export interface EnactAttestationBundle {
|
|
527
|
+
/** Bundle format version */
|
|
528
|
+
version: "1.0";
|
|
529
|
+
/** Tool manifest hash */
|
|
530
|
+
manifestHash: {
|
|
531
|
+
algorithm: "sha256";
|
|
532
|
+
digest: string;
|
|
533
|
+
};
|
|
534
|
+
/** Publisher attestation (required) */
|
|
535
|
+
publisherAttestation: SigstoreBundle;
|
|
536
|
+
/** Auditor attestations (optional) */
|
|
537
|
+
auditorAttestations?: SigstoreBundle[];
|
|
538
|
+
/** Provenance attestation (optional) */
|
|
539
|
+
provenanceAttestation?: Sig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E,QAAQ,CAAC;QACpB,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,uCAAuC;IACvC,oBAAoB,EAAE,cAAc,CAAC;IACrC,sCAAsC;IACtC,mBAAmB,CAAC,EAAE,cAAc,EAAE,CAAC;IACvC,wCAAwC;IACxC,qBAAqB,CAAC,EAAE,cAAc,CAAC;CACxC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/sigstore/types.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sigstore verification module
|
|
3
|
+
*
|
|
4
|
+
* This module provides verification capabilities for Sigstore bundles and attestations.
|
|
5
|
+
* It verifies signatures, certificates, and transparency log entries.
|
|
6
|
+
*
|
|
7
|
+
* NOTE: This implementation bypasses TUF (The Update Framework) and uses bundled trusted
|
|
8
|
+
* roots directly. This is necessary for Bun compatibility because TUF verification fails
|
|
9
|
+
* with BoringSSL's stricter signature algorithm requirements.
|
|
10
|
+
*/
|
|
11
|
+
import type { SigstoreBundle, VerificationOptions, VerificationResult } from "./types";
|
|
12
|
+
/**
|
|
13
|
+
* Verify a Sigstore bundle
|
|
14
|
+
*
|
|
15
|
+
* @param bundle - The Sigstore bundle to verify
|
|
16
|
+
* @param artifact - Optional artifact data (for message signature bundles)
|
|
17
|
+
* @param options - Verification options
|
|
18
|
+
* @returns Verification result with detailed checks
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* const result = await verifyBundle(bundle, artifact, {
|
|
23
|
+
* expectedIdentity: {
|
|
24
|
+
* subjectAlternativeName: "user@example.com",
|
|
25
|
+
* issuer: "https://accounts.google.com"
|
|
26
|
+
* }
|
|
27
|
+
* });
|
|
28
|
+
* if (result.verified) {
|
|
29
|
+
* console.log("Bundle verified successfully");
|
|
30
|
+
* }
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare function verifyBundle(bundle: SigstoreBundle, artifact?: Buffer, options?: VerificationOptions): Promise<VerificationResult>;
|
|
34
|
+
/**
|
|
35
|
+
* Create a reusable verifier for multiple verifications
|
|
36
|
+
*
|
|
37
|
+
* @param options - Verification options
|
|
38
|
+
* @returns A verifier object that can verify multiple bundles
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* const verifier = await createBundleVerifier({
|
|
43
|
+
* expectedIdentity: { issuer: "https://accounts.google.com" }
|
|
44
|
+
* });
|
|
45
|
+
*
|
|
46
|
+
* // Verify multiple bundles efficiently
|
|
47
|
+
* for (const bundle of bundles) {
|
|
48
|
+
* verifier.verify(bundle);
|
|
49
|
+
* }
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
export declare function createBundleVerifier(options?: VerificationOptions): Promise<{
|
|
53
|
+
/**
|
|
54
|
+
* Verify a bundle using the cached verifier
|
|
55
|
+
*/
|
|
56
|
+
verify: (bundle: SigstoreBundle, artifact?: Buffer) => Promise<VerificationResult>;
|
|
57
|
+
}>;
|
|
58
|
+
/**
|
|
59
|
+
* Quick verification check - returns boolean only
|
|
60
|
+
*
|
|
61
|
+
* @param bundle - The Sigstore bundle to verify
|
|
62
|
+
* @param artifact - Optional artifact data
|
|
63
|
+
* @returns True if verification passes, false otherwise
|
|
64
|
+
*/
|
|
65
|
+
export declare function isVerified(bundle: SigstoreBundle, artifact?: Buffer): Promise<boolean>;
|
|
66
|
+
//# sourceMappingURL=verification.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verification.d.ts","sourceRoot":"","sources":["../../src/sigstore/verification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAQH,OAAO,KAAK,EAGV,cAAc,EAEd,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,SAAS,CAAC;AA6CjB;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,cAAc,EACtB,QAAQ,CAAC,EAAE,MAAM,EACjB,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,kBAAkB,CAAC,CAwE7B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,oBAAoB,CAAC,OAAO,GAAE,mBAAwB;IAMxE;;OAEG;qBACoB,cAAc,aAAa,MAAM,KAAG,OAAO,CAAC,kBAAkB,CAAC;GA+DzF;AAED;;;;;;GAMG;AACH,wBAAsB,UAAU,CAAC,MAAM,EAAE,cAAc,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAW5F"}
|