Skip to content

Commit e031b44

Browse files
committed
docs: add docs for cosign identity matching
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
1 parent 0b00ba2 commit e031b44

File tree

2 files changed

+36
-2
lines changed

2 files changed

+36
-2
lines changed

docs/spec/v1beta2/helmcharts.md

+18-1
Original file line numberDiff line numberDiff line change
@@ -253,11 +253,13 @@ For practical information, see
253253
**Note:** This feature is available only for Helm charts fetched from an OCI Registry.
254254

255255
`.spec.verify` is an optional field to enable the verification of [Cosign](https://github.com/sigstore/cosign)
256-
signatures. The field offers two subfields:
256+
signatures. The field offers three subfields:
257257

258258
- `.provider`, to specify the verification provider. Only supports `cosign` at present.
259259
- `.secretRef.name`, to specify a reference to a Secret in the same namespace as
260260
the HelmChart, containing the Cosign public keys of trusted authors.
261+
- `.matchOIDCIdentity`, to specify a list of OIDC identity matchers. Please see
262+
[Keyless verification](#keyless-verification) for more details.
261263

262264
```yaml
263265
---
@@ -307,6 +309,18 @@ For publicly available HelmCharts, which are signed using the
307309
[Cosign Keyless](https://github.com/sigstore/cosign/blob/main/KEYLESS.md) procedure,
308310
you can enable the verification by omitting the `.verify.secretRef` field.
309311

312+
To verify the identity subject and the OIDC issuer present in the Fulcio
313+
certificate, you can specify a list of OIDC identity matchers using
314+
`.spec.verify.matchOIDCIdentity`. The matcher provides two required fields:
315+
316+
- `.issuer`, to specify a regexp that matches against the OIDC issuer.
317+
- `.subject`, to specify a regexp that matches against the subject identity in
318+
the certificate.
319+
Both values should follow the [Go regular expression syntax](https://golang.org/s/re2syntax).
320+
321+
The matchers are evaluated in an OR fashion, i.e. the identity is deemed to be
322+
verified if any one matcher successfully matches against the identity.
323+
310324
Example of verifying HelmCharts signed by the
311325
[Cosign GitHub Action](https://github.com/sigstore/cosign-installer) with GitHub OIDC Token:
312326

@@ -325,6 +339,9 @@ spec:
325339
version: ">=6.1.6"
326340
verify:
327341
provider: cosign
342+
matchOIDCIdentity:
343+
- issuer: "^https://token.actions.githubusercontent.com$"
344+
subject: "^https://github.com/stefanprodan/podinfo.*$"
328345
```
329346

330347
```yaml

docs/spec/v1beta2/ocirepositories.md

+18-1
Original file line numberDiff line numberDiff line change
@@ -501,11 +501,13 @@ for more information.
501501
### Verification
502502

503503
`.spec.verify` is an optional field to enable the verification of [Cosign](https://github.com/sigstore/cosign)
504-
signatures. The field offers two subfields:
504+
signatures. The field offers three subfields:
505505

506506
- `.provider`, to specify the verification provider. Only supports `cosign` at present.
507507
- `.secretRef.name`, to specify a reference to a Secret in the same namespace as
508508
the OCIRepository, containing the Cosign public keys of trusted authors.
509+
- `.matchOIDCIdentity`, to specify a list of OIDC identity matchers. Please see
510+
[Keyless verification](#keyless-verification) for more details.
509511

510512
```yaml
511513
---
@@ -555,6 +557,18 @@ For publicly available OCI artifacts, which are signed using the
555557
[Cosign Keyless](https://github.com/sigstore/cosign/blob/main/KEYLESS.md) procedure,
556558
you can enable the verification by omitting the `.verify.secretRef` field.
557559

560+
To verify the identity subject and the OIDC issuer present in the Fulcio
561+
certificate, you can specify a list of OIDC identity matchers using
562+
`.spec.verify.matchOIDCIdentity`. The matcher provides two required fields:
563+
564+
- `.issuer`, to specify a regexp that matches against the OIDC issuer.
565+
- `.subject`, to specify a regexp that matches against the subject identity in
566+
the certificate.
567+
Both values should follow the [Go regular expression syntax](https://golang.org/s/re2syntax).
568+
569+
The matchers are evaluated in an OR fashion, i.e. the identity is deemed to be
570+
verified if any one matcher successfully matches against the identity.
571+
558572
Example of verifying artifacts signed by the
559573
[Cosign GitHub Action](https://github.com/sigstore/cosign-installer) with GitHub OIDC Token:
560574

@@ -568,6 +582,9 @@ spec:
568582
url: oci://ghcr.io/stefanprodan/manifests/podinfo
569583
verify:
570584
provider: cosign
585+
matchOIDCIdentity:
586+
- issuer: "^https://token.actions.githubusercontent.com$"
587+
subject: "^https://github.com/stefanprodan/podinfo.*$"
571588
```
572589

573590
The controller verifies the signatures using the Fulcio root CA and the Rekor

0 commit comments

Comments
 (0)