Skip to content

Commit 984c4ea

Browse files
authored
Merge pull request #23 from SignPath/gitlab
adds initial gitlab documentation
2 parents ebd5649 + 40faad3 commit 984c4ea

8 files changed

Lines changed: 138 additions & 16 deletions

File tree

docs/_data/changelog.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@
1818
- text: |-
1919
Added new mandatory `appSettings.shared.contactOptions.supportEmailAddress` configuration in `signpath-application` chart. Rendered as support contact in error messages.
2020
issues: [SIGN-8584]
21+
gitlab_connector:
22+
version: 1.0.0
23+
new_features:
24+
- text: Initial release
25+
issues: []
26+
gitlab_component:
27+
version: 1.0.0
28+
new_features:
29+
- text: Initial release
30+
issues: []
2131
- date: '2026-06-18'
2232
updates:
2333
application:

docs/_data/changelog_definitions.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ components:
2323
- id: github_actions_action
2424
label: 'GitHub Action'
2525
categories: [github, plugins]
26+
- id: gitlab_connector
27+
label: 'GitLab Connector'
28+
categories: [gitlab, connectors]
29+
- id: gitlab_component
30+
label: 'GitLab Component'
31+
categories: [gitlab, plugins]
2632
- id: jenkins_plugin
2733
label: 'Jenkins Plugin'
2834
categories: [jenkins, plugins]

docs/_data/menus/documentation.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@
5050
- text: GitHub
5151
path: github
5252

53+
- text: GitLab
54+
path: gitlab
55+
5356
- text: Azure DevOps
5457
path: azure-devops
5558

docs/_data/tables/trusted-build-systems.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,5 +118,3 @@ github-extended-policies-branch-ruleset-rules:
118118
* `tool`: The name of the code scanning tool, e.g. `CodeQL`
119119
* `min_alerts_threshold`: one of `none`, `errors` or `warnings`
120120
* `min_security_alerts_threshold`: one of `none`, `critical`, `high`, `medium` or `all`
121-
122-
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
layout: null
3+
---
4+
{% include_relative changelog_feed.md category="gitlab_component" %}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
layout: null
3+
---
4+
{% include_relative changelog_feed.md category="gitlab_connector" %}

docs/slsa-attestations/definitions.md

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,14 @@ The following parameters are used for these URIs:
2727

2828
| Supported hosted CI/CD systems | `$origin` value | Supported SLSA Build levels
2929
|--------------------------------|------------------|-----------------------------
30-
| [GitHub Actions] | `github` | Build L1 - L3
3130
| [Azure DevOps] - In Preview | `azure-devops` | Build L1 - L3
31+
| [GitHub Actions] | `github` | Build L1 - L3
32+
| [GitLab CI/CD] | `gitlab` | Build L1 - L3
3233
| [TeamCity] - In Preview | `teamcity` | Build L1 - L2
3334

3435
[GitHub Actions]: /trusted-build-systems/github
3536
[Azure DevOps]: /trusted-build-systems/azure-devops
36-
<!--[GitLab CI/CD]: /trusted-build-systems/gitlab
37-
38-
| [GitLab CI/CD] - In Preview | `gitlab` | Build L1 - L3
39-
-->
37+
[GitLab CI/CD]: /trusted-build-systems/gitlab
4038
[TeamCity]: /trusted-build-systems/teamcity
4139

