Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for GitLab to docs #216

Merged
merged 1 commit into from
Aug 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion content/en/about/security.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,24 @@

## Proving Identity in Sigstore

Sigstore relies on the widely used OpenID Connect (OIDC) protocol to prove identity. When running something like `cosign sign`, users will complete an OIDC flow and authenticate via an identity provider (GitHub, Google, etc.) to prove they are the owner of their account. Similarly, automated systems (like GitHub Actions) can use Workload Identity or [SPIFFE](https://spiffe.io/) Verifiable Identity Documents (SVIDs) to authenticate themselves via OIDC. The identity and issuer associated with the OIDC token is embedded in the short-lived certificate issued by Sigstore’s Certificate Authority, Fulcio.
Sigstore relies on the widely used OpenID Connect (OIDC) protocol to prove identity. When running something like `cosign sign`, users will complete an OIDC flow and authenticate via an identity provider (GitHub, GitLab, Google, etc.) to prove they are the owner of their account. Similarly, automated systems (like GitHub Actions) can use Workload Identity or [SPIFFE](https://spiffe.io/) Verifiable Identity Documents (SVIDs) to authenticate themselves via OIDC. The identity and issuer associated with the OIDC token is embedded in the short-lived certificate issued by Sigstore’s Certificate Authority, Fulcio.

Check failure on line 13 in content/en/about/security.md

View workflow job for this annotation

GitHub Actions / markdownlint

Trailing spaces

content/en/about/security.md:13:614 MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1] https://github.com/DavidAnson/markdownlint/blob/v0.29.0/doc/md009.md

## Sigstore’s Trust Model

Sigstore’s trust model originates from the Trust Root and chains down to short-lived certificates issued by Fulcio.

Check failure on line 17 in content/en/about/security.md

View workflow job for this annotation

GitHub Actions / markdownlint

Trailing spaces

content/en/about/security.md:17:116 MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1] https://github.com/DavidAnson/markdownlint/blob/v0.29.0/doc/md009.md

### Sigstore’s Trust Root

The Trust Root, which was established during a public [root key signing ceremony](https://www.youtube.com/watch?v=GEuFsc8Zm9U), is made up of a rotation of five keyholders from varying companies and academic institutions who contribute to Sigstore. It leverages the principles of [The Update Framework](https://theupdateframework.io/) (TUF), a set of defined attacks and threat models specific to software distribution systems. TUF provides a cleverly designed set of protocols to protect against these types of attacks, which the Trust Root follows.

The Sigstore Trust Root is used to secure the keys used by the entire Sigstore project. It allows individuals and systems to automatically retrieve trusted keys and certificates used to verify artifacts produced by the Sigstore ecosystem. Using the Sigstore Trust Root, end users can verify:
* Certificates issued by Fulcio

Check failure on line 24 in content/en/about/security.md

View workflow job for this annotation

GitHub Actions / markdownlint

Lists should be surrounded by blank lines

content/en/about/security.md:24 MD032/blanks-around-lists Lists should be surrounded by blank lines [Context: "* Certificates issued by Fulci..."] https://github.com/DavidAnson/markdownlint/blob/v0.29.0/doc/md032.md
* Entries in the Rekor transparency log
This allows end users to verify (and trust) that the distributors of the software they use are who they say they are.

For more details on the Trust Root or the key signing ceremony, see [A New Kind of Trust Root](https://blog.sigstore.dev/a-new-kind-of-trust-root-f11eeeed92ef). For an overview of TUF, see [The Update Framework and You](https://blog.sigstore.dev/the-update-framework-and-you-2f5cbaa964d5).

### Rekor Security Model

Check failure on line 30 in content/en/about/security.md

View workflow job for this annotation

GitHub Actions / markdownlint

Headings should be surrounded by blank lines

content/en/about/security.md:30 MD022/blanks-around-headings/blanks-around-headers Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "### Rekor Security Model"] https://github.com/DavidAnson/markdownlint/blob/v0.29.0/doc/md022.md
The Rekor service provides a transparency log of software signatures. The log is append-only and once entries are added they cannot be modified; a valid log can be cryptographically verified by any third-party. As entries are appended into this log, Rekor periodically signs the full [Merkle tree](https://transparency.dev) along with a timestamp.

An entry in Rekor provides a single-party attestation that a piece of data existed prior to a certain time. These timestamps and the contents of the log cannot be tampered with or removed later, providing long-term trust. This long-term trust also requires that the log is monitored.
Expand All @@ -36,9 +36,9 @@

### Fulcio Security Model

One of the targets secured by the Sigstore Trust Root is the Fulcio root certificate, which is used to issue short-lived code signing certificates.

Check failure on line 39 in content/en/about/security.md

View workflow job for this annotation

GitHub Actions / markdownlint

Trailing spaces

content/en/about/security.md:39:148 MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1] https://github.com/DavidAnson/markdownlint/blob/v0.29.0/doc/md009.md

**Certificate Transparency Log**

Check failure on line 41 in content/en/about/security.md

View workflow job for this annotation

GitHub Actions / markdownlint

Emphasis used instead of a heading

content/en/about/security.md:41 MD036/no-emphasis-as-heading/no-emphasis-as-header Emphasis used instead of a heading [Context: "Certificate Transparency Log"] https://github.com/DavidAnson/markdownlint/blob/v0.29.0/doc/md036.md

Fulcio assumes that a valid OIDC token from a trusted provider is sufficient “proof of ownership” of the associated identity. To mitigate against OIDC compromise, Fulcio appends certificates to an immutable, append-only cryptographically verifiable transparency log. This means:

Expand All @@ -49,11 +49,11 @@

_Note: Fulcio itself does not monitor the certificate transparency log; users are responsible for monitoring the log for unauthorized certificates issued to their identities._

**Short Lived Certificates**

Check failure on line 52 in content/en/about/security.md

View workflow job for this annotation

GitHub Actions / markdownlint

Emphasis used instead of a heading

content/en/about/security.md:52 MD036/no-emphasis-as-heading/no-emphasis-as-header Emphasis used instead of a heading [Context: "Short Lived Certificates"] https://github.com/DavidAnson/markdownlint/blob/v0.29.0/doc/md036.md

Fulcio also uses short-lived certificates as a solution to the key management problem. Traditional signing involves issuing long-lived certificates, but this method assumes that users won’t lose their private key or that the key won’t get stolen or otherwise compromised for long periods of time.

Fulcio was designed to avoid revocation by issuing short-lived certificates instead. When signing, the user only needs to know that the artifact was signed while the certificate was valid.

Check failure on line 56 in content/en/about/security.md

View workflow job for this annotation

GitHub Actions / markdownlint

Trailing spaces

content/en/about/security.md:56:189 MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1] https://github.com/DavidAnson/markdownlint/blob/v0.29.0/doc/md009.md

