Skip to content
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 charts/guac/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ maintainers:
email: guac-info@kusari.dev

type: application
version: 0.6.2
version: 0.7.0
appVersion: "v0.14.0"

dependencies:
Expand Down
90 changes: 90 additions & 0 deletions charts/guac/templates/scorecard-certifier-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Copyright Kusari, Inc. and GUAC contributors
# Licensed under the MIT license. See LICENSE file in the project root for details.
{{ if .Values.guac.scorecardCertifier.enabled }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we update the values.yaml to reflect these resources existing?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added the scorecard certifier changes to values.yaml

---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Values.guac.scorecardCertifier.name }}
{{- if .Values.guac.scorecardCertifier.annotations }}
annotations:
{{ toYaml .Values.guac.scorecardCertifier.annotations | indent 4 }}
{{- end }}
labels:
{{- include "guac.labels" . | nindent 4 }}
app.kubernetes.io/name: {{ .Values.guac.scorecardCertifier.name }}
app.kubernetes.io/component: {{ .Values.guac.scorecardCertifier.name }}
spec:
replicas: {{ .Values.guac.scorecardCertifier.replicas }}
selector:
matchLabels:
{{- include "guac.selectorLabels" . | nindent 6 }}
app.kubernetes.io/name: {{ .Values.guac.scorecardCertifier.name }}
app.kubernetes.io/component: {{ .Values.guac.scorecardCertifier.name }}
template:
metadata:
labels:
{{- include "guac.selectorLabels" . | nindent 8 }}
app.kubernetes.io/name: {{ .Values.guac.scorecardCertifier.name }}
app.kubernetes.io/component: {{ .Values.guac.scorecardCertifier.name }}
spec:
serviceAccountName: {{ .Values.guac.scorecardCertifier.name }}
containers:
- name: {{ .Values.guac.scorecardCertifier.name }}
{{- if .Values.guac.guacImage.digest }}
image: "{{ .Values.guac.guacImage.repository }}@{{ .Values.guac.guacImage.digest }}"
{{- else }}
image: "{{ .Values.guac.guacImage.repository }}:{{ .Values.guac.guacImage.tag | default .Chart.AppVersion}}"
{{- end }}
imagePullPolicy: "{{ .Values.guac.guacImage.pullPolicy }}"
command:
{{ toYaml .Values.guac.scorecardCertifier.image.command | indent 10 }}
workingDir: {{ .Values.guac.guacImage.workingDir }}
{{- if .Values.guac.scorecardCertifier.ports }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This conditional uses .Values.guac.scorecardCertifier.ports but the content following uses .Values.guac.scorecardCertifier.image.ports - is this a mismatch?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is intentional and follows the same pattern used across all other deployment templates in this repository. The conditional .Values.guac.scorecardCertifier.ports acts as a boolean flag to enable/disable port rendering, while .Values.guac.scorecardCertifier.image.ports contains the actual port configuration.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great points - it does follow current standards.

ports:
{{ toYaml .Values.guac.scorecardCertifier.image.ports | indent 10 }}
{{- end }}
{{- if .Values.guac.scorecardCertifier.resources }}
resources: {{- toYaml .Values.guac.scorecardCertifier.resources | nindent 10 }}
{{- end }}

volumeMounts:
- name: guac-config
mountPath: {{ .Values.guac.guacImage.workingDir }}
readOnly: true

{{- if or .Values.guac.common.env .Values.guac.scorecardCertifier.env }}
env:
{{- if .Values.guac.common.env }}
{{ toYaml .Values.guac.common.env | indent 10 }}
{{- end }}
{{- if .Values.guac.scorecardCertifier.env }}
{{ toYaml .Values.guac.scorecardCertifier.env | indent 10 }}
{{- end }}
{{- end }}

{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{ toYaml .Values.imagePullSecrets | indent 8 }}
{{- end }}
volumes:
- name: guac-config
configMap:
name: guac-cm
{{- if .Values.guac.scorecardCertifier.nodeSelector }}
nodeSelector:
{{ toYaml .Values.guac.scorecardCertifier.nodeSelector | indent 8 }}
{{- end }}

{{- if or .Values.guac.common.tolerations .Values.guac.scorecardCertifier.tolerations }}
tolerations:
{{- if .Values.guac.common.tolerations }}
{{ toYaml .Values.guac.common.tolerations | indent 8 }}
{{- end }}
{{- if .Values.guac.scorecardCertifier.tolerations }}
{{ toYaml .Values.guac.scorecardCertifier.tolerations | indent 8 }}
{{- end }}
{{- end }}


{{- end }}
19 changes: 19 additions & 0 deletions charts/guac/templates/scorecard-certifier-sa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright Kusari, Inc. and GUAC contributors
# Licensed under the MIT license. See LICENSE file in the project root for details.
{{ if .Values.guac.scorecardCertifier.enabled }}
{{ if .Values.guac.scorecardCertifier.serviceAccount.create }}
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ .Values.guac.scorecardCertifier.name }}
{{- if .Values.guac.scorecardCertifier.annotations }}
annotations:
{{ toYaml .Values.guac.scorecardCertifier.serviceAccount.annotations | indent 4 }}
{{- end }}
labels:
{{- include "guac.labels" . | nindent 4 }}
app.kubernetes.io/name: {{ .Values.guac.scorecardCertifier.name }}
app.kubernetes.io/component: {{ .Values.guac.scorecardCertifier.name }}
{{- end }}
{{- end }}
92 changes: 92 additions & 0 deletions charts/guac/tests/scorecard-certifier_deployment_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Copyright Kusari, Inc. and GUAC contributors
# Licensed under the MIT license. See LICENSE file in the project root for details.
suite: Scorecard Certifier Deployment tests
templates:
- scorecard-certifier-deployment.yaml

