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-2558 - Enforce read only root file system #1306

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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.

2 changes: 2 additions & 0 deletions pkg/splunk/enterprise/configuration.go
Expand Up @@ -1012,6 +1012,7 @@ func updateSplunkPodTemplateWithConfig(ctx context.Context, client splcommon.Con
}

privileged := false
roFs := true
// update each container in pod
for idx := range podTemplateSpec.Spec.Containers {
podTemplateSpec.Spec.Containers[idx].Resources = spec.Resources
Expand All @@ -1022,6 +1023,7 @@ func updateSplunkPodTemplateWithConfig(ctx context.Context, client splcommon.Con
podTemplateSpec.Spec.Containers[idx].SecurityContext = &corev1.SecurityContext{
RunAsUser: &runAsUser,
RunAsNonRoot: &runAsNonRoot,
ReadOnlyRootFilesystem: &roFs,
AllowPrivilegeEscalation: &[]bool{false}[0],
Capabilities: &corev1.Capabilities{
Drop: []corev1.Capability{
Expand Down
12 changes: 6 additions & 6 deletions pkg/splunk/enterprise/indexercluster_test.go

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions pkg/splunk/enterprise/licensemanager_test.go

Large diffs are not rendered by default.

10 changes: 5 additions & 5 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.

2 changes: 2 additions & 0 deletions pkg/splunk/enterprise/util.go
Expand Up @@ -683,6 +683,7 @@ func setupInitContainer(podTemplateSpec *corev1.PodTemplateSpec, Image string, i
runAsUser := int64(41812)
runAsNonRoot := true
privileged := false
roFs := true
containerSpec := corev1.Container{
Image: Image,
ImagePullPolicy: corev1.PullPolicy(imagePullPolicy),
Expand All @@ -706,6 +707,7 @@ func setupInitContainer(podTemplateSpec *corev1.PodTemplateSpec, Image string, i
SecurityContext: &corev1.SecurityContext{
RunAsUser: &runAsUser,
RunAsNonRoot: &runAsNonRoot,
ReadOnlyRootFilesystem: &roFs,
AllowPrivilegeEscalation: &[]bool{false}[0],
Capabilities: &corev1.Capabilities{
Drop: []corev1.Capability{
Expand Down