Skip to content
Merged
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 charts/kubescape-operator/.helmignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
tests
templates/node-agent-crds/README.md
2 changes: 0 additions & 2 deletions charts/kubescape-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,6 @@ However, we recommend that you give Kubescape no less than 500m CPU no matter th
| operator.nodeSelector | object | `{}` | [Node selector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/) |
| operator.volumes | object | `[]` | Additional volumes for the web socket |
| operator.volumeMounts | object | `[]` | Additional volumeMounts for the web socket |
| hostScanner.volumes | object | `[]` | Additional volumes for the host scanner |
| hostScanner.volumeMounts | object | `[]` | Additional volumeMounts for the host scanner |
| awsIamRoleArn | string | `nil` | AWS IAM arn role |
| cloudProviderMetadata.secretRef.name | string | `nil` | secret name to define values for the provider's metadata |
| cloudProviderMetadata.cloudRegion | string or through `cloudProviderMetadata.secretRef.cloudRegionKey` if `cloudProviderMetadata.secretRef.name` is set | `nil` | cloud region |
Expand Down
129 changes: 0 additions & 129 deletions charts/kubescape-operator/assets/host-scanner-definition.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions charts/kubescape-operator/templates/_common.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
capabilitiesConfig: {{ include (printf "%s/%s/%s" $.Template.BasePath $.Values.global.configMapsDirectory "components-configmap.yaml") . | replace .Chart.AppVersion "" | sha256sum }}
cloudConfig: {{ include (printf "%s/%s/%s" $.Template.BasePath $.Values.global.configMapsDirectory "cloudapi-configmap.yaml") . | replace .Chart.AppVersion "" | sha256sum }}
cloudSecret: {{ include (printf "%s/%s/%s" $.Template.BasePath $.Values.global.configMapsDirectory "cloud-secret.yaml" ) . | replace .Chart.AppVersion "" | sha256sum }}
hostScannerConfig: {{ include (printf "%s/kubescape/host-scanner-definition-configmap.yaml" $.Template.BasePath ) . | replace .Chart.AppVersion "" | sha256sum }}
matchingRulesConfig: {{ include (printf "%s/%s/%s" $.Template.BasePath $.Values.global.configMapsDirectory "matchingRules-configmap.yaml") . | replace .Chart.AppVersion "" | sha256sum }}
nodeAgentConfig: {{ include (printf "%s/node-agent/configmap.yaml" $.Template.BasePath) . | replace .Chart.AppVersion "" | sha256sum }}
operatorConfig: {{ include (printf "%s/operator/configmap.yaml" $.Template.BasePath) . | replace .Chart.AppVersion "" | sha256sum }}
Expand Down Expand Up @@ -50,8 +49,6 @@ submit: {{ $submit }}
{{- $nodeScanEnabled := and (eq .Values.capabilities.nodeScan "enable") (not $configurations.backendStorageEnabled) }}
{{- $configurationScanEnabled := and (eq .Values.capabilities.configurationScan "enable") (not $configurations.backendStorageEnabled) }}
{{- $vulnerabilityScanEnabled := and (eq .Values.capabilities.vulnerabilityScan "enable") (not $configurations.backendStorageEnabled) }}
hostScanner:
enabled: {{ $nodeScanEnabled }}
kubescape:
enabled: {{ $configurationScanEnabled }}
kubescapeScheduler:
Expand Down
16 changes: 16 additions & 0 deletions charts/kubescape-operator/templates/kubescape/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,20 @@ rules:
- apiGroups: ["kubescape.io"]
resources: ["servicesscanresults"]
verbs: ["get", "watch", "list"]
{{- if .Values.nodeAgent.config.hostSensor.enabled }}
- apiGroups: ["hostdata.kubescape.cloud"]
resources:
- osreleasefiles
- kernelversions
- linuxsecurityhardeningstatuses
- openportslists
- linuxkernelvariables
- kubeletinfos
- kubeproxyinfos
- controlplaneinfos
- cloudproviderinfos
- cniinfos
verbs: ["get", "list", "watch"]
{{- end }}

