Skip to content

Commit 9a7b9c4

Browse files
authored
Merge pull request #32 from olhado/rel-2.4.0
Update for new agent
2 parents e95a070 + 1481df6 commit 9a7b9c4

File tree

6 files changed

+25
-39
lines changed

6 files changed

+25
-39
lines changed

Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v1
22
name: threatstack-agent
3-
version: 2.1.3
4-
appVersion: 2.3.4
3+
version: 2.2.0
4+
appVersion: 2.4.0
55
description: A Helm chart for the Threat Stack Cloud Security Agent
66
keywords:
77
- security

README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,12 @@ The following kubernetes objects are created when the chart is installed:
5353
| daemonset.customAuditRules | string | `""` | |
5454
| daemonset.customLuaFilter | string | `""` | |
5555
| daemonset.customTsAuditdConfig | string | `""` | |
56-
| daemonset.enableContainerd | bool | `false` | Defaults to `false`, configures the daemonset agents to listen to the containerd daemon socket |
57-
| daemonset.enableDocker | bool | `true` | Defaults to `true`, configures the daemonset agents to listen to the docker daemon socket |
56+
| daemonset.enableContainerd | bool | `unset` | Configures the daemonset agents to listen to the containerd daemon socket. **By default in agent 2.4.0+, the agent detects if containerd is running at startup** |
57+
| daemonset.enableDocker | bool | `unset` | Configures the daemonset agents to listen to the docker daemon socket. **By default in agent 2.4.0+, the agent detects if docker is running at startup** |
5858
| daemonset.nodeSelector | object | `{}` | |
5959
| daemonset.podAnnotations."container.apparmor.security.beta.kubernetes.io/threatstack-agent" | string | `"unconfined"` | |
6060
| daemonset.priorityClassName | string | `""` | Optionally set the priority class name for the daemonset pods. Note that priority classes are not created via this helm chart. Ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/ |
6161
| daemonset.tolerations | list | `[]` | |
62-
| daemonset.volumes.containerdsocket.hostPath | string | `"/run/containerd/containerd.sock"` | Path to docker daemon's socket |
63-
| daemonset.volumes.dockersocket.hostPath | string | `"/var/run/docker.sock"` | Path to docker daemon's socket |
64-
| daemonset.volumes.oldcontainerdsocket.hostPath | string | `"/var/run/docker/containerd/docker-containerd.sock"` | Path to older containerd daemon's socket |
6562
| eksAmazon2 | bool | `false` | If `true`, the Daemonset definition will be modified to execute commands for the agent to work correctly on EKS with Amazon Linux 2 nodes. Defaults to `false` |
6663
| eksAmazon2Cmd.args[0] | string | `"-c"` | |
6764
| eksAmazon2Cmd.args[1] | string | `"chroot /threatstackfs /bin/bash -c 'service auditd stop; systemctl disable auditd'; eval tsagent setup $THREATSTACK_SETUP_ARGS; eval tsagent config --set $THREATSTACK_CONFIG_ARGS; sleep 5; /opt/threatstack/sbin/tsagentd -logstdout"` | |

templates/_helpers.tpl

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,29 @@ Create chart name and version as used by the chart label.
3232
{{- end -}}
3333

3434
{{/*
35-
Return runtime config if docker enabled
35+
Return runtime config if docker is disabled
3636
*/}}
3737
{{- define "threatstack-agent.docker-config" -}}
38-
{{- if .Values.daemonset.enableDocker -}}
38+
{{- if kindIs "invalid" .Values.daemonset.enableDocker -}}
39+
{{- else -}}
40+
{{- if eq .Values.daemonset.enableDocker false -}}
41+
{{- default "container_runtimes.docker.enabled false container_runtimes.docker.kubernetes_enabled false" -}}
42+
{{- else -}}
3943
{{- default "container_runtimes.docker.enabled true container_runtimes.docker.kubernetes_enabled true" -}}
4044
{{- end -}}
4145
{{- end -}}
46+
{{- end -}}
4247

