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

Feature - Enable post-build scanning in insights-remote #677

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
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: 2 additions & 0 deletions charts/lagoon-remote/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ dependencies:
# Valid supported kinds are added, changed, deprecated, removed, fixed and security
annotations:
artifacthub.io/changes: |
- kind: changed
description: add buildScannerImage config to insights-remote
- kind: changed
description: update ssh-portal to v0.41.3
links:
Expand Down
8 changes: 8 additions & 0 deletions charts/lagoon-remote/templates/docker-host.networkpolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ spec:
matchExpressions:
- key: lagoon.sh/buildName
operator: Exists
- namespaceSelector:
matchExpressions:
- key: lagoon.sh/environment
operator: Exists
podSelector:
matchExpressions:
- key: insights.lagoon.sh/imagescanner
operator: Exists
podSelector:
matchLabels:
{{- include "lagoon-remote.dockerHost.selectorLabels" . | nindent 6 }}
Expand Down
75 changes: 60 additions & 15 deletions charts/lagoon-remote/templates/insights-remote.clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,64 @@ metadata:
labels:
{{- include "lagoon-remote.insightsRemote.labels" . | nindent 4 }}
rules:
- verbs:
- '*'
apiGroups:
- ''
resources:
- configmaps
- secrets
- verbs:
- get
- watch
- list
apiGroups:
- ''
resources:
- namespaces
- apiGroups:
- apps
resources:
- deployments
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- configmaps
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
- deployments
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- namespaces
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- pods
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
- secrets
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ spec:
- name: BURN_AFTER_READING
value: "TRUE"
{{- end }}
{{- if .Values.insightsRemote.enableBuildScanning }}
- name: ENABLE_BUILD_SCANNING
value: "TRUE"
- name: BUILD_SCANNER_IMAGE
value: "{{ coalesce .Values.insightsRemote.buildScannerImage "docker.io/uselagoon/insights-scanner:latest" }}"
{{- end }}
- name: RABBITMQ_ADDRESS
value: {{ required "A valid rabbitMQHostname required!" $rabbitMQHostname | quote }}
- name: RABBITMQ_PASSWORD
Expand Down
6 changes: 6 additions & 0 deletions charts/lagoon-remote/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,12 @@ dbaasHTTPEndpoint: ""

insightsRemote:
enabled: false

# The following values control whether post-build insights scanning is enabled
enableBuildScanning: false
# If enabled, we deploy a particular image into the namespace, this can be overriden by the following
# buildScannerImage: docker.io/uselagoon/insights-scanner:latest

# sets insights configMaps to be removed after being processed
burnAfterReading: true

Expand Down
Loading