Skip to content
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
3 changes: 3 additions & 0 deletions deploy/eck-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ securityContext:
- ALL
readOnlyRootFilesystem: true
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault


# nodeSelector defines the node selector for the operator pod.
nodeSelector: {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ func For(ver version.Version, enableReadOnlyRootFilesystem bool) corev1.Security
Privileged: ptr.To[bool](false),
ReadOnlyRootFilesystem: ptr.To[bool](enableReadOnlyRootFilesystem),
AllowPrivilegeEscalation: ptr.To[bool](false),
SeccompProfile: &corev1.SeccompProfile{
Type: corev1.SeccompProfileTypeRuntimeDefault,
},
}
if ver.LT(DropCapabilitiesMinStackVersion) {
return sc
Expand All @@ -50,6 +53,9 @@ func DefaultBeatSecurityContext(ver version.Version) *corev1.SecurityContext {
Privileged: ptr.To[bool](false),
ReadOnlyRootFilesystem: ptr.To[bool](true),
AllowPrivilegeEscalation: ptr.To[bool](false),
SeccompProfile: &corev1.SeccompProfile{
Type: corev1.SeccompProfileTypeRuntimeDefault,
},
}
if ver.LT(RunAsNonRootMinStackVersion) {
return sc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ func TestFor(t *testing.T) {
Privileged: ptr.To[bool](false),
ReadOnlyRootFilesystem: ptr.To[bool](false),
AllowPrivilegeEscalation: ptr.To[bool](false),
SeccompProfile: &corev1.SeccompProfile{
Type: corev1.SeccompProfileTypeRuntimeDefault,
},
},
},
{
Expand All @@ -49,6 +52,9 @@ func TestFor(t *testing.T) {
Privileged: ptr.To[bool](false),
ReadOnlyRootFilesystem: ptr.To[bool](false),
AllowPrivilegeEscalation: ptr.To[bool](false),
SeccompProfile: &corev1.SeccompProfile{
Type: corev1.SeccompProfileTypeRuntimeDefault,
},
},
},
{
Expand All @@ -62,6 +68,9 @@ func TestFor(t *testing.T) {
Privileged: ptr.To[bool](false),
ReadOnlyRootFilesystem: ptr.To[bool](true),
AllowPrivilegeEscalation: ptr.To[bool](false),
SeccompProfile: &corev1.SeccompProfile{
Type: corev1.SeccompProfileTypeRuntimeDefault,
},
},
},
}
Expand Down Expand Up @@ -90,6 +99,9 @@ func TestDefaultBeatSecurityContext(t *testing.T) {
Privileged: ptr.To[bool](false),
ReadOnlyRootFilesystem: ptr.To[bool](true),
AllowPrivilegeEscalation: ptr.To[bool](false),
SeccompProfile: &corev1.SeccompProfile{
Type: corev1.SeccompProfileTypeRuntimeDefault,
},
},
},
{
Expand All @@ -103,6 +115,9 @@ func TestDefaultBeatSecurityContext(t *testing.T) {
ReadOnlyRootFilesystem: ptr.To[bool](true),
RunAsNonRoot: ptr.To[bool](true),
AllowPrivilegeEscalation: ptr.To[bool](false),
SeccompProfile: &corev1.SeccompProfile{
Type: corev1.SeccompProfileTypeRuntimeDefault,
},
},
},
}
Expand Down