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

cspl-2505: add Pod Security standard to restricted #1266

Merged
merged 4 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
7 changes: 7 additions & 0 deletions config/default/manager_auth_proxy_patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ spec:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
runAsNonRoot: true
capabilities:
drop:
- "ALL"
add:
- "NET_BIND_SERVICE"
seccompProfile:
type: "RuntimeDefault"
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.13.1
args:
- "--secure-listen-address=0.0.0.0:8443"
Expand Down
11 changes: 10 additions & 1 deletion config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spec:
matchLabels:
control-plane: controller-manager
name: splunk-operator
strategy:
strategy:
type: Recreate
replicas: 1
template:
Expand All @@ -36,6 +36,8 @@ spec:
hostNetwork: false
hostPID: false
hostIPC: false
imagePullSecrets:
akondur marked this conversation as resolved.
Show resolved Hide resolved
- name: docker-registry
containers:
- command:
- /manager
Expand All @@ -54,6 +56,13 @@ spec:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
runAsNonRoot: true
capabilities:
drop:
- "ALL"
add:
- "NET_BIND_SERVICE"
seccompProfile:
type: "RuntimeDefault"
livenessProbe:
httpGet:
path: /healthz
Expand Down
12 changes: 6 additions & 6 deletions pkg/splunk/enterprise/clustermanager_test.go

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions pkg/splunk/enterprise/clustermaster_test.go

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions pkg/splunk/enterprise/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -1009,13 +1009,31 @@ func updateSplunkPodTemplateWithConfig(ctx context.Context, client splcommon.Con
env = removeDuplicateEnvVars(env)
}

privileged := false
// update each container in pod
for idx := range podTemplateSpec.Spec.Containers {
podTemplateSpec.Spec.Containers[idx].Resources = spec.Resources
podTemplateSpec.Spec.Containers[idx].LivenessProbe = livenessProbe
podTemplateSpec.Spec.Containers[idx].ReadinessProbe = readinessProbe
podTemplateSpec.Spec.Containers[idx].StartupProbe = startupProbe
podTemplateSpec.Spec.Containers[idx].Env = env
podTemplateSpec.Spec.Containers[idx].SecurityContext = &corev1.SecurityContext{
RunAsUser: &runAsUser,
RunAsNonRoot: &runAsNonRoot,
AllowPrivilegeEscalation: &[]bool{false}[0],
Capabilities: &corev1.Capabilities{
Drop: []corev1.Capability{
"ALL",
},
Add: []corev1.Capability{
"NET_BIND_SERVICE",
},
},
Privileged: &privileged,
SeccompProfile: &corev1.SeccompProfile{
Type: corev1.SeccompProfileTypeRuntimeDefault,
},
}
}
}

Expand Down
12 changes: 6 additions & 6 deletions pkg/splunk/enterprise/indexercluster_test.go

Large diffs are not rendered by default.

241 changes: 132 additions & 109 deletions pkg/splunk/enterprise/licensemanager_test.go

Large diffs are not rendered by default.

269 changes: 142 additions & 127 deletions pkg/splunk/enterprise/licensemaster_test.go

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions pkg/splunk/enterprise/monitoringconsole_test.go

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions pkg/splunk/enterprise/searchheadcluster_test.go

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions pkg/splunk/enterprise/standalone_test.go

Large diffs are not rendered by default.

Loading