{{ end }}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ spec:
annotations:
{{- include "kubescape-operator.annotations" (dict "Values" .Values) | nindent 8 }}
{{- with .Values.kubescape.podAnnotations }}{{- toYaml . | nindent 8 }}{{- end }}
checksum/host-scanner-configmap: {{ $checksums.hostScannerConfig }}
checksum/cloud-secret: {{ $checksums.cloudSecret }}
checksum/cloud-config: {{ $checksums.cloudConfig }}
{{- if ne .Values.global.proxySecretFile "" }}
Expand Down Expand Up @@ -146,7 +145,7 @@ spec:
- name: KS_DEFAULT_CLOUD_CONFIGMAP_NAME
value: {{ .Values.global.cloudConfig }}
- name: KS_ENABLE_HOST_SCANNER
value: "{{ $components.hostScanner.enabled }}"
value: "{{ .Values.nodeAgent.config.hostSensor.enabled }}"
- name: KS_SKIP_UPDATE_CHECK
value: "{{ .Values.kubescape.skipUpdateCheck }}"
- name: KS_HOST_SCAN_YAML
Expand Down
7 changes: 7 additions & 0 deletions charts/kubescape-operator/templates/node-agent-crds/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
### CRDs location inside the chart tree
These CRDs are placed in the `templates/` directory instead of the standard `crds/` directory to allow Helm to manage their full lifecycle.
Comment thread
Bezbran marked this conversation as resolved.
This ensures they are updated during `helm upgrade` and removed during `helm uninstall`, supporting the evolving sensing capabilities of the node-agent.
No need to install them before kubescape operator chart since they are about to be used only after node-agent is up and running.

### tech debt
1. move CRDs group from `kubescape.cloud` to `kubescape.io`
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{{- $components := fromYaml (include "components" .) }}
{{- if $components.nodeAgent.enabled }}
{{- if .Values.nodeAgent.config.hostSensor.enabled }}
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: cloudproviderinfos.hostdata.kubescape.cloud
spec:
group: hostdata.kubescape.cloud
names:
kind: CloudProviderInfo
listKind: CloudProviderInfoList
plural: cloudproviderinfos
singular: cloudproviderinfo
scope: Cluster
versions:
- name: v1beta1
served: true
storage: true
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
x-kubernetes-preserve-unknown-fields: true
status:
type: object
x-kubernetes-preserve-unknown-fields: true
additionalPrinterColumns:
- name: Node
type: string
jsonPath: .spec.nodeName
- name: Last Sensed
type: string
jsonPath: .status.lastSensed
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{{- $components := fromYaml (include "components" .) }}
{{- if $components.nodeAgent.enabled }}
{{- if .Values.nodeAgent.config.hostSensor.enabled }}
Comment thread
matthyx marked this conversation as resolved.
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: cniinfos.hostdata.kubescape.cloud
spec:
group: hostdata.kubescape.cloud
names:
kind: CNIInfo
listKind: CNIInfoList
plural: cniinfos
singular: cniinfo
scope: Cluster
versions:
- name: v1beta1
served: true
storage: true
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
x-kubernetes-preserve-unknown-fields: true
status:
type: object
x-kubernetes-preserve-unknown-fields: true
additionalPrinterColumns:
- name: Node
type: string
jsonPath: .spec.nodeName
- name: Last Sensed
type: string
jsonPath: .status.lastSensed
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{{- $components := fromYaml (include "components" .) }}
{{- if $components.nodeAgent.enabled }}
{{- if .Values.nodeAgent.config.hostSensor.enabled }}
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: controlplaneinfos.hostdata.kubescape.cloud
spec:
group: hostdata.kubescape.cloud
names:
kind: ControlPlaneInfo
listKind: ControlPlaneInfoList
plural: controlplaneinfos
singular: controlplaneinfo
scope: Cluster
versions:
- name: v1beta1
served: true
storage: true
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
x-kubernetes-preserve-unknown-fields: true
status:
type: object
x-kubernetes-preserve-unknown-fields: true
additionalPrinterColumns:
- name: Node
type: string
jsonPath: .spec.nodeName
- name: Last Sensed
type: string
jsonPath: .status.lastSensed
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{{- $components := fromYaml (include "components" .) }}
{{- if $components.nodeAgent.enabled }}
{{- if .Values.nodeAgent.config.hostSensor.enabled }}
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: kernelversions.hostdata.kubescape.cloud
spec:
group: hostdata.kubescape.cloud
names:
kind: KernelVersion
listKind: KernelVersionList
plural: kernelversions
singular: kernelversion
scope: Cluster
versions:
- name: v1beta1
served: true
storage: true
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
x-kubernetes-preserve-unknown-fields: true
status:
type: object
x-kubernetes-preserve-unknown-fields: true
additionalPrinterColumns:
- name: Node
type: string
jsonPath: .spec.nodeName
- name: Last Sensed
type: string
jsonPath: .status.lastSensed
{{- end }}
{{- end }}
Loading
Loading