4348
{{/*
44-
Return runtime config if containerd enabled
49+
Return runtime config if containerd is disabled
4550
*/}}
4651
{{- define "threatstack-agent.containerd-config" -}}
47-
{{- if .Values.daemonset.enableContainerd -}}
52+
{{- if kindIs "invalid" .Values.daemonset.enableContainerd -}}
53+
{{- else -}}
54+
{{- if eq .Values.daemonset.enableContainerd false -}}
55+
{{- default "container_runtimes.containerd.enabled false container_runtimes.containerd.kubernetes_enabled false" -}}
56+
{{- else -}}
4857
{{- default "container_runtimes.containerd.enabled true container_runtimes.containerd.kubernetes_enabled true" -}}
4958
{{- end -}}
5059
{{- end -}}
60+
{{- end -}}

templates/daemonset.yaml

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ spec:
7676
exec:
7777
command: [ "sh", "-c", "tsagent status" ]
7878
initialDelaySeconds: 15
79-
periodSeconds: 60
79+
periodSeconds: 360
8080
timeoutSeconds: 5
8181
successThreshold: 1
8282
failureThreshold: 5
@@ -117,12 +117,6 @@ spec:
117117
volumeMounts:
118118
- name: hostfs
119119
mountPath: /threatstackfs
120-
- name: dockersocket
121-
mountPath: /var/run/docker.sock
122-
- name: containerdsocket
123-
mountPath: /run/containerd/containerd.sock
124-
- name: oldcontainerdsocket
125-
mountPath: /var/run/docker/containerd/docker-containerd.sock
126120
{{- if .Values.daemonset.customAuditRules }}
127121
- name: custom-audit-rules
128122
mountPath: /opt/threatstack/etc/audit-custom.rules
@@ -142,15 +136,6 @@ spec:
142136
- hostPath:
143137
path: /
144138
name: hostfs
145-
- hostPath:
146-
path: {{ .Values.daemonset.volumes.dockersocket.hostPath }}
147-
name: dockersocket
148-
- hostPath:
149-
path: {{ .Values.daemonset.volumes.containerdsocket.hostPath }}
150-
name: containerdsocket
151-
- hostPath:
152-
path: {{ .Values.daemonset.volumes.oldcontainerdsocket.hostPath }}
153-
name: oldcontainerdsocket
154139
{{- if .Values.daemonset.customAuditRules }}
155140
- name: custom-audit-rules
156141
configMap:

templates/deployment-api-reader.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ spec:
5959
exec:
6060
command: [ "sh", "-c", "tsagent status" ]
6161
initialDelaySeconds: 15
62-
periodSeconds: 60
62+
periodSeconds: 360
6363
timeoutSeconds: 5
6464
successThreshold: 1
6565
failureThreshold: 5

values.yaml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,11 @@ apiReader:
145145
#
146146
########
147147
daemonset:
148-
enableDocker: true
149-
enableContainerd: false
148+
# Override the agent's default detection behavior that determines
149+
# which docker service to monitor
150+
#
151+
# enableDocker: false
152+
# enableContainerd: false
150153

151154
additionalRuntimeConfig: "log.level info"
152155
# Override the agent's liveness probe logic from the default:
@@ -188,15 +191,6 @@ daemonset:
188191
# Ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
189192
priorityClassName: ""
190193

191-
# Configure hostPaths for docker and containerd sockets
192-
volumes:
193-
dockersocket:
194-
hostPath: "/var/run/docker.sock"
195-
containerdsocket:
196-
hostPath: "/run/containerd/containerd.sock"
197-
oldcontainerdsocket:
198-
hostPath: "/var/run/docker/containerd/docker-containerd.sock"
199-
200194
## Annotations to add to the threatstack daemonset pod(s)
201195
#
202196
# To remove the apparmor annotation, add a comment as the attribute value,

0 commit comments

Comments
 (0)