-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move codefresh and buildkite to ci-provider identity (#1743)
* migrating codefresh and buildkite to ci provider Signed-off-by: Javan lacerda <[email protected]> * adding test case for comparing with empty key Signed-off-by: Javan lacerda <[email protected]> * add comments for codefresh extensions Signed-off-by: Javan lacerda <[email protected]> * set claimed data to have priority over defaults Signed-off-by: Javan lacerda <[email protected]> * fix identation Signed-off-by: Javan lacerda <[email protected]> * adding comments for github and gitlab in config file Signed-off-by: Javan lacerda <[email protected]> * adding tests for check claims priority over defaults Signed-off-by: Javan lacerda <[email protected]> --------- Signed-off-by: Javan lacerda <[email protected]>
- Loading branch information
1 parent
8546472
commit 7600ff2
Showing
4 changed files
with
136 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,8 @@ | |
define: | ||
- &github-type "github-workflow" | ||
- &gitlab-type "gitlab-pipeline" | ||
- &codefresh-type "codefresh-workflow" | ||
- &buildkite-type "buildkite-job" | ||
oidc-issuers: | ||
https://accounts.google.com: | ||
issuer-url: https://accounts.google.com | ||
|
@@ -25,7 +27,8 @@ oidc-issuers: | |
https://agent.buildkite.com: | ||
issuer-url: https://agent.buildkite.com | ||
client-id: sigstore | ||
type: buildkite-job | ||
type: ci-provider | ||
ci-provider: *buildkite-type | ||
contact: [email protected] | ||
description: "Buildkite Agent OIDC tokens for job identity" | ||
https://allow.pub: | ||
|
@@ -84,7 +87,8 @@ oidc-issuers: | |
https://oidc.codefresh.io: | ||
issuer-url: https://oidc.codefresh.io | ||
client-id: sigstore | ||
type: codefresh-workflow | ||
type: ci-provider | ||
ci-provider: *codefresh-type | ||
contact: [email protected] | ||
description: "Codefresh OIDC tokens for job identity" | ||
https://ops.gitlab.net: | ||
|
@@ -120,45 +124,114 @@ meta-issuers: | |
ci-provider: *github-type | ||
ci-issuer-metadata: | ||
*github-type: | ||
default-template-values: | ||
url: "https://github.com" | ||
extension-templates: | ||
github-workflow-trigger: "event_name" | ||
github-workflow-sha: "sha" | ||
github-workflow-name: "workflow" | ||
github-workflow-repository: "repository" | ||
github-workflow-ref: "ref" | ||
build-signer-uri: "{{ .url }}/{{ .job_workflow_ref }}" | ||
build-signer-digest: "job_workflow_sha" | ||
runner-environment: "runner_environment" | ||
source-repository-uri: "{{ .url }}/{{ .repository }}" | ||
source-repository-digest: "sha" | ||
source-repository-ref: "ref" | ||
source-repository-identifier: "repository_id" | ||
source-repository-owner-uri: "{{ .url }}/{{ .repository_owner }}" | ||
source-repository-owner-identifier: "repository_owner_id" | ||
build-config-uri: "{{ .url }}/{{ .workflow_ref }}" | ||
build-config-digest: "workflow_sha" | ||
build-trigger: "event_name" | ||
run-invocation-uri: "{{ .url }}/{{ .repository }}/actions/runs/{{ .run_id }}/attempts/{{ .run_attempt }}" | ||
source-repository-visibility-at-signing: "repository_visibility" | ||
subject-alternative-name-template: "{{ .url }}/{{ .job_workflow_ref }}" | ||
default-template-values: | ||
# url: URL of issuer, https://github.com | ||
url: "https://github.com" | ||
extension-templates: | ||
# event_name: Event that triggered this workflow run. E.g "push", "tag" | ||
github-workflow-trigger: "event_name" | ||
# sha: Commit SHA being built | ||
github-workflow-sha: "sha" | ||
# workflow (Deprecated): Name of workflow that is running (mutable) | ||
github-workflow-name: "workflow" | ||
# repository: Name of repository being built | ||
github-workflow-repository: "repository" | ||
# ref: Git ref being built | ||
github-workflow-ref: "ref" | ||
# job_workflow_ref: Specific build instructions (i.e. reusable workflow) | ||
build-signer-uri: "{{ .url }}/{{ .job_workflow_ref }}" | ||
# job_workflow_sha: Commit SHA to specific build instructions | ||
build-signer-digest: "job_workflow_sha" | ||
# runner_environment: Whether the build took place in cloud or self-hosted infrastructure | ||
runner-environment: "runner_environment" | ||
# repository: Name of repository being built | ||
source-repository-uri: "{{ .url }}/{{ .repository }}" | ||
source-repository-digest: "sha" | ||
source-repository-ref: "ref" | ||
# repository_id: ID to the source repo | ||
source-repository-identifier: "repository_id" | ||
# repository_owner: Owner of the source repo (mutable) | ||
source-repository-owner-uri: "{{ .url }}/{{ .repository_owner }}" | ||
# repository_owner_id: ID of the source repo | ||
source-repository-owner-identifier: "repository_owner_id" | ||
# workflow_ref: Ref of top-level workflow that is running | ||
build-config-uri: "{{ .url }}/{{ .workflow_ref }}" | ||
# workflow_sha: Commit SHA of top-level workflow that is running | ||
build-config-digest: "workflow_sha" | ||
build-trigger: "event_name" | ||
# run_id: ID of workflow run | ||
# run_attempt: Attempt number of workflow run | ||
run-invocation-uri: "{{ .url }}/{{ .repository }}/actions/runs/{{ .run_id }}/attempts/{{ .run_attempt }}" | ||
# repository_visibility: Visibility of the source repo | ||
source-repository-visibility-at-signing: "repository_visibility" | ||
subject-alternative-name-template: "{{ .url }}/{{ .job_workflow_ref }}" | ||
*gitlab-type: | ||
default-template-values: | ||
url: "https://gitlab.com" | ||
url: "https://gitlab.com" | ||
extension-templates: | ||
build-signer-uri: "https://{{ .ci_config_ref_uri }}" | ||
build-signer-digest: "ci_config_sha" | ||
runner-environment: "runner_environment" | ||
source-repository-uri: "{{ .url }}/{{ .repository }}" | ||
source-repository-digest: "sha" | ||
source-repository-ref: refs/{{if eq .ref_type "branch"}}heads/{{ else }}tags/{{end}}/{{ .ref }} | ||
source-repository-identifier: "project_id" | ||
source-repository-owner-uri: "{{ .url }}/{{ .namespace_path }}" | ||
source-repository-owner-identifier: "namespace_id" | ||
build-config-uri: "https://{{ .ci_config_ref_uri }}" | ||
build-config-digest: "ci_config_sha" | ||
build-trigger: "pipeline_source" | ||
run-invocation-uri: "{{ .url }}/{{ .project_path }}/-/jobs/{{ .job_id }}" | ||
source-repository-visibility-at-signing: "repository_visibility" | ||
# url: The URL of the GitLab instance. https://gitlab.com | ||
# ci_config_ref_uri: Ref of top-level pipeline definition. | ||
# E.g. gitlab.com/my-group/my-project//.gitlab-ci.yml@refs/heads/main | ||
build-signer-uri: "https://{{ .ci_config_ref_uri }}" | ||
# ci_config_sha: Commit sha of top-level pipeline definition, and is | ||
# only populated when `ciConfigRefURI` is local to the GitLab instance | ||
build-signer-digest: "ci_config_sha" | ||
# runner_environment: The type of runner used by the job. May be one of gitlab-hosted or self-hosted. | ||
runner-environment: "runner_environment" | ||
# repository: Repository building built | ||
source-repository-uri: "{{ .url }}/{{ .repository }}" | ||
# sha: Commit SHA being built | ||
source-repository-digest: "sha" | ||
# ref_type: The type of the ref | ||
# E.g. "branch", "tag" | ||
# ref: Git ref being built | ||
source-repository-ref: refs/{{if eq .ref_type "branch"}}heads/{{ else }}tags/{{end}}/{{ .ref }} | ||
# project_id: ID to the source repo | ||
source-repository-identifier: "project_id" | ||
# namespace_path: Owner of the source repo (mutable) | ||
source-repository-owner-uri: "{{ .url }}/{{ .namespace_path }}" | ||
# namespace_id: ID of the source repo | ||
source-repository-owner-identifier: "namespace_id" | ||
build-config-uri: "https://{{ .ci_config_ref_uri }}" | ||
build-config-digest: "ci_config_sha" | ||
# pipeline_source: Event that triggered this workflow run. E.g "push", "tag" etc | ||
build-trigger: "pipeline_source" | ||
# project_path: Repository building built | ||
# job_id: job ID | ||
run-invocation-uri: "{{ .url }}/{{ .project_path }}/-/jobs/{{ .job_id }}" | ||
# project_visibility: Visibility of the source project | ||
source-repository-visibility-at-signing: "project_visibility" | ||
subject-alternative-name-template: "https://{{ .ci_config_ref_uri }}" | ||
*codefresh-type: | ||
default-template-values: | ||
# We are setting the default value for "platform_url" as the ci-provider | ||
# principal gives priority to the claimed value over the default | ||
# when they have the same name. Then it will use the default "platform_url" value | ||
# for cases that the claimed data doesn't exist. | ||
# platform_url: Codefresh platform url | ||
platform_url: "https://g.codefresh.io" | ||
extension-templates: | ||
# workflow_id: The ID of the specific workflow authorized in the claim. | ||
# For example, 64f447c02199f903000gh20. | ||
build-signer-uri: "{{.platform_url}}/build/{{ .workflow_id }}" | ||
# runner_environment: Whether the build took place in cloud or self-hosted infrastructure | ||
runner-environment: "runner_environment" | ||
# scm_repo_url: Applies to Git push, PR, and manual Git trigger types. | ||
# The SCM URL specifying the Git repository’s location. | ||
# For example, https://github.com/codefresh-user/oidc-test | ||
source-repository-uri: "scm_repo_url" | ||
# scm_ref: Applies to Git push, PR, and manual Git trigger types. | ||
# The SCM name of the branch or tag within the Git repository | ||
# for which the workflow should execute. For example, main or v1.0.0. | ||
source-repository-ref: "scm_ref" | ||
# pipeline_id: Codefresh Pipeline id | ||
build-config-uri: "{{.platform_url}}/api/pipelines/{{ .pipeline_id }}" | ||
# account_name: Codefresh account name | ||
# pipeline_name: Codefresh pipline name (project/pipeline) | ||
# account_id: Codefresh account id | ||
run-invocation-uri: "{{.platform_url}}/build/{{ .workflow_id }}" | ||
subject-alternative-name-template: "{{.platform_url}}/{{.account_name}}/{{.pipeline_name}}:{{.account_id}}/{{.pipeline_id}}" | ||
*buildkite-type: | ||
default-template-values: | ||
url: "https://buildkite.com" | ||
subject-alternative-name-template: "{{.url}}/{{.organization_slug}}/{{.pipeline_slug}}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters