Organize scan reports into date-based subdirectories

Change Prowler (k8s, iac, image) and Kingfisher CronJobs to write
reports under YYYY-MM-DD subdirectories instead of a flat directory.
Prevents clutter as weekly scans accumulate.

Before: /reports/prowler/prowler-output-In-Cluster-20260329030006.html
After:  /reports/prowler/2026-03-29/prowler-output-In-Cluster-20260329030006.html

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Erich Blume 2026-03-30 17:39:17 -07:00
commit f6ed751dc2
4 changed files with 29 additions and 33 deletions

View file

@ -23,7 +23,7 @@ spec:
- | - |
set -e set -e
STAMP=$(date +%Y%m%d-%H%M%S) STAMP=$(date +%Y%m%d-%H%M%S)
OUTDIR=/reports/kingfisher OUTDIR=/reports/kingfisher/$(date +%Y-%m-%d)
mkdir -p "$OUTDIR" mkdir -p "$OUTDIR"
# Exit codes: 0=clean, 200=findings, 205=validated findings. # Exit codes: 0=clean, 200=findings, 205=validated findings.

View file

@ -18,17 +18,16 @@ spec:
containers: containers:
- name: prowler - name: prowler
image: registry.ops.eblu.me/blumeops/prowler:kustomized image: registry.ops.eblu.me/blumeops/prowler:kustomized
command: ["/bin/sh", "-c"]
args: args:
- iac - |
- --scan-repository-url DATEDIR=/reports/prowler-iac/$(date +%Y-%m-%d)
- https://forge.ops.eblu.me/eblume/blumeops.git mkdir -p "$DATEDIR"
- -z prowler iac \
- --output-formats --scan-repository-url https://forge.ops.eblu.me/eblume/blumeops.git \
- html -z \
- csv --output-formats html csv json-ocsf \
- json-ocsf --output-directory "$DATEDIR"
- --output-directory
- /reports/prowler-iac
volumeMounts: volumeMounts:
- name: reports - name: reports
mountPath: /reports mountPath: /reports

View file

@ -48,17 +48,16 @@ spec:
containers: containers:
- name: prowler - name: prowler
image: registry.ops.eblu.me/blumeops/prowler:kustomized image: registry.ops.eblu.me/blumeops/prowler:kustomized
command: ["/bin/sh", "-c"]
args: args:
- image - |
- --image-list DATEDIR=/reports/prowler-images/$(date +%Y-%m-%d)
- /shared/images.txt mkdir -p "$DATEDIR"
- -z prowler image \
- --output-formats --image-list /shared/images.txt \
- html -z \
- csv --output-formats html csv json-ocsf \
- json-ocsf --output-directory "$DATEDIR"
- --output-directory
- /reports/prowler-images
volumeMounts: volumeMounts:
- name: reports - name: reports
mountPath: /reports mountPath: /reports

View file

@ -40,19 +40,17 @@ spec:
containers: containers:
- name: prowler - name: prowler
image: registry.ops.eblu.me/blumeops/prowler:kustomized image: registry.ops.eblu.me/blumeops/prowler:kustomized
command: ["/bin/sh", "-c"]
args: args:
- kubernetes - |
- --compliance DATEDIR=/reports/prowler/$(date +%Y-%m-%d)
- cis_1.11_kubernetes mkdir -p "$DATEDIR"
- --mutelist-file prowler kubernetes \
- /tmp/mutelist/mutelist.yaml --compliance cis_1.11_kubernetes \
- -z --mutelist-file /tmp/mutelist/mutelist.yaml \
- --output-formats -z \
- html --output-formats html csv json-ocsf \
- csv --output-directory "$DATEDIR"
- json-ocsf
- --output-directory
- /reports/prowler
volumeMounts: volumeMounts:
- name: reports - name: reports
mountPath: /reports mountPath: /reports