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

sensor | clusterrole | add resources and verbs #340

Open
wants to merge 1 commit into
base: main
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions helm-charts/falcon-sensor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ The following tables lists the more common configurable parameters of the chart
| `node.image.pullSecrets` | Pull secrets for private registry | None (Conflicts with node.image.registryConfigJSON) |
| `node.image.registryConfigJSON` | base64 encoded docker config json for the pull secret | None (Conflicts with node.image.pullSecrets) |
| `node.daemonset.resources` | Configure Node sensor resource requests and limits (eBPF mode only) | None (Minimum setting of 250m CPU and 500Mi memory allowed). Default for GKE Autopilot is 750m CPU and 1.5Gi memory.<br><br><div class="warning">:warning: **Warning**:<br>If you configure resources, you must configure the CPU and Memory Resource requests and limits correctly for your node instances for the node sensor to run properly!</div> |
| `node.cdpRolesEnabled` | Enable cluster roles for Cloud Data Protection module | `true` |
| `falcon.cid` | CrowdStrike Customer ID (CID) | None (Required) |

`falcon.cid` and `node.image.repository` are required values.
Expand Down
22 changes: 21 additions & 1 deletion helm-charts/falcon-sensor/templates/clusterrole.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.container.enabled }}
{{- if or .Values.container.enabled (and .Values.node.enabled .Values.node.cdpRolesEnabled)}}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand All @@ -8,14 +8,34 @@ metadata:
app.kubernetes.io/name: {{ include "falcon-sensor.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{ if .Values.container.enabled }}
app.kubernetes.io/component: "container_sensor"
{{ else if (and .Values.node.enabled .Values.node.cdpRolesEnabled)}}
app.kubernetes.io/component: "kernel_sensor"
{{ end }}
crowdstrike.com/provider: crowdstrike
helm.sh/chart: {{ include "falcon-sensor.chart" . }}
rules:
- apiGroups:
- ""
resources:
- secrets

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is secrets required by cdp?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

{{- if and .Values.node.enabled .Values.node.cdpRolesEnabled }}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked other resources that we create; all_sensor is applicable, only if we use the same resource name for multiple sensor types. In this case we create resource using the variable "falcon-sensor.fullname" and that is unique per deployment. So we should add

{{ if .Values.container.enabled }}
app.kubernetes.io/component: "container_sensor"
{{ else if (and .Values.node.enabled .Values.node.cdpRolesEnabled)}}
app.kubernetes.io/component: "kernel_sensor"
{{ end }}

- pods
- services
- nodes
- daemonsets
- replicasets
- deployments
- jobs
- ingresses
- cronjobs
- persistentvolumes
{{- end }}
verbs:
- get
{{- if and .Values.node.enabled .Values.node.cdpRolesEnabled }}
- watch
- list
{{- end }}
{{- end }}
6 changes: 5 additions & 1 deletion helm-charts/falcon-sensor/templates/clusterrolebinding.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.container.enabled }}
{{- if or .Values.container.enabled (and .Values.node.enabled .Values.node.cdpRolesEnabled) }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
Expand All @@ -8,7 +8,11 @@ metadata:
app.kubernetes.io/name: {{ include "falcon-sensor.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{ if .Values.container.enabled }}
app.kubernetes.io/component: "container_sensor"
{{ else if (and .Values.node.enabled .Values.node.cdpRolesEnabled)}}
app.kubernetes.io/component: "kernel_sensor"
{{ end }}
crowdstrike.com/provider: crowdstrike
helm.sh/chart: {{ include "falcon-sensor.chart" . }}
subjects:
Expand Down
3 changes: 3 additions & 0 deletions helm-charts/falcon-sensor/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ node:
postDelete:
enabled: true

# When enabled, Cloud data protection module is enabled
cdpRolesEnabled: true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If data protection is not a separate sku, why are we adding this boolean? Permissions should be applied by default.


container:
# When enabled, Helm chart deploys the Falcon Container Sensor to Pods through Webhooks
enabled: false
Expand Down