Skip to content

Commit

Permalink
Removes identity providers federation (#1736)
Browse files Browse the repository at this point in the history
Removes the identity providers federation, and update the documentation for adding new identity providers, including ci-providers.

Ref #1111

Signed-off-by: Javan Lacerda <[email protected]>
  • Loading branch information
javanlacerda authored Jul 17, 2024
1 parent b879601 commit 6db2b36
Show file tree
Hide file tree
Showing 17 changed files with 42 additions and 267 deletions.
25 changes: 25 additions & 0 deletions config/identity/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,52 +17,76 @@ oidc-issuers:
issuer-url: https://accounts.google.com
client-id: sigstore
type: email
contact: [email protected]
description: "Google OIDC auth"
https://agent.buildkite.com:
issuer-url: https://agent.buildkite.com
client-id: sigstore
type: buildkite-job
contact: [email protected]
description: "Buildkite Agent OIDC tokens for job identity"
https://allow.pub:
issuer-url: https://allow.pub
client-id: sigstore
type: spiffe
spiffe-trust-domain: allow.pub
contact: [email protected]
description: "Server side signing support for the OCI registry vcr.pub"
https://auth.eclipse.org/auth/realms/sigstore:
issuer-url: https://auth.eclipse.org/auth/realms/sigstore
client-id: sigstore
type: email
contact: [email protected]
description: "Eclipse Foundation Production OIDC provider"
https://dev.gitlab.org:
issuer-url: https://dev.gitlab.org
client-id: sigstore
type: gitlab-pipeline
contact: [email protected]
description: "GitLab OIDC tokens for job identity"
https://gitlab.archlinux.org:
issuer-url: https://gitlab.archlinux.org
client-id: sigstore
type: gitlab-pipeline
contact: [email protected]
description: "GitLab OIDC tokens for job identity"
https://gitlab.com:
issuer-url: https://gitlab.com
client-id: sigstore
type: gitlab-pipeline
contact: [email protected]
description: "GitLab OIDC tokens for job identity"
https://issuer.enforce.dev:
issuer-url: https://issuer.enforce.dev
client-id: sigstore
type: chainguard-identity
contact: [email protected]
description: "Chainguard identity tokens"
https://oauth2.sigstore.dev/auth:
issuer-url: https://oauth2.sigstore.dev/auth
client-id: sigstore
type: email
issuer-claim: $.federated_claims.connector_id
contact: [email protected]
description: "dex address for fulcio"
https://oidc.codefresh.io:
issuer-url: https://oidc.codefresh.io
client-id: sigstore
type: codefresh-workflow
contact: [email protected]
description: "Codefresh OIDC tokens for job identity"
https://ops.gitlab.net:
issuer-url: https://ops.gitlab.net
client-id: sigstore
type: gitlab-pipeline
contact: [email protected]
description: "GitLab OIDC tokens for job identity"
https://token.actions.githubusercontent.com:
issuer-url: https://token.actions.githubusercontent.com
client-id: sigstore
type: github-workflow
contact: [email protected]
description: "GitHub Actions OIDC auth"
meta-issuers:
https://*.oic.prod-aks.azure.com/*:
client-id: sigstore
Expand All @@ -79,3 +103,4 @@ meta-issuers:
https://token.actions.githubusercontent.com/*:
client-id: sigstore
type: github-workflow

19 changes: 12 additions & 7 deletions docs/oidc.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,18 @@ Sigstore runs a federated OIDC identity provider, Dex. Users authenticate to the

To add a new OIDC issuer:

* Add the new issuer to the [configuration](https://github.com/sigstore/fulcio/blob/main/config/identity/config.yaml) and to the [`identity` folder](https://github.com/sigstore/fulcio/tree/main/pkg/identity) ([example](https://github.com/sigstore/fulcio/tree/main/pkg/identity/buildkite)). You will define an `Issuer` type and a way to map the token to the certificate extensions.
* Define a constant with the issuer type name in the [configuration](https://github.com/sigstore/fulcio/blob/afeadb3b7d11f704489637cabc4e150dea3e00ed/pkg/config/config.go#L213-L221), add update the [tests](https://github.com/sigstore/fulcio/blob/afeadb3b7d11f704489637cabc4e150dea3e00ed/pkg/config/config_test.go#L473-L503)
* Map the issuer type to the token claim that will be signed over when requesting a token [here](https://github.com/sigstore/fulcio/blob/afeadb3b7d11f704489637cabc4e150dea3e00ed/pkg/config/config.go#L464-L486). You can likely just use `sub`.
* Add a case statement to map the issuer constant to the issuer type you created [here](https://github.com/sigstore/fulcio/blob/4d9d96a/pkg/server/issuer_pool.go#L40-L62)
* Update the end-to-end gRPC tests:
* Update the [configuration test](https://github.com/sigstore/fulcio/blob/572b7c8496c29a04721f608dd0307ba08773c60c/pkg/server/grpc_server_test.go#L175)
* Add a test for the new issuer ([example](https://github.com/sigstore/fulcio/blob/572b7c8496c29a04721f608dd0307ba08773c60c/pkg/server/grpc_server_test.go#L331))
* Add the new issuer to the [configuration](https://github.com/sigstore/fulcio/blob/main/config/identity/config.yaml).
* Attention: If your issuer is for a CI provider, you should set the `type` as `ci-provider` and set the field `ci-provider` with the name of your provider. You should also fill the `ci-issuer-metadata` with the `default-template-values`, `extension-templates` and `subject-alternative-name-template`, following the pattern defined on the example ([example](tbd after migrating the github to ci-provider)).
* Important notes: The `extension-templates` and the `subject-alternative-name-template` follows the templates [pattern](https://pkg.go.dev/text/template). The name used to fill the `ci-provider` field has to be the same used as key for `ci-issuer-metadata`, we suggest to use a variable for this.
* If your issuer is not for a CI provider, you need to follow the next steps:
* Add the new issuer to the [`identity` folder](https://github.com/sigstore/fulcio/tree/main/pkg/identity) ([example](https://github.com/sigstore/fulcio/tree/main/pkg/identity/email)). You will define an `Issuer` type and a way to map the token to the certificate extensions.
* Define a constant with the issuer type name in the [configuration](https://github.com/sigstore/fulcio/blob/afeadb3b7d11f704489637cabc4e150dea3e00ed/pkg/config/config.go#L213-L221), add update the [tests](https://github.com/sigstore/fulcio/blob/afeadb3b7d11f704489637cabc4e150dea3e00ed/pkg/config/config_test.go#L473-L503)
* Map the issuer type to the token claim that will be signed over when requesting a token [here](https://github.com/sigstore/fulcio/blob/afeadb3b7d11f704489637cabc4e150dea3e00ed/pkg/config/config.go#L464-L486). You can likely just use `sub`.
* Add a case statement to map the issuer constant to the issuer type you created [here](https://github.com/sigstore/fulcio/blob/4d9d96a/pkg/server/issuer_pool.go#L40-L62)
* These next steps are required only for non-ci issuers, as it is already tested for generically. Although, you are welcome to add tests for your provider if you want to.
* Update the end-to-end gRPC tests:
* Update the [configuration test](https://github.com/sigstore/fulcio/blob/572b7c8496c29a04721f608dd0307ba08773c60c/pkg/server/grpc_server_test.go#L175)
* Add a test for the new issuer ([example](https://github.com/sigstore/fulcio/blob/572b7c8496c29a04721f608dd0307ba08773c60c/pkg/server/grpc_server_test.go#L331))

See [this example](https://github.com/sigstore/fulcio/pull/890), although it is out of date as you'll now need to create an issuer type.

Expand Down
23 changes: 0 additions & 23 deletions federation/README.md

This file was deleted.

18 changes: 0 additions & 18 deletions federation/accounts.google.com/config.yaml

This file was deleted.

18 changes: 0 additions & 18 deletions federation/agent.buildkite.com/config.yaml

This file was deleted.

18 changes: 0 additions & 18 deletions federation/auth-staging.eclipse.org/config.yaml

This file was deleted.

18 changes: 0 additions & 18 deletions federation/auth.eclipse.org/config.yaml

This file was deleted.

18 changes: 0 additions & 18 deletions federation/dev.gitlab.org/config.yaml

This file was deleted.

19 changes: 0 additions & 19 deletions federation/external/allow.pub/config.yaml

This file was deleted.

18 changes: 0 additions & 18 deletions federation/gitlab.archlinux.org/config.yaml

This file was deleted.

18 changes: 0 additions & 18 deletions federation/gitlab.com/config.yaml

This file was deleted.

19 changes: 0 additions & 19 deletions federation/issuer.enforce.dev/config.yaml

This file was deleted.

19 changes: 0 additions & 19 deletions federation/oauth2.sigstore.dev/config.yaml

This file was deleted.

18 changes: 0 additions & 18 deletions federation/oidc.codefresh.io/config.yaml

This file was deleted.

18 changes: 0 additions & 18 deletions federation/ops.gitlab.net/config.yaml

This file was deleted.

18 changes: 0 additions & 18 deletions federation/token.actions.githubusercontent.com/config.yaml

This file was deleted.

5 changes: 5 additions & 0 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ type OIDCIssuer struct {
// Optional, the challenge claim expected for the issuer
// Set if using a custom issuer
ChallengeClaim string `json:"ChallengeClaim,omitempty" yaml:"challenge-claim,omitempty"`
// Optional, the description for the issuer
Description string `json:"Description,omitempty" yaml:"description,omitempty"`
// Optional, the contact for the issuer team
// Usually it is a email
Contact string `json:"Contact,omitempty" yaml:"contact,omitempty"`
}

func metaRegex(issuer string) (*regexp.Regexp, error) {
Expand Down

0 comments on commit 6db2b36

Please sign in to comment.