Skip to content

Commit 984b35e

Browse files
authored
Merge pull request #95 from emsearcy/fix/heimdall-ca-algorithm-conditional
fix(heimdall): Use genCA by default, genCAWithPrivateKey when algorithm specified
2 parents 16a9039 + e795500 commit 984b35e

File tree

4 files changed

+23
-10
lines changed

4 files changed

+23
-10
lines changed

.github/workflows/release.yaml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ on:
1010
- 'v*'
1111

1212
env:
13-
COSIGN_VERSION: v2.5.3
14-
HELM_VERSION: v3.18.4
13+
COSIGN_VERSION: v3.0.2
14+
HELM_VERSION: 4.0.1
1515

1616
permissions:
1717
contents: read
@@ -28,22 +28,23 @@ jobs:
2828
image_name: ${{ steps.publish-ghcr.outputs.image_name }}
2929
steps:
3030
- name: Checkout repository
31-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
31+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
3232

3333
- name: Prepare versions and chart name
3434
id: prepare
3535
run: |
3636
set -euo pipefail
3737
CHART_NAME="$(yq '.name' charts/*/Chart.yaml)"
38-
CHART_VERSION="$(yq '.version' charts/*/Chart.yaml)"
38+
CHART_VERSION=$(echo ${{ github.ref_name }} | sed 's/v//g')
3939
{
4040
echo "chart_name=$CHART_NAME"
4141
echo "chart_version=$CHART_VERSION"
4242
} >> "$GITHUB_OUTPUT"
4343
4444
- name: Publish Chart to GHCR
4545
id: publish-ghcr
46-
uses: linuxfoundation/lfx-public-workflows/.github/actions/helm-chart-oci-publisher@e619121ece4ca4b1d6c89ade032f26105505756d
46+
uses: >- # main
47+
linuxfoundation/lfx-public-workflows/.github/actions/helm-chart-oci-publisher@17e4144d7ba68f7c3e8c16eece5aed15fd7c2dc8
4748
with:
4849
name: ${{ steps.prepare.outputs.chart_name }}
4950
repository: ${{ github.repository }}/chart
@@ -53,12 +54,12 @@ jobs:
5354
registry_password: ${{ secrets.GITHUB_TOKEN }}
5455

5556
- name: Install Cosign
56-
uses: sigstore/cosign-installer@d58896d6a1865668819e1d91763c7751a165e159 # v3.9.2
57+
uses: sigstore/cosign-installer@faadad0cce49287aee09b3a48701e75088a2c6ad # v4.0.0
5758
with:
5859
cosign-release: "${{ env.COSIGN_VERSION }}"
5960

6061
- name: Login to GitHub
61-
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
62+
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
6263
with:
6364
registry: ghcr.io
6465
username: ${{ github.actor }}
@@ -78,6 +79,9 @@ jobs:
7879
actions: read
7980
id-token: write
8081
packages: write
82+
# Note, this action *cannot* be pinned to a ref: see the project's
83+
# explanation at "Referencing SLSA builders and generators" in their
84+
# README.
8185
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
8286
with:
8387
image: ${{ needs.release-helm-chart.outputs.image_name }}

charts/lfx-platform/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ apiVersion: v2
55
name: lfx-platform
66
description: LFX Platform v2 Helm chart
77
type: application
8-
version: 0.3.18
8+
version: 0.0.1
99
icon: https://github.com/linuxfoundation/lfx-v2-helm/raw/main/img/lfx-logo-color.svg
1010
dependencies:
1111
- name: traefik

charts/lfx-platform/templates/heimdall/heimdall-signer-cert.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@
66
Generate a private key & x509 cert for Heimdall on install of Chart
77
TODO: Create RBAC rule to limit secret access to heimdall Pods
88
*/}}
9-
{{- $heimdallCA := genCAWithKey "heimdall" 365 (genPrivateKey .Values.lfx.generateHeimdallSignerCert.algorithm) -}}
9+
{{- $heimdallCA := "" -}}
10+
{{- if .Values.lfx.generateHeimdallSignerCert.algorithm -}}
11+
{{- $heimdallCA = genCAWithKey "heimdall" 365 (genPrivateKey .Values.lfx.generateHeimdallSignerCert.algorithm) -}}
12+
{{- else -}}
13+
{{- $heimdallCA = genCA "heimdall" 365 -}}
14+
{{- end -}}
1015

1116
apiVersion: v1
1217
kind: Secret

charts/lfx-platform/values.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ lfx:
2222
enabled: true
2323
name: heimdall-signer-cert
2424
# algorithm will be passed as the parameter to Sprig's genPrivateKey.
25-
algorithm: rsa
25+
# If blank or missing, uses genCA (2048-bit RSA key, PS256 JWT alg).
26+
# If set, uses genCAWithKey with the specified algorithm.
27+
# Setting "rsa" explicitly will use a 4096-bit key (PS512 JWT alg).
28+
# algorithm: ecdsa
29+
# algorithm: rsa
2630

2731
whoami:
2832
enabled: true

0 commit comments

Comments
 (0)