tests:
- it: deployment should render
values:
- ./values_digest_and_tag.yaml
asserts:
- isKind:
of: Deployment
- hasDocuments:
count: 1

- it: should run the scorecardCertifier image
values:
- ./values_digest_and_tag.yaml
asserts:
- equal:
path: spec.template.spec.containers[0].name
value: scorecard-certifier
- equal:
path: spec.template.spec.containers[0].image
value: ghcr.io/guacsec/guac@sha256:167e823f36e268f66b12a79d4c4b39df23c2f87847817c161b6c6ddbc9ee5c4e

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is not in other files but can you add a tag on which guac version this represents?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The corresponding version is v0.1.1, I have updated that and fixed tests as well.


- it: should run the scorecardCertifier sub command
values:
- ./values_digest_and_tag.yaml
asserts:
- equal:
path: spec.template.spec.containers[0].command[0]
value: "sh"
- equal:
path: spec.template.spec.containers[0].command[1]
value: "-c"
- equal:
path: spec.template.spec.containers[0].command[2]
value: "/opt/guac/guaccollect scorecard"

- it: should respect spec level parameters
values:
- ./values_digest_and_tag.yaml
asserts:
- equal:
path: spec.replicas
value: 1
- equal:
path: spec.selector.matchLabels["app.kubernetes.io/name"]
value: scorecard-certifier
- equal:
path: spec.template.metadata.labels["app.kubernetes.io/name"]
value: scorecard-certifier

- it: should use tag if only tag is specified
values:
- ./values_tag_no_digest.yaml
asserts:
- equal:
path: spec.template.spec.containers[0].image
value: ghcr.io/guacsec/guac:latest

- it: should include tolerations
values:
- ./values_combine.yaml
asserts:
- equal:
path: spec.template.spec.tolerations[0].key
value: "kusari.cloud/common"
- equal:
path: spec.template.spec.tolerations[0].value
value: common
- equal:
path: spec.template.spec.tolerations[0].effect
value: NoSchedule
- equal:
path: spec.template.spec.tolerations[0].operator
value: Equal

- equal:
path: spec.template.spec.tolerations[1].key
value: "kusari.cloud/own"
- equal:
path: spec.template.spec.tolerations[1].value
value: own
- equal:
path: spec.template.spec.tolerations[1].effect
value: NoSchedule
- equal:
path: spec.template.spec.tolerations[1].operator
value: Equal
1 change: 1 addition & 0 deletions charts/guac/tests/serviceaccount_all_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ templates:
- ingestor-sa.yaml
- oci-collector-sa.yaml
- osv-certifier-sa.yaml
- scorecard-certifier-sa.yaml

tests:
- it: should not create service account
Expand Down
8 changes: 8 additions & 0 deletions charts/guac/tests/values_combine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,11 @@ guac:
key: kusari.cloud/own
operator: Equal
value: own

