Skip to content

Commit b866e7e

Browse files
authored
chore(contracts): Add requirements to contracts and sign Helm Chart (#1768)
Signed-off-by: Javier Rodriguez <javier@chainloop.dev>
1 parent 67a0c54 commit b866e7e

File tree

5 files changed

+42
-17
lines changed

5 files changed

+42
-17
lines changed

.github/workflows/contracts/chainloop-vault-codeql.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@ materials:
99
policies:
1010
attestation:
1111
- ref: source-commit
12+
with:
13+
check_signature: yes
14+
requirements:
15+
- chainloop-best-practices/commit-signed

.github/workflows/contracts/chainloop-vault-helm-package.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ materials:
1515
policies:
1616
attestation:
1717
- ref: source-commit
18+
with:
19+
check_signature: yes
20+
requirements:
21+
- chainloop-best-practices/commit-signed
1822
materials:
1923
- ref: artifact-signed
20-
24+
requirements:
25+
- chainloop-best-practices/container-signed
26+
- chainloop-best-practices/helm-chart-signed

.github/workflows/contracts/chainloop-vault-release.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,17 @@ policies:
55
- ref: source-commit
66
with:
77
check_signature: yes
8+
requirements:
9+
- chainloop-best-practices/commit-signed
810
- ref: containers-with-sbom
911
materials:
1012
- ref: artifact-signed
11-
- ref: sbom-banned-licenses
12-
with:
13-
licenses: AGPL-1.0-only, AGPL-1.0-or-later, AGPL-3.0-only, AGPL-3.0-or-later
14-
- ref: sbom-banned-components
15-
with:
16-
components: log4j@2.14.1
17-
- ref: sbom-ntia
18-
- ref: sbom-with-licenses
19-
- ref: sbom-freshness
20-
13+
requirements:
14+
- chainloop-best-practices/container-signed
15+
policyGroups:
16+
- ref: read-only-demo/sbom-quality
17+
with:
18+
bannedLicenses: AGPL-1.0-only, AGPL-1.0-or-later, AGPL-3.0-only, AGPL-3.0-or-later
19+
bannedComponents: log4j@2.14.1
2120
runner:
2221
type: GITHUB_ACTION

.github/workflows/contracts/chainloop-vault-scorecards.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@ materials:
99
policies:
1010
attestation:
1111
- ref: source-commit
12+
with:
13+
check_signature: yes
14+
requirements:
15+
- chainloop-best-practices/commit-signed

.github/workflows/package_chart.yaml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ jobs:
4949
- name: Install Helm
5050
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5
5151

52+
- name: Install Cosign
53+
uses: sigstore/cosign-installer@v3.7.0
54+
with:
55+
cosign-release: 'v2.4.1'
56+
5257
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
5358

5459
- name: Initialize Attestation
@@ -58,23 +63,30 @@ jobs:
5863
- name: Package Chart
5964
run: helm package deployment/chainloop/
6065

61-
- name: Add Attestation (Helm Chart)
66+
- name: Add Attestation (Helm Chart) and Push Chart
6267
run: |
6368
export CONTAINER_CP=$(cat deployment/chainloop/Chart.yaml | yq -r .annotations.images | yq -r '.[] | select(.name == "control-plane") | .image')
6469
export CONTAINER_CAS=$(cat deployment/chainloop/Chart.yaml | yq -r .annotations.images | yq -r '.[] | select(.name == "artifact-cas") | .image')
70+
chart_version=$(cat deployment/chainloop/Chart.yaml | yq .version)
6571
66-
# Attest Chart
67-
chainloop attestation add --name helm-chart --value chainloop*.tgz
6872
# Attest Control plane image
6973
chainloop attestation add --name control-plane-image --value "${CONTAINER_CP}"
7074
# Attest CAS image
7175
chainloop attestation add --name artifact-cas-image --value "${CONTAINER_CAS}"
72-
73-
- name: Push Chart
74-
run: |
76+
77+
# Push Chart
7578
for pkg in chainloop*.tgz; do
7679
helm push ${pkg} oci://ghcr.io/chainloop-dev/charts
7780
done
81+
82+
# Sign Chart
83+
cosign sign --tlog-upload=false --key env://COSIGN_PRIVATE_KEY ghcr.io/chainloop-dev/charts/chainloop:${chart_version}
84+
85+
# Attest the Chart
86+
chainloop attestation add --name helm-chart --value oci://ghcr.io/chainloop-dev/charts/chainloop:${chart_version}
87+
env:
88+
COSIGN_PRIVATE_KEY: ${{secrets.COSIGN_KEY}}
89+
COSIGN_PASSWORD: ${{secrets.COSIGN_PASSWORD}}
7890

7991
- name: Finish and Record Attestation
8092
if: ${{ success() }}

0 commit comments

Comments
 (0)