How can a user do that?

Expand All @@ -63,12 +63,12 @@

Storing the signature in a transparency log also makes certificates easily discoverable so that maintainers don’t have to worry about public key distribution.

**Ephemeral Keys**

Check failure on line 66 in content/en/about/security.md

View workflow job for this annotation

GitHub Actions / markdownlint

Emphasis used instead of a heading

content/en/about/security.md:66 MD036/no-emphasis-as-heading/no-emphasis-as-header Emphasis used instead of a heading [Context: "Ephemeral Keys"] https://github.com/DavidAnson/markdownlint/blob/v0.29.0/doc/md036.md

Sigstore clients like Cosign can also eliminate the key management problem by using ephemeral keys. These ephemeral keys only exist in memory; the private key never hits disk and is never known by Sigstore services.

Cosign will:
1. Generate an ephemeral public/private keypair in memory

Check failure on line 71 in content/en/about/security.md

View workflow job for this annotation

GitHub Actions / markdownlint

Lists should be surrounded by blank lines

content/en/about/security.md:71 MD032/blanks-around-lists Lists should be surrounded by blank lines [Context: "1. Generate an ephemeral publi..."] https://github.com/DavidAnson/markdownlint/blob/v0.29.0/doc/md032.md
1. Bind the public key to a short-lived certificate requested from Fulcio
1. Sign an artifact with the ephemeral private key while the certificate is still valid
1. Store the signature and certificate in Rekor as proof the artifact was signed while the certificate was valid
Expand Down
39 changes: 39 additions & 0 deletions content/en/certificate_authority/oidc-in-fulcio.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,18 @@ GitHub supports OIDC tokens for its workflows initiated from GitHub Actions. Thi

* GitHub Actions (`token.actions.githubusercontent.com`)

GitLab supports OIDC tokens for its workflows initiated from GitLab CI/CD pipelines. This removes the need for persisting authentication credentials. OIDC tokens include information about the workflow and source repository.

In GitLab, you can generate the necessary tokens by simply adding the following to your CI/CD job:

```yaml
id_tokens:
SIGSTORE_ID_TOKEN:
aud: sigstore
```

See the [GitLab documentation](https://docs.gitlab.com/ee/ci/yaml/signing_examples.html) for full examples on signing through GitLab.

### SPIFFE

SPIFFE-based OIDC providers use a SPIFFE ID as the URI subject alternative name of the certificate, scoped to a domain.
Expand Down Expand Up @@ -100,6 +112,33 @@ The token must include the following claims:

All other required claims are extracted and included in custom OID fields, as documented in [OID Information](https://github.com/sigstore/fulcio/blob/main/docs/oid-info.md).

### GitLab

The token must include the following claims:

```json
{
"namespace_id": "72",
"namespace_path": "my-group",
"project_id": "20",
"project_path": "my-group/my-project",
"pipeline_id": "574",
"pipeline_source": "push",
"job_id": "302",
"ref": "main",
"ref_type": "branch",
"runner_id": 1,
"runner_environment": "gitlab-hosted",
"sha": "714a629c0b401fdce83e847fc9589983fc6f46bc",
"project_visibility": "public",
"ci_config_ref_uri": "gitlab.com/my-group/my-project//.gitlab-ci.yml@refs/heads/main"
}
```

`ci_config_ref_uri` is included as a SAN URI: `https://{ci_config_ref_uri}`

All other required claims are extracted and included in custom OID fields, as documented in [OID Information](https://github.com/sigstore/fulcio/blob/main/docs/oid-info.md#mapping-oidc-token-claims-to-fulcio-oids).

### SPIFFE

The token must include the following claims:
Expand Down
9 changes: 9 additions & 0 deletions content/en/system_config/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,15 @@ with:
cosign-release: "v2.0.2" # optional
```

## GitLab

Cosign can be installed in your CI/CD pipeline by using a before script in your job:

```yaml
before_script:
- apk add --update cosign
```

## Container Images

Signed release images are available at [`gcr.io/projectsigstore/cosign`](http://gcr.io/projectsigstore/cosign).
Expand Down
2 changes: 1 addition & 1 deletion content/en/verifying/verify.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ $ cosign verify <image URI> [email protected]

```

The oidc-issuer for Google is https://accounts.google.com, Microsoft is https://login.microsoftonline.com, and GitHub is https://github.com/login/oauth.
The oidc-issuer for Google is https://accounts.google.com, Microsoft is https://login.microsoftonline.com, GitHub is https://github.com/login/oauth, and GitLab is https://gitlab.com.

The following example verifies the signature on file.txt from user [email protected] issued by [email protected]. It uses a provided bundle cosign.bundle that contains the certificate and signature.

Expand Down