Skip to content

Commit

Permalink
Merge pull request #1539 from snyk/staging
Browse files Browse the repository at this point in the history
RELEASE
  • Loading branch information
jonnyowenpowell authored Oct 23, 2024
2 parents 08f7c90 + e68e524 commit 191e1b6
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 13 deletions.
6 changes: 6 additions & 0 deletions .snyk
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,10 @@ ignore:
Waiting for a patch: https://security.snyk.io/vuln/SNYK-JS-MICROMATCH-6838728
expires: 2024-12-19T12:00:00.000Z
created: 2024-05-16T12:00:00.000Z
SNYK-JS-JSONPATHPLUS-7945884:
- '*':
reason: >-
Waiting for transient dependency to update
expires: 2024-12-19T12:00:00.000Z
created: 2024-10-23T12:00:00.000Z
patch: {}
26 changes: 13 additions & 13 deletions snyk-monitor/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,19 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.podSecurityContext }}
securityContext:
{{- $fsGroupOverride := dict }}
{{- if hasKey $.Values.securityContext "fsGroup" }}
{{- $fsGroupOverride = dict "fsGroup" (int $.Values.securityContext.fsGroup) }}
{{- end }}
{{- merge $fsGroupOverride . | toYaml | nindent 8 }}
{{- else }}
{{- if .Values.securityContext.fsGroup }}
securityContext:
fsGroup: {{ int .Values.securityContext.fsGroup }}
{{- end }}
{{- end }}
{{- with .Values.podSecurityContext }}
securityContext:
{{- $fsGroupOverride := dict }}
{{- if hasKey $.Values.securityContext "fsGroup" }}
{{- $fsGroupOverride = dict "fsGroup" (int $.Values.securityContext.fsGroup) }}
{{- end }}
{{- merge $fsGroupOverride . | toYaml | nindent 8 }}
{{- else }}
{{- if .Values.securityContext.fsGroup }}
securityContext:
fsGroup: {{ int .Values.securityContext.fsGroup }}
{{- end }}
{{- end }}
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
Expand Down
9 changes: 9 additions & 0 deletions test/integration/kubernetes.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,15 @@ test('snyk-monitor secure configuration is as expected', async () => {
namespace,
);
const deployment = response.body;
expect(deployment.spec?.template.spec).toEqual(
expect.objectContaining({
securityContext: {
fsGroup: 65534,
fsGroupChangePolicy: 'Always',
},
}),
);

expect(deployment.spec?.template?.spec?.containers?.[0]).toEqual(
expect.objectContaining({
securityContext: {
Expand Down
1 change: 1 addition & 0 deletions test/setup/deployers/helm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ async function deployKubernetesMonitor(
'--set rbac.serviceAccount.annotations."foo"="bar" ' +
'--set volumes.projected.serviceAccountToken=true ' +
'--set securityContext.fsGroup=65534 ' +
'--set podSecurityContext.fsGroupChangePolicy="Always" ' +
'--set skopeo.compression.level=1 ' +
'--set workers.count=5 ' +
'--set sysdig.enabled=true ',
Expand Down

0 comments on commit 191e1b6

Please sign in to comment.