Skip to content

Commit

Permalink
Revert "feat(agent): [SMAGENT-8138] add full securityContext to agent…
Browse files Browse the repository at this point in the history
… charts …"

This reverts commit 550c06f.
  • Loading branch information
iurly authored Dec 18, 2024
1 parent 65e0d23 commit d55b53d
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 70 deletions.
2 changes: 1 addition & 1 deletion charts/agent/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ sources:
- https://app.sysdigcloud.com/#/settings/user
- https://github.com/draios/sysdig
type: application
version: 1.34.1
version: 1.34.0
6 changes: 0 additions & 6 deletions charts/agent/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -690,14 +690,8 @@ annotations:
privileged: true
runAsNonRoot: false
runAsUser: 0
runAsGroup: 0
readOnlyRootFilesystem: false
allowPrivilegeEscalation: true
capabilities:
drop:
- ALL
add:
- ALL
{{- else }}
allowPrivilegeEscalation: false
seccompProfile:
Expand Down
10 changes: 0 additions & 10 deletions charts/agent/templates/daemonset-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,6 @@ spec:
{{ toYaml .Values.global.image.pullSecrets | nindent 8 }}
{{- end }}
securityContext:
privileged: true
{{- if ( semverCompare ">= 1.31.0" (.Capabilities.KubeVersion.GitVersion )) }}
runAsNonRoot: false
runAsGroup: 0
{{- end }}
readOnlyRootFilesystem: false
allowPrivilegeEscalation: true
capabilities:
add:
- ALL
windowsOptions:
hostProcess: true
runAsUserName: "NT AUTHORITY\\SYSTEM"
Expand Down
6 changes: 0 additions & 6 deletions charts/agent/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,9 @@ spec:
securityContext:
privileged: true
runAsNonRoot: false
runAsGroup: 0
runAsUser: 0
readOnlyRootFilesystem: false
allowPrivilegeEscalation: true
capabilities:
drop:
- ALL
add:
- ALL
resources:
{{- if (include "agent.gke.autopilot" .) }}
{{- $resources := merge .Values.slim.resources (dict "requests" (dict "ephemeral-storage" .Values.gke.ephemeralStorage))}}
Expand Down
4 changes: 0 additions & 4 deletions charts/agent/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,8 @@ spec:
privileged: true
runAsNonRoot: false
runAsUser: 0
runAsGroup: 0
readOnlyRootFilesystem: false
allowPrivilegeEscalation: true
capabilities:
add:
- ALL
env:
- name: RUN_MODE
value: nodriver
Expand Down
3 changes: 0 additions & 3 deletions charts/agent/tests/readiness_probe_windows_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ kubernetesProvider:
tests:

- it: "Windows Agent Probes (agent < 1.3.0)"
capabilities:
majorVersion: 1
minorVersion: 31
set:
windows:
enabled: true
Expand Down
38 changes: 0 additions & 38 deletions charts/agent/tests/security_context_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@ tests:
readOnlyRootFilesystem: false
runAsNonRoot: false
runAsUser: 0
runAsGroup: 0
capabilities:
drop:
- ALL
add:
- ALL

- it: Ensure the securityContext for a non-privileged agent contains the keys defined
set:
Expand Down Expand Up @@ -131,35 +125,3 @@ tests:
- SYS_TIME
- SYS_TTY_CONFIG
- WAKE_ALARM

- it: Ensure the securityContext contains the mandatory keys
asserts:
- isSubset:
path: spec.template.spec['initContainers','containers'][:].securityContext.capabilities
content:
drop:
- ALL
- exists:
path: spec.template.spec.initContainers[:].securityContext.runAsNonRoot
- exists:
path: spec.template.spec.containers[:].securityContext.runAsNonRoot
- exists:
path: spec.template.spec.initContainers[:].securityContext.runAsUser
- exists:
path: spec.template.spec.containers[:].securityContext.runAsUser
- exists:
path: spec.template.spec.initContainers[:].securityContext.runAsGroup
- exists:
path: spec.template.spec.containers[:].securityContext.runAsGroup
- exists:
path: spec.template.spec.initContainers[:].securityContext.privileged
- exists:
path: spec.template.spec.containers[:].securityContext.privileged
- exists:
path: spec.template.spec.initContainers[:].securityContext.allowPrivilegeEscalation
- exists:
path: spec.template.spec.containers[:].securityContext.allowPrivilegeEscalation
- exists:
path: spec.template.spec.initContainers[:].securityContext.readOnlyRootFilesystem
- exists:
path: spec.template.spec.containers[:].securityContext.readOnlyRootFilesystem
4 changes: 2 additions & 2 deletions charts/sysdig-deploy/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: sysdig-deploy
description: A chart with various Sysdig components for Kubernetes
type: application
version: 1.72.3
version: 1.72.2
maintainers:
- name: AlbertoBarba
email: [email protected]
Expand All @@ -26,7 +26,7 @@ dependencies:
- name: agent
# repository: https://charts.sysdig.com
repository: file://../agent
version: ~1.34.1
version: ~1.34.0
alias: agent
condition: agent.enabled
- name: common
Expand Down

0 comments on commit d55b53d

Please sign in to comment.