scorecardCertifier:
enabled: true
tolerations:
- effect: NoSchedule
key: kusari.cloud/own
operator: Equal
value: own
7 changes: 6 additions & 1 deletion charts/guac/tests/values_digest_and_tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ imagePullSecrets:
guac:
guacImage:
repository: ghcr.io/guacsec/guac
tag: "latest"
tag: "v0.1.1"
# digest corresponds to guac v0.1.1
digest: "sha256:167e823f36e268f66b12a79d4c4b39df23c2f87847817c161b6c6ddbc9ee5c4e"
workingDir: /guac

Expand All @@ -31,3 +32,7 @@ guac:

ingestor:
name: ingestor

scorecardCertifier:
enabled: true
name: scorecard-certifier
5 changes: 5 additions & 0 deletions charts/guac/tests/values_serviceaccount_all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,8 @@ guac:
visualizer:
serviceAccount:
create: true

scorecardCertifier:
enabled: true
serviceAccount:
create: true
4 changes: 4 additions & 0 deletions charts/guac/tests/values_tag_no_digest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,7 @@ guac:

graphqlServer:
name: graphql-server

scorecardCertifier:
enabled: true
name: scorecard-certifier
39 changes: 39 additions & 0 deletions charts/guac/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,17 @@ imagePullSecrets:
## @param guac.cdCertifier.serviceAccount.create - whether to create cdCertifier service account
## @param guac.cdCertifier.serviceAccount.annotations - CD Certifier service account annotations
## @param guac.cdCertifier.resources - [map] resource requests or limits of the cd Certifier deployment
## @param guac.scorecardCertifier.enabled String Whether to deploy Scorecard Certifier
## @param guac.scorecardCertifier.name String Name of the Scorecard Certifier component.
## @param guac.scorecardCertifier.annotations.reloader.stakater.com/auto [string] Boolean for deploying [stakater/Reloader] (https://github.com/stakater/Reloader)
## @param guac.scorecardCertifier.replicas Number of replicas for Scorecard Certifier deployment
## @param guac.scorecardCertifier.image.command Command for the Scorecard Certifier image. It is not recommended to override this.
## @param guac.scorecardCertifier.env Environment variables for Scorecard Certifier. Note: GITHUB_AUTH_TOKEN is required and should be provided via secretKeyRef.
## @param guac.scorecardCertifier.nodeSelector - sets the node selector for where to run the deployment
## @param guac.scorecardCertifier.tolerations
## @param guac.scorecardCertifier.serviceAccount.create - whether to create scorecardCertifier service account
## @param guac.scorecardCertifier.serviceAccount.annotations - Scorecard Certifier service account annotations
## @param guac.scorecardCertifier.resources - [map] resource requests or limits of the Scorecard Certifier deployment
## @param guac.ingestor.enabled String Whether to deploy Ingestor
## @param guac.ingestor.name String Name of the ingestor component.
## @param guac.ingestor.annotations.reloader.stakater.com/auto [string] Boolean for deploying [stakater/Reloader] (https://github.com/stakater/Reloader)
Expand Down Expand Up @@ -272,6 +283,34 @@ guac:
# cpu: "0.25"
# memory: "0.5G"

scorecardCertifier:
enabled: false
name: scorecard-certifier
annotations:
reloader.stakater.com/auto: "true"
replicas: 1
image:
command: ['sh', '-c', '/opt/guac/guaccollect scorecard']
# GITHUB_AUTH_TOKEN is required for scorecard certifier to fetch scorecards from GitHub
# Users should create a Kubernetes secret with their GitHub token and reference it here
# Example:
# kubectl create secret generic github-token --from-literal=token=<your-github-token>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't hold any hard opinions here - but I am curious if we should disable this certifier deployment by default given the dependency on an existing secret?

@himasree424 himasree424 Nov 24, 2025

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, disabled scorecard by default

env:
- name: GITHUB_AUTH_TOKEN
valueFrom:
secretKeyRef:
name: github-token
key: token
nodeSelector: {}
tolerations: []
serviceAccount:
create: true
annotations: {}
resources: {}
# requests:
# cpu: "0.25"
# memory: "0.5G"

ingestor:
enabled: true
name: ingestor
Expand Down
Loading