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

Make deployments compliant with PSS policies #234

Merged
merged 5 commits into from
Sep 27, 2023
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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ and this project's packages adheres to [Semantic Versioning](http://semver.org/s

## [Unreleased]

### Changed

- Make App compliant with PSS policies ([#234](https://github.com/giantswarm/coredns-app/pull/234)):
- Set seccompProfile to `RuntimeDefault`.
- Fix capabilities typo.
- Remove `NET_BIND_SERVICE` capabilities.
- Set `runAsNonRoot` as true.

## [1.18.1] - 2023-08-30

### Fixed
Expand Down
7 changes: 4 additions & 3 deletions helm/coredns-app/templates/deployment-masters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ spec:
securityContext:
runAsUser: {{ .Values.userID }}
runAsGroup: {{ .Values.groupID }}
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
tolerations:
- effect: NoSchedule
operator: "Exists"
Expand Down Expand Up @@ -70,10 +73,8 @@ spec:
securityContext:
allowPrivilegeEscalation: false
capabilities:
add:
- NET_BIND_SERVICE
drop:
- all
- ALL
readOnlyRootFilesystem: true
volumeMounts:
- name: config-volume
Expand Down
7 changes: 4 additions & 3 deletions helm/coredns-app/templates/deployment-workers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ spec:
securityContext:
runAsUser: {{ .Values.userID }}
runAsGroup: {{ .Values.groupID }}
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
tolerations:
- operator: "Exists"
key: "node.cloudprovider.kubernetes.io/uninitialized"
Expand All @@ -54,10 +57,8 @@ spec:
securityContext:
allowPrivilegeEscalation: false
capabilities:
add:
- NET_BIND_SERVICE
drop:
- all
- ALL
readOnlyRootFilesystem: true
volumeMounts:
- name: config-volume
Expand Down
4 changes: 3 additions & 1 deletion helm/coredns-app/templates/psp.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{{- if le (int .Capabilities.KubeVersion.Minor) 24 }}
{{- if and (le (int .Capabilities.KubeVersion.Minor) 24) (not .Values.global.podSecurityStandards.enforced) }}
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: {{ .Values.name }}
namespace: {{ .Values.namespace }}
annotations:
seccomp.security.alpha.kubernetes.io/allowedProfileNames: 'runtime/default'
labels:
{{- include "labels.common" . | nindent 4 }}
spec:
Expand Down
13 changes: 13 additions & 0 deletions helm/coredns-app/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,19 @@
}
}
},
"global": {
"type": "object",
"properties": {
"podSecurityStandards": {
"type": "object",
"properties": {
"enforced": {
"type": "boolean"
}
}
}
}
},
"groupID": {
"type": "integer"
},
Expand Down
5 changes: 5 additions & 0 deletions helm/coredns-app/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ mastersInstance:
nodeSelector:
"node-role.kubernetes.io/control-plane": '""'


global:
podSecurityStandards:
enforced: false

# Uncomment and define `additionalLocalZones` to add additional local zones to CoreDNS config
# additionalLocalZones: []

Expand Down