Skip to content

Commit

Permalink
Add use of the runtime/default seccomp profile. (#270)
Browse files Browse the repository at this point in the history
* Add use of the runtime/default seccomp profile.

* Made deployment use new seccomp profile.

* Update .nancy-ignore

Co-authored-by: Laszlo Uveges <laszlo@giantswarm.io>

Thanks for reviewing, before releasing, please confirm this doesn't break anything. (It shouldn't)
  • Loading branch information
Strigix committed Jan 26, 2023
1 parent 1bdd91a commit 71b8470
Show file tree
Hide file tree
Showing 6 changed files with 149 additions and 23 deletions.
33 changes: 10 additions & 23 deletions .nancy-ignore
Original file line number Diff line number Diff line change
@@ -1,31 +1,18 @@
# pkg:golang/github.com/hashicorp/consul/sdk@v0.9.0
CVE-2022-29153 until=2022-12-31
CVE-2022-24687 until=2022-12-31
# pkg:golang/github.com/hashicorp/consul/api@v1.15.3
CVE-2022-29153 until=2023-06-30

# pkg:golang/github.com/hashicorp/consul/api@v1.12.0
CVE-2021-41803 until=2022-12-31
# pkg:golang/github.com/hashicorp/consul/sdk@v0.3.0
CVE-2022-29153 until=2023-06-30

# pkg:golang/github.com/kataras/iris/v12@v12.1.8
CVE-2021-23772 until=2022-12-31
CVE-2021-23772 until=2023-06-30

# pkg:golang/k8s.io/apiserver@v0.24.3
# This is present in the current latest v0.26.0 as well
sonatype-2022-6522 until=2023-02-01
# pkg:golang/github.com/nats-io/nats-server/v2@v2.9.0
CVE-2022-42709 until=2023-06-30
CVE-2022-42708 until=2023-06-30

# pkg:golang/github.com/urfave/negroni@v1.0.0
sonatype-2021-1485 until=2022-12-31

# pkg:golang/github.com/nats-io/nats-server/v2@v2.5.0
CVE-2022-42709 until=2022-12-31
CVE-2022-42708 until=2022-12-31
sonatype-2021-1485 until=2023-06-30

# pkg:golang/k8s.io/apiserver@v0.24.3
# The current latest v0.26.0 has the same issue
sonatype-2022-6522 until=2023-02-01

# pkg:golang/golang.org/x/text@v0.3.7
CVE-2022-32149 until=2022-12-31

# pkg:golang/github.com/hashicorp/vault/sdk@v0.5.3
# pkg:golang/github.com/hashicorp/vault/api@v1.7.2
CVE-2022-36129 until=2022-12-31
sonatype-2022-6522 until=2023-06-30
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

- Add use of the runtime/default seccomp profile.

## [0.6.0] - 2022-07-21

### Changed
Expand Down
7 changes: 7 additions & 0 deletions helm/config-controller/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ spec:
securityContext:
runAsUser: {{ .Values.pod.user.id }}
runAsGroup: {{ .Values.pod.group.id }}
{{- with .Values.podSecurityContext }}
{{- . | toYaml | nindent 8 }}
{{- end }}
initContainers:
- args:
- --vault-address={{ .Values.vault.address }}
Expand Down Expand Up @@ -89,6 +92,10 @@ spec:
port: 8000
initialDelaySeconds: 30
timeoutSeconds: 1
securityContext:
{{- with .Values.securityContext }}
{{- . | toYaml | nindent 10 }}
{{- end }}
resources:
requests:
cpu: 100m
Expand Down
2 changes: 2 additions & 0 deletions helm/config-controller/templates/psp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: {{ include "resource.psp.name" . }}
annotations:
seccomp.security.alpha.kubernetes.io/allowedProfileNames: 'runtime/default'
labels:
{{- include "labels.common" . | nindent 4 }}
spec:
Expand Down
118 changes: 118 additions & 0 deletions helm/config-controller/values.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
{
"$schema": "http://json-schema.org/schema#",
"type": "object",
"properties": {
"github": {
"type": "object",
"properties": {
"token": {
"type": "string"
}
}
},
"image": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"tag": {
"type": "string"
}
}
},
"k8sJwtToVaultTokenImage": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"tag": {
"type": "string"
}
}
},
"managementCluster": {
"type": "object",
"properties": {
"name": {
"type": "string"
}
}
},
"pod": {
"type": "object",
"properties": {
"group": {
"type": "object",
"properties": {
"id": {
"type": "integer"
}
}
},
"user": {
"type": "object",
"properties": {
"id": {
"type": "integer"
}
}
}
}
},
"podSecurityContext": {
"type": "object",
"properties": {
"seccompProfile": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
}
}
},
"project": {
"type": "object",
"properties": {
"branch": {
"type": "string"
},
"commit": {
"type": "string"
}
}
},
"registry": {
"type": "object",
"properties": {
"domain": {
"type": "string"
}
}
},
"securityContext": {
"type": "object",
"properties": {
"seccompProfile": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
}
}
},
"vault": {
"type": "object",
"properties": {
"address": {
"type": "string"
}
}
}
}
}
10 changes: 10 additions & 0 deletions helm/config-controller/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,13 @@ vault:

github:
token: ""

# Add seccomp to pod security context
podSecurityContext:
seccompProfile:
type: RuntimeDefault

# Add seccomp to container security context
securityContext:
seccompProfile:
type: RuntimeDefault

0 comments on commit 71b8470

Please sign in to comment.