Skip to content

Commit

Permalink
Merge pull request #9 from DelusionalOptimist/adding-control-list
Browse files Browse the repository at this point in the history
chore: add control info; fix: generation time
  • Loading branch information
DelusionalOptimist authored Apr 24, 2024
2 parents 46dd899 + a116065 commit 35c6335
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
19 changes: 16 additions & 3 deletions accuknox-kubescape-job/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,27 @@ data:
augment-and-push-results.sh: |
#! /bin/env bash
# get all controls
jq -s 'map(.controls[]) | unique_by(.controlID) | .[]' /data/kubescape-cache/allcontrols.json \
/data/kubescape-cache/clusterscan.json \
/data/kubescape-cache/mitre.json /data/kubescape-cache/nsa.json > /data/controllist.json
export GENERATION_TIME=`date --utc --iso-8601=s`
# augment result
cat <<< $(jq ". +=
{
"generationTime": "'$ENV.GENERATION_TIME'",
"summary": {
"controls": "'$controllist'"
},
"accuknox_metadata": {
"cluster_name":"'$ENV.CLUSTER_NAME'",
"label_name":"'$ENV.LABEL_NAME'"
"cluster_name": "'$ENV.CLUSTER_NAME'",
"label_name": "'$ENV.LABEL_NAME'"
}
}" /data/report.json) > /data/report.json
}" /data/report.json --slurpfile controllist /data/controllist.json) > /data/report.json
# push
curl --location --request POST \
--header "Authorization: Bearer ${AUTH_TOKEN}" \
--header "Tenant-Id: ${TENANT_ID}" \
Expand Down
2 changes: 1 addition & 1 deletion accuknox-kubescape-job/templates/cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spec:
initContainers:
- name: kubescape-init
image: "{{ .Values.kubescape.image.repository }}:{{ if ne .Values.kubescape.image.tag "" }}{{ .Values.kubescape.image.tag }}{{ else }}v{{ .Chart.AppVersion }}{{ end }}"
args: ["scan", "--format", "json", "--output", "/data/report.json", "--cluster-name=$(CLUSTER_NAME)"]
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: {{ if ne .Values.accuknox.clusterName "" }}{{ .Values.accuknox.clusterName }}{{ else }}{{ "default" }}{{ end }}
Expand Down

0 comments on commit 35c6335

Please sign in to comment.