4240
{:.panel.info}
@@ -120,8 +118,7 @@ Guarantee: If the provenance is signed by SignPath, the build was executed on a
120118
|----------------|------------------------------
121119
| Azure DevOps | The build was executed on a runner from the Microsoft-hosted pools, which offer isolation (see [the official documentation](https://learn.microsoft.com/en-us/azure/devops/pipelines/security/misc))
122120
| GitHub Actions | The build was executed on a GitHub-hosted runner, each job is run in a fresh instance of the runner image (see [the official documentation](https://docs.github.com/en/actions/how-tos/manage-runners/github-hosted-runners/use-github-hosted-runners))
123-
124-
<!--| GitLab CI/CD | The build was executed on a GitLab-hosted runner, each job runs in a newly provisioned VM (see [the oficial documentation](https://docs.gitlab.com/ci/runners/hosted_runners/))-->
121+
| GitLab CI/CD | The build was executed on a GitLab-hosted runner, each job runs in a newly provisioned VM (see [the oficial documentation](https://docs.gitlab.com/ci/runners/hosted_runners/))
125122

126123
{:.quote}
127124
> It MUST NOT be possible for one build to persist or influence the build environment of a subsequent build. In other words, an ephemeral build environment MUST be provisioned for each build.
@@ -130,18 +127,16 @@ Guarantee: If the provenance is signed by SignPath, the build was executed on a
130127
|----------------|------------------------------
131128
| Azure DevOps | The build was executed on a runner from the Microsoft-hosted pools, which provide a clean virtual machine for each build run (see [the official documentation](https://learn.microsoft.com/en-us/azure/devops/pipelines/security/misc))
132129
| GitHub Actions | The build was executed on a GitHub-hosted runner, each job is run in a fresh instance of the runner image (see [the official documentation](https://docs.github.com/en/actions/how-tos/manage-runners/github-hosted-runners/use-github-hosted-runners))
133-
134-
<!--| GitLab CI/CD | The build was executed on a GitLab-hosted runner, each job runs in a newly provisioned VM (see [the oficial documentation](https://docs.gitlab.com/ci/runners/hosted_runners/))-->
130+
| GitLab CI/CD | The build was executed on a GitLab-hosted runner, each job runs in a newly provisioned VM (see [the oficial documentation](https://docs.gitlab.com/ci/runners/hosted_runners/))
135131

136132
{:.quote}
137133
> It MUST NOT be possible for one build to inject false entries into a build cache used by another build, also known as “cache poisoning”. In other words, the output of the build MUST be identical whether or not the cache is used.
138134
139135
| Build System | Guarantee
140136
|----------------|------------------------------
141137
| Azure DevOps | Cache usage has to be explicitly defined in the pipeline definition and cannot be shared across pipelines or branches (see [the official documentation](https://learn.microsoft.com/en-us/azure/devops/pipelines/release/caching?view=azure-devops&tabs=bundler#cache-isolation-and-security))
142-
| GitHub Actions | Cache usage has to be explicitly defined in the workflow definition (see [the official definition](https://docs.github.com/en/actions/reference/workflows-and-actions/dependency-caching))
143-
144-
<!--| GitLab CI/CD | TODO: https://docs.gitlab.com/ci/caching/, see SIGNVM-114-->
138+
| GitHub Actions | Cache usage has to be explicitly defined in the workflow definition (see [the official documentation](https://docs.github.com/en/actions/reference/workflows-and-actions/dependency-caching))
139+
| GitLab CI/CD | Cache usage has to be explicitly defined in the pipeline definition (see [the official documentation](https://docs.gitlab.com/ci/caching/)
145140

146141
{:.quote}
147142
> The build platform MUST NOT open services that allow for remote influence unless all such interactions are captured as externalParameters in the provenance
@@ -150,8 +145,7 @@ Guarantee: If the provenance is signed by SignPath, the build was executed on a
150145
|----------------|------------------------------
151146
| Azure DevOps | The build was executed on a runner from the Microsoft-hosted pools, which do not provide the ability to remotely connect (see [the official documentation](https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/hosted)).
152147
| GitHub Actions | The build was executed on a GitHub-hosted runner which does not provide the ability to remotely connect, unless explicitly specified in the build definition (see [the official documentation](https://docs.github.com/en/actions/how-tos/manage-runners/github-hosted-runners/connect-to-a-private-network))
153-
154-
<!--| GitLab CI/CD | The build was executed on a GitLab-hosted runner wich does not allow remote connections (see [the official documentation](https://docs.gitlab.com/ci/runners/hosted_runners/))-->
148+
| GitLab CI/CD | The build was executed on a GitLab-hosted runner wich does not allow remote connections (see [the official documentation](https://docs.gitlab.com/ci/runners/hosted_runners/))
155149

156150
## The `resource-uri` field
157151

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
---
2+
header: GitLab
3+
layout: resources
4+
toc: true
5+
show_toc: 3
6+
description: GitLab
7+
---
8+
9+
## Prerequisites
10+
11+
* Use the predefined Trusted Build System _GitLab.com_ (see [configuration](/documentation/trusted-build-systems#configuration))
12+
* add it to the Organization
13+
* link it to each SignPath Project for GitLab
14+
15+
{:.panel.info}
16+
> **Self-managed installations**
17+
>
18+
> SignPath hosts an instance of the GitLab connector which is linked to GitLab.com For integrating self-managed GitLab instances, contact our [support](https://signpath.io/support) team.
19+
20+
## Checks performed by SignPath
21+
22+
The GitLab connector performs the following checks:
23+
24+
* The artifact was built by a GitLab Pipeline, not by some other entity in possession of the API token
25+
* [Origin metadata](/documentation/origin-verification) is provided by GitLab, not the build script, and can therefore not be forged
26+
* The artifact is stored as a GitLab pipeline artifact before it is submitted for signing
27+
28+
## Usage
29+
30+
We provide a `submit-signing-request` component that can be integrated into a GitLab Pipeline:
31+
32+
```yaml
33+
include:
34+
- component: gitlab.com/signpath/components/submit-signing-request@1.0.0
35+
inputs:
36+
organization_id: $[[ SIGNPATH_ORGANIZATION_ID ]] # CI/CD variable
37+
project_slug: MyComponentA
38+
signing_policy_slug: release-signing
39+
gitlab_artifact_job_name: build_job
40+
gitlab_artifact_path: output/my-executable
41+
output_artifact_path: output/my-signed-executable
42+
parameters:
43+
- myparam: myvalue
44+
45+
stages:
46+
- build
47+
- sign
48+
49+
build_job:
50+
stage: build
51+
script:
52+
- echo "Building some software..."
53+
artifacts:
54+
paths:
55+
- output/my-executable
56+
```
57+
58+
See the [parameter list](#supported-parameters) for a complete list of all supported inputs.
59+
60+
{:.panel.info}
61+
> **Signing multiple files**
62+
>
63+
> If you want to sign multiple files in a single signing request, you have to create and publish a dedicated ZIP archive in your build step and modify your artifact configuration on SignPath accordingly.
64+
65+
{:.panel.info}
66+
> **Setups that don't include _Docker Executors_**
67+
>
68+
> For all organizations that don't support _Docker Executors_, we provide a CLI tool can be directly invoked. Please contact our [support team](https://signpath.io/support) for details.
69+
70+
## Supported parameters
71+
72+
| Input | Default Value | Description
73+
|-----------------------------------------------|-----------------------------------------|---------------------------
74+
| `stage` | `sign` | The GitLab pipeline stage at which the component should be executed.
75+
| `job_name` | `submit-signing-request` | The name of the given signing job.
76+
| `connector_url` | `https://gitlab.connectors.signpath.io` | The URL of the SignPath connector. Required if self-managed.
77+
| `api_token_var_name` | `SIGNPATH_API_TOKEN` | The _Api Token_ for a user with submitter permissions in the specified project/signing policy. The component only allows providing the token via an environment variable. The name of the environment variable can be overwritten using this input.
78+
| `gitlab_access_token_var_name` | `SIGNPATH_GITLAB_ACCESS_TOKEN` | The _GitLab Access Token_ that is used to retrieve [origin metadata](/documentation/origin-verification) from the GitLab instance. Requires the `read_api` scope. The component only allows providing the token via an environment variable. The name of the environment variable can be overwritten using this input.
79+
| `organization_id` | (mandatory) | The SignPath organization ID.
80+
| `project_slug` | (mandatory) | The SignPath project slug.
81+
| `signing_policy_slug` | (mandatory) | The SignPath signing policy slug.
82+
| `artifact_configuration_slug` | | The SignPath artifact configuration slug.
83+
| `gitlab_artifact_job_name` | (mandatory) | The name of the job that published the artifact to be signed.
84+
| `gitlab_artifact_path` | (mandatory) | The path within the GitLab artifact.
85+
| `output_artifact_path` | | Path to where the signed artifact will be stored. If not specified, the task will not download the signed artifact from SignPath.
86+
| `wait_for_completion` | `true` | Wait for the signing request to complete. If set to true, the signed artifact will be published.
87+
| `parameters` | | List of key/value pairs that map to [user-defined parameters](/artifact-configuration/syntax#parameters) in the Artifact Configuration.
88+
| `wait_for_completion_timeout_in_seconds` | `600` | Maximum time in seconds that the job/tool will wait for the signing request to complete.
89+
| `service_unavailable_timeout_in_seconds` | `600` | Total time in seconds that the job/tool will wait for a single service call to succeed (across several retries).
90+
| `download_signed_artifact_timeout_in_seconds` | `300` | HTTP timeout when downloading the signed artifact.
91+
92+
[user-defined parameters]: /documentation/artifact-configuration/syntax#parameters
93+
94+
## Environment variables for subsequent jobs
95+
96+
The component invocation will publish a dotenv report and make the following environment variables available in subsequent jobs:
97+
98+
* `${PREFIX}_SIGNPATH_SIGNING_REQUEST_ID`: The id of the newly created signing request.
99+
* `${PREFIX}_SIGNPATH_SIGNING_REQUEST_WEB_URL`: The url of the signing request in SignPath.
100+
* `${PREFIX}_SIGNPATH_SIGNED_ARTIFACT_DOWNLOAD_URL`: The url where the signed artifact can be downloaded.
101+
102+
`${PREFIX}` defaults to the capitalized name of the signing job in GitLab (`SUBMIT_SIGNING_REQUEST` by default).
103+

0 commit comments

Comments
 (0)