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

updated charts #35

Closed
wants to merge 1 commit into from
Closed
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
12 changes: 0 additions & 12 deletions cis-k8s-job/values.yaml

This file was deleted.

43 changes: 43 additions & 0 deletions k8s-jobs/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
apiVersion: v2
name: k8s-jobs
description: A Helm chart for managing Kubernetes jobs including CIS compliance checks, risk assessment jobs, TLS management jobs, and more.


# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.16.0"

dependencies:
- name: cis-k8s-job
version: "0.1.0"
repository: "file://charts/cis-k8s-job"
condition: accuknox.cis.enabled
- name: k8s-risk-assessment-job
version: "0.1.0"
repository: "file://charts/k8s-risk-assessment-job"
condition: accuknox.riskassessment.enabled
- name: k8tls-job
version: "0.1.0"
repository: "file://charts/k8tls-job"
condition: accuknox.k8tls.enabled
- name: kiem-job
version: "0.1.0"
repository: "file://charts/kiem-job"
condition: accuknox.kiem.enabled
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.accuknox.cis.enabled }}
apiVersion: batch/v1
kind: CronJob
metadata:
Expand All @@ -18,17 +19,17 @@ spec:
resources: {}
env:
- name: AUTH_TOKEN
value: {{ .Values.accuknox.authToken }}
value: {{ .Values.global.authToken }}
- name: CLUSTER_NAME
value: {{ .Values.accuknox.clusterName }}
value: {{ .Values.global.clusterName }}
- name: LABEL_NAME
value: {{ .Values.accuknox.label }}
value: {{ .Values.global.label }}
- name: CLUSTER_ID
value: {{ .Values.accuknox.clusterId }}
value: {{ .Values.global.clusterId }}
- name: TENANT_ID
value: {{ .Values.accuknox.tenantId | quote}}
value: {{ .Values.global.tenantId | quote}}
- name: URL
value: {{ .Values.accuknox.url }}
value: {{ .Values.global.url }}
volumeMounts:
- mountPath: /data
name: datapath
Expand Down Expand Up @@ -112,8 +113,10 @@ spec:
path: /opt/cni/bin/
name: opt-cni-bin

schedule: "{{ .Values.accuknox.cronTab }}"
schedule: "{{ .Values.global.cronTab }}"
successfulJobsHistoryLimit: 1
failedJobsHistoryLimit: 1

status: {}

{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.accuknox.cis.enabled }}
apiVersion: batch/v1
kind: Job
metadata:
Expand All @@ -18,17 +19,17 @@ spec:
resources: {}
env:
- name: AUTH_TOKEN
value: {{ .Values.accuknox.authToken }}
value: {{ .Values.global.authToken }}
- name: CLUSTER_NAME
value: {{ .Values.accuknox.clusterName }}
value: {{ .Values.global.clusterName }}
- name: LABEL_NAME
value: {{ .Values.accuknox.label }}
value: {{ .Values.global.label }}
- name: CLUSTER_ID
value: {{ .Values.accuknox.clusterId }}
value: {{ .Values.global.clusterId }}
- name: TENANT_ID
value: {{ .Values.accuknox.tenantId | quote}}
value: {{ .Values.global.tenantId | quote}}
- name: URL
value: {{ .Values.accuknox.url }}
value: {{ .Values.global.url }}
volumeMounts:
- mountPath: /data
name: datapath
Expand Down Expand Up @@ -110,4 +111,5 @@ spec:
name: etc-cni-netd
- hostPath:
path: /opt/cni/bin/
name: opt-cni-bin
name: opt-cni-bin
{{- end }}
7 changes: 7 additions & 0 deletions k8s-jobs/charts/cis-k8s-job/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Default values for cis-k8s-job.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

accuknox:
cis:
enabled: "false"
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.accuknox.riskassessment.enabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand Down Expand Up @@ -170,3 +171,5 @@ rules:
- namespaces
verbs:
- update

