Skip to content

Commit

Permalink
Merge pull request #41 from Priyaccuknox/consol-charts
Browse files Browse the repository at this point in the history
charts updated
  • Loading branch information
Priyaccuknox authored Sep 23, 2024
2 parents b5eb695 + 28c882f commit d94f0da
Show file tree
Hide file tree
Showing 41 changed files with 200 additions and 484 deletions.
File renamed without changes.
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 }}
7 changes: 7 additions & 0 deletions accuknox-k8s-job/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"
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{{- if .Values.accuknox.riskassessment.enabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: k8s-risk-assessment-job-clusterrole
rules:
- apiGroups:
- ""
- extensions
- apps
- batch
- rbac.authorization.k8s.io
- roles.rbac.authorization.k8s.io
- authorization.k8s.io
- certificates.k8s.io
- apiextensions.k8s.io
- admissionregistration.k8s.io
- networking.k8s.io
resources: ["*"]
verbs: ["*"]

{{- 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,5 @@ 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 @@ -32,25 +33,18 @@ spec:
- '/bin/sh'
- '/script/augment-and-push-results.sh'
env:
- name: AUTH_TOKEN
valueFrom:
secretKeyRef:
key: AUTH_TOKEN
{{- if (.Values.accuknox.secretName | empty) }}
name: k8s-risk-assessment-job-auth-token
{{- else }}
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: AUTH_TOKEN
value: {{ .Values.global.authToken }}
- 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 +58,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
@@ -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,5 @@ kubescape:
replicaCount: 1

accuknox:
authToken: "NO-TOKEN-SET"
URL: "cspm.demo.accuknox.com"
tenantID: ""
cronTab: "30 9 * * *"
clusterName: ""
clusterID: 0
label: ""
secretName: ""
riskassessment:
enabled: "false"
File renamed without changes.
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,17 @@ 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: CLUSTER_ID
value: {{ if ne .Values.global.clusterId "" }}{{ .Values.global.clusterId }}{{ 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 +78,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
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.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{{- if .Values.accuknox.kiem.enabled }}
apiVersion: batch/v1
kind: CronJob
metadata:
name: kiem-job
namespace: {{ .Release.Namespace }}
spec:
schedule: "{{ .Values.accuknox.cronTab }}"
schedule: "{{ .Values.global.cronTab }}"
successfulJobsHistoryLimit: 1
failedJobsHistoryLimit: 1
jobTemplate:
Expand All @@ -20,7 +21,7 @@ spec:
args: ["./kiem", "run", "--mode", "k8s", "--output", "/data/report.json"]
env:
- name: CLUSTER_NAME
value: {{ .Values.accuknox.clusterName }}
value: {{ .Values.global.clusterName }}
volumeMounts:
- name: datapath
mountPath: /data
Expand All @@ -31,15 +32,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: {{ .Values.accuknox.clusterName }}
value: {{ .Values.global.clusterName }}
- name: LABEL_NAME
value: {{ .Values.accuknox.label | quote}}
value: {{ .Values.global.label | quote}}
volumeMounts:
- mountPath: /data
name: datapath
Expand All @@ -49,4 +50,4 @@ spec:
restartPolicy: OnFailure
serviceAccount: kiem-service-account


{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.accuknox.kiem.enabled }}
apiVersion: batch/v1
kind: Job
metadata:
Expand All @@ -15,7 +16,7 @@ spec:
args: ["./kiem", "run", "--mode", "k8s", "--output", "/data/report.json"]
env:
- name: CLUSTER_NAME
value: {{ .Values.accuknox.clusterName }}
value: {{ .Values.global.clusterName }}
volumeMounts:
- name: datapath
mountPath: /data
Expand All @@ -26,20 +27,22 @@ 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: {{ .Values.accuknox.clusterName }}
value: {{ .Values.global.clusterName }}
- name: LABEL_NAME
value: {{ .Values.accuknox.label | quote}}
value: {{ .Values.global.label | quote}}
volumeMounts:
- mountPath: /data
name: datapath
volumes:
- name: datapath
emptyDir: {}
restartPolicy: OnFailure
serviceAccount: kiem-service-account
serviceAccount: kiem-service-account

{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.accuknox.kiem.enabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand Down Expand Up @@ -31,3 +32,5 @@ rules:
- get
- list
- watch

{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.accuknox.kiem.enabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
Expand All @@ -9,4 +10,6 @@ subjects:
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: kiem-cluster-role
name: kiem-cluster-role

{{- end }}
8 changes: 8 additions & 0 deletions accuknox-k8s-job/kiem-job/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{{- if .Values.accuknox.kiem.enabled }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: kiem-service-account
namespace: {{ .Release.Namespace }}

{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,5 @@
replicaCount: 1

accuknox:
authToken: "NO-TOKEN-SET"
URL: "cspm.demo.accuknox.com"
tenantID: ""
cronTab: "30 9 * * *"
clusterName: ""
label: ""
kiem:
enabled: "false"
Loading

0 comments on commit d94f0da

Please sign in to comment.