{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.accuknox.riskassessment.enabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
Expand All @@ -10,3 +11,4 @@ roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: k8s-risk-assessment-job-clusterrole
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.accuknox.riskassessment.enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
Expand Down Expand Up @@ -38,3 +39,5 @@ data:
--header "Tenant-Id: ${TENANT_ID}" \
--form "file=@\"/data/report.json\"" \
"https://${URL}/api/v1/artifact/?tenant_id=${TENANT_ID}&data_type=KS&save_to_s3=false&label_id=${LABEL_NAME}"

{{- end }}
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{{- if .Values.accuknox.riskassessment.enabled }}
apiVersion: batch/v1
kind: CronJob
metadata:
name: k8s-risk-assessment-job
namespace: {{ .Release.Namespace }}
spec:
schedule: "{{ .Values.accuknox.cronTab }}"
schedule: "{{ .Values.global.cronTab }}"
successfulJobsHistoryLimit: 1
failedJobsHistoryLimit: 1

Expand All @@ -21,7 +22,7 @@ spec:
args: ["scan", "framework", "allcontrols,clusterscan,mitre,nsa", "--format", "json", "--cache-dir", "/data/kubescape-cache", "--output", "/data/report.json", "--cluster-name=$(CLUSTER_NAME)"]
env:
- name: CLUSTER_NAME
value: {{ .Values.accuknox.clusterName }}
value: {{ .Values.global.clusterName }}
volumeMounts:
- name: datapath
mountPath: /data
Expand All @@ -42,15 +43,15 @@ spec:
name: {{ .Values.accuknox.secretName }}
{{- end }}
- name: URL
value: {{ .Values.accuknox.URL }}
value: {{ .Values.global.url }}
- name: TENANT_ID
value: {{ .Values.accuknox.tenantID | quote }}
value: {{ .Values.global.tenantId | quote }}
- name: CLUSTER_NAME
value: {{ .Values.accuknox.clusterName }}
value: {{ .Values.global.clusterName }}
- name: CLUSTER_ID
value: {{ .Values.accuknox.clusterID | quote }}
value: {{ .Values.global.clusterId | quote }}
- name: LABEL_NAME
value: {{ .Values.accuknox.label }}
value: {{ .Values.global.label }}
volumeMounts:
- mountPath: /data
name: datapath
Expand All @@ -64,3 +65,5 @@ spec:
name: k8s-risk-assessment-job-script-configmap
restartPolicy: OnFailure
serviceAccount: k8s-risk-assessment-job-service-account

{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.accuknox.riskassessment.enabled }}
apiVersion: batch/v1
kind: Job
metadata:
Expand All @@ -15,7 +16,7 @@ spec:
args: ["scan", "framework", "allcontrols,clusterscan,mitre,nsa", "--format", "json", "--cache-dir", "/data/kubescape-cache", "--output", "/data/report.json", "--cluster-name=$(CLUSTER_NAME)"]
env:
- name: CLUSTER_NAME
value: {{ .Values.accuknox.clusterName }}
value: {{ .Values.global.clusterName }}
volumeMounts:
- name: datapath
mountPath: /data
Expand All @@ -36,15 +37,15 @@ spec:
name: {{ .Values.accuknox.secretName }}
{{- end }}
- name: URL
value: {{ .Values.accuknox.URL }}
value: {{ .Values.global.url }}
- name: TENANT_ID
value: {{ .Values.accuknox.tenantID | quote }}
value: {{ .Values.global.tenantId | quote }}
- name: CLUSTER_NAME
value: {{ .Values.accuknox.clusterName }}
value: {{ .Values.global.clusterName }}
- name: CLUSTER_ID
value: {{ .Values.accuknox.clusterID | quote }}
value: {{ .Values.global.clusterID | quote }}
- name: LABEL_NAME
value: {{ .Values.accuknox.label }}
value: {{ .Values.global.label }}
volumeMounts:
- mountPath: /data
name: datapath
Expand All @@ -58,3 +59,4 @@ spec:
name: k8s-risk-assessment-job-script-configmap
restartPolicy: OnFailure
serviceAccount: k8s-risk-assessment-job-service-account
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ metadata:
name: k8s-risk-assessment-job-auth-token
namespace: {{ .Release.Namespace }}
data:
AUTH_TOKEN: {{ .Values.accuknox.authToken | b64enc }}
AUTH_TOKEN: {{ .Values.global.authToken | b64enc }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{{- if .Values.accuknox.riskassessment.enabled }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: k8s-risk-assessment-job-service-account
namespace: {{ .Release.Namespace }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ kubescape:
replicaCount: 1

accuknox:
authToken: "NO-TOKEN-SET"
URL: "cspm.demo.accuknox.com"
tenantID: ""
cronTab: "30 9 * * *"
clusterName: ""
clusterID: 0
label: ""
riskassessment:
enabled: "false"
secretName: ""
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.accuknox.k8tls.enabled }}
apiVersion: v1
kind: ServiceAccount
metadata:
Expand Down Expand Up @@ -47,15 +48,15 @@ spec:
resources: {}
env:
- name: URL
value: {{ .Values.accuknox.URL }}
value: {{ .Values.global.url }}
- name: TENANT_ID
value: {{ .Values.accuknox.tenantID | quote }}
value: {{ .Values.global.tenantId | quote }}
- name: AUTH_TOKEN
value: {{ .Values.accuknox.authToken }}
value: {{ .Values.global.authToken }}
- name: CLUSTER_NAME
value: {{ if ne .Values.accuknox.clusterName "" }}{{ .Values.accuknox.clusterName }}{{ else }}{{ "default" }}{{ end }}
value: {{ if ne .Values.global.clusterName "" }}{{ .Values.global.clusterName }}{{ else }}{{ "default" }}{{ end }}
- name: LABEL_NAME
value: {{ if ne .Values.accuknox.label "" }}{{ .Values.accuknox.label }}{{ else }}{{ "default" }}{{ end }}
value: {{ if ne .Values.global.label "" }}{{ .Values.global.label }}{{ else }}{{ "default" }}{{ end }}
volumeMounts:
- mountPath: /data
name: datapath
Expand All @@ -75,6 +76,8 @@ spec:
- name: datapath
emptyDir: {}

schedule: "{{ .Values.accuknox.cronTab }}"
schedule: "{{ .Values.global.cronTab }}"
successfulJobsHistoryLimit: 1
failedJobsHistoryLimit: 1

{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.accuknox.k8tls.enabled }}
apiVersion: batch/v1
kind: Job
metadata:
Expand All @@ -17,15 +18,15 @@ spec:
resources: {}
env:
- name: URL
value: {{ .Values.accuknox.URL }}
value: {{ .Values.global.url }}
- name: TENANT_ID
value: {{ .Values.accuknox.tenantID | quote }}
value: {{ .Values.global.tenantId | quote }}
- name: AUTH_TOKEN
value: {{ .Values.accuknox.authToken }}
value: {{ .Values.global.authToken }}
- name: CLUSTER_NAME
value: {{ if ne .Values.accuknox.clusterName "" }}{{ .Values.accuknox.clusterName }}{{ else }}{{ "default" }}{{ end }}
value: {{ if ne .Values.global.clusterName "" }}{{ .Values.global.clusterName }}{{ else }}{{ "default" }}{{ end }}
- name: LABEL_NAME
value: {{ if ne .Values.accuknox.label "" }}{{ .Values.accuknox.label }}{{ else }}{{ "default" }}{{ end }}
value: {{ if ne .Values.global.label "" }}{{ .Values.global.label }}{{ else }}{{ "default" }}{{ end }}
volumeMounts:
- mountPath: /data
name: datapath
Expand All @@ -45,3 +46,4 @@ spec:
- name: datapath
emptyDir: {}

{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,5 @@
# Declare variables to be passed into your templates.

accuknox:
authToken: "NO-TOKEN-SET"
cronTab: "30 9 * * *"
tenantID: ""
clusterName: ""
label: ""
URL: "cspm.demo.accuknox.com"
k8tls:
enabled: "false"
File renamed without changes.
File renamed without changes.
Loading
Loading