| file | +{{file}} | +
|---|---|
| lines | +{{lines}} | +
| severity | +{{severity}} | +
| guideline | ++ {{guideline}} + | +
| description | +{{description}} | +
| proposed solution | +{{resolution}} | +
| references | ++ {{#each references}} + {{this}}{{#unless @last}}, {{/unless}} + {{/each}} + | +
| image | +{{image}} | +
|---|---|
| installed version | +{{installedVersion}} | +
| fixed version | +{{fixedVersion}} | +
| status | +{{status}} | +
| severity | +{{severity}} | +
| description | +{{description}} | +
| source | ++ {{source.URL}} + | +
| references | ++ {{#each references}} + {{this}}{{#unless @last}}, {{/unless}} + {{/each}} + | +
| file | +{{file}} | +
|---|---|
| lines | +{{lines}} | +
| package | +{{package}}@{{installedVersion}} | +
| fixed in | +{{fixedVersion}} | +
| details | ++ {{guideline}} + | +
| description | +{{description}} | +
| proposed solution | +{{resolution}} | +
| references | ++ {{#each references}} + {{this}}{{#unless @last}}, {{/unless}} + {{/each}} + | +
| file | diff --git a/security-scanning/filesystem_scan_template.hbs b/security-scanning/filesystem_scan_template.hbs index de837a1..718ea51 100644 --- a/security-scanning/filesystem_scan_template.hbs +++ b/security-scanning/filesystem_scan_template.hbs @@ -25,7 +25,13 @@ {{#if package}}|||||||||
|---|---|---|---|---|---|---|---|---|---|
| package | -{{package}}@{{installedVersion}} | +{{package}} | +|||||||
| installed version | +{{installedVersion}} |
| image | {{image}} | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| package | +{{package}} | +||||||||
| installed version | @@ -26,7 +32,7 @@ {{/if}} {{#if fixedVersion}}|||||||||
| fixed version | +fixed in | {{fixedVersion}} |
| file | From 57a88a68bb33ca94f5851daf632654f8bcc42974 Mon Sep 17 00:00:00 2001 From: JonasPollokZweitag <„jonas.pollok@zweitag.de“> Date: Tue, 20 Jan 2026 09:46:32 +0100 Subject: [PATCH 40/53] chore: removed references from image scan summary --- security-scanning/image_scan_template.hbs | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/security-scanning/image_scan_template.hbs b/security-scanning/image_scan_template.hbs index 866789c..da8fbe4 100644 --- a/security-scanning/image_scan_template.hbs +++ b/security-scanning/image_scan_template.hbs @@ -62,16 +62,6 @@|
|---|---|
| references | -- {{#each references}} - {{this}}{{#unless @last}}, {{/unless}} - {{/each}} - | -
| LOW | +MEDIUM | +HIGH | +CRITICAL | +UNKNOWN | +
|---|---|---|---|---|
| {{ctrf.extensions.severityCounts.LOW}} | +{{ctrf.extensions.severityCounts.MEDIUM}} | +{{ctrf.extensions.severityCounts.HIGH}} | +{{ctrf.extensions.severityCounts.CRITICAL}} | +{{ctrf.extensions.severityCounts.UNKNOWN}} | +
| Tests 📝 | +Passed ✅ | +Failed ❌ | + {{#if ctrf.extensions.severityCounts.LOW != 0}} +LOW 🟢 | + {{/if}} + {{#if ctrf.extensions.severityCounts.MEDIUM != 0}} +MEDIUM 🟡 | + {{/if}} + {{#if ctrf.extensions.severityCounts.HIGH != 0}} +HIGH 🔴 | + {{/if}} + {{#if ctrf.extensions.severityCounts.CRITICAL != 0}} +CRITICAL 🚨 | + {{/if}} + {{#if ctrf.extensions.severityCounts.UNKNOWN != 0}} +UNKNOWN ❓ | + {{/if}} +|
|---|---|---|---|---|---|---|---|---|
| {{ctrf.summary.tests}} | +{{ctrf.summary.passed}} | +{{ctrf.summary.failed}} | + {{#if ctrf.extensions.severityCounts.LOW != 0}} +{{ctrf.extensions.severityCounts.LOW}} | + {{/if}} + {{#if ctrf.extensions.severityCounts.MEDIUM != 0}} +{{ctrf.extensions.severityCounts.MEDIUM}} | + {{/if}} + {{#if ctrf.extensions.severityCounts.HIGH != 0}} +{{ctrf.extensions.severityCounts.HIGH}} | + {{/if}} + {{#if ctrf.extensions.severityCounts.CRITICAL != 0}} +{{ctrf.extensions.severityCounts.CRITICAL}} | + {{/if}} + {{#if ctrf.extensions.severityCounts.UNKNOWN != 0}} +{{ctrf.extensions.severityCounts.UNKNOWN}} | + {{/if}} + {{#if ctrf.extensions.secretsCount != 0}} +{{ctrf.extensions.secretsCount}} | + {{/if}} +
| Found Vulnerabilities ❌ | + {{#if ctrf.extensions.severityCounts.LOW != 0}} +LOW 🟢 | + {{/if}} + {{#if ctrf.extensions.severityCounts.MEDIUM != 0}} +MEDIUM 🟡 | + {{/if}} + {{#if ctrf.extensions.severityCounts.HIGH != 0}} +HIGH 🔴 | + {{/if}} + {{#if ctrf.extensions.severityCounts.CRITICAL != 0}} +CRITICAL 🚨 | + {{/if}} + {{#if ctrf.extensions.severityCounts.UNKNOWN != 0}} +UNKNOWN ❓ | + {{/if}} + {{#if ctrf.extensions.secretsCount != 0}} +SECRETS 🔑 | + {{/if}} +
|---|---|---|---|---|---|---|
| {{ctrf.summary.failed}} | + {{#if ctrf.extensions.severityCounts.LOW != 0}} +{{ctrf.extensions.severityCounts.LOW}} | + {{/if}} + {{#if ctrf.extensions.severityCounts.MEDIUM != 0}} +{{ctrf.extensions.severityCounts.MEDIUM}} | + {{/if}} + {{#if ctrf.extensions.severityCounts.HIGH != 0}} +{{ctrf.extensions.severityCounts.HIGH}} | + {{/if}} + {{#if ctrf.extensions.severityCounts.CRITICAL != 0}} +{{ctrf.extensions.severityCounts.CRITICAL}} | + {{/if}} + {{#if ctrf.extensions.severityCounts.UNKNOWN != 0}} +{{ctrf.extensions.severityCounts.UNKNOWN}} | + {{/if}} + {{#if ctrf.extensions.secretsCount != 0}} +{{ctrf.extensions.secretsCount}} | + {{/if}} +
| LOW | -MEDIUM | -HIGH | -CRITICAL | -UNKNOWN | + {{#if ctrf.extensions.severityCounts.LOW != 0}} +LOW 🟢 | + {{/if}} + {{#if ctrf.extensions.severityCounts.MEDIUM != 0}} +MEDIUM 🟡 | + {{/if}} + {{#if ctrf.extensions.severityCounts.HIGH != 0}} +HIGH 🔴 | + {{/if}} + {{#if ctrf.extensions.severityCounts.CRITICAL != 0}} +CRITICAL 🚨 | + {{/if}} + {{#if ctrf.extensions.severityCounts.UNKNOWN != 0}} +UNKNOWN ❓ | + {{/if}}
|---|---|---|---|---|---|---|---|---|---|
| {{ctrf.extensions.severityCounts.LOW}} | + {{/if}} + {{#if ctrf.extensions.severityCounts.MEDIUM != 0}}{{ctrf.extensions.severityCounts.MEDIUM}} | + {{/if}} + {{#if ctrf.extensions.severityCounts.HIGH != 0}}{{ctrf.extensions.severityCounts.HIGH}} | + {{/if}} + {{#if ctrf.extensions.severityCounts.CRITICAL != 0}}{{ctrf.extensions.severityCounts.CRITICAL}} | + {{/if}} + {{#if ctrf.extensions.severityCounts.UNKNOWN != 0}}{{ctrf.extensions.severityCounts.UNKNOWN}} | + {{/if}}
| LOW 🟢 | {{/if}} - {{#if ctrf.extensions.severityCounts.MEDIUM != 0}} + {{#if ctrf.extensions.severityCounts.MEDIUM}}MEDIUM 🟡 | {{/if}} - {{#if ctrf.extensions.severityCounts.HIGH != 0}} + {{#if ctrf.extensions.severityCounts.HIGH}}HIGH 🔴 | {{/if}} - {{#if ctrf.extensions.severityCounts.CRITICAL != 0}} + {{#if ctrf.extensions.severityCounts.CRITICAL}}CRITICAL 🚨 | {{/if}} - {{#if ctrf.extensions.severityCounts.UNKNOWN != 0}} + {{#if ctrf.extensions.severityCounts.UNKNOWN}}UNKNOWN ❓ | {{/if}}
|---|---|---|---|---|
| {{ctrf.extensions.severityCounts.LOW}} | {{/if}} - {{#if ctrf.extensions.severityCounts.MEDIUM != 0}} + {{#if ctrf.extensions.severityCounts.MEDIUM}}{{ctrf.extensions.severityCounts.MEDIUM}} | {{/if}} - {{#if ctrf.extensions.severityCounts.HIGH != 0}} + {{#if ctrf.extensions.severityCounts.HIGH}}{{ctrf.extensions.severityCounts.HIGH}} | {{/if}} - {{#if ctrf.extensions.severityCounts.CRITICAL != 0}} + {{#if ctrf.extensions.severityCounts.CRITICAL}}{{ctrf.extensions.severityCounts.CRITICAL}} | {{/if}} - {{#if ctrf.extensions.severityCounts.UNKNOWN != 0}} + {{#if ctrf.extensions.severityCounts.UNKNOWN}}{{ctrf.extensions.severityCounts.UNKNOWN}} | {{/if}}
| Found Vulnerabilities ❌ | {{#if ctrf.extensions.severityCounts.LOW}}LOW 🟢 | {{/if}} @@ -26,7 +25,6 @@
|---|---|
| {{ctrf.summary.failed}} | {{#if ctrf.extensions.severityCounts.LOW}}{{ctrf.extensions.severityCounts.LOW}} | {{/if}} From 05810a7fd878deb0d1a0de7d7353932523d48ff9 Mon Sep 17 00:00:00 2001 From: JonasPollokZweitag <„jonas.pollok@zweitag.de“> Date: Tue, 20 Jan 2026 15:11:15 +0100 Subject: [PATCH 52/53] chore: create checkov baseline for tests --- .checkov.baseline | 59 +++++++++++++++++++++++ .github/workflows/test-security-scan.yaml | 1 + security-scanning/tests/Dockerfile | 2 +- 3 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 .checkov.baseline diff --git a/.checkov.baseline b/.checkov.baseline new file mode 100644 index 0000000..a535f4d --- /dev/null +++ b/.checkov.baseline @@ -0,0 +1,59 @@ +{ + "failed_checks": [ + { + "file": "/.github/workflows/checkov-scan.yaml", + "findings": [ + { + "resource": "on(Security Scan)", + "check_ids": [ + "CKV2_GHA_1" + ] + } + ] + }, + { + "file": "/.github/workflows/deployment-status.yaml", + "findings": [ + { + "resource": "on(deployment-status)", + "check_ids": [ + "CKV2_GHA_1" + ] + } + ] + }, + { + "file": "/.github/workflows/global-variables.yaml", + "findings": [ + { + "resource": "on(global-variables)", + "check_ids": [ + "CKV2_GHA_1" + ] + } + ] + }, + { + "file": "/.github/workflows/test-security-scan.yaml", + "findings": [ + { + "resource": "on(Test Security Scan Workflows)", + "check_ids": [ + "CKV2_GHA_1" + ] + } + ] + }, + { + "file": "/.github/workflows/trivy-scan.yaml", + "findings": [ + { + "resource": "on(Security Scan)", + "check_ids": [ + "CKV2_GHA_1" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/.github/workflows/test-security-scan.yaml b/.github/workflows/test-security-scan.yaml index 628d9da..d55c1c4 100644 --- a/.github/workflows/test-security-scan.yaml +++ b/.github/workflows/test-security-scan.yaml @@ -63,4 +63,5 @@ jobs: with: soft-fail-on: CRITICAL use-test-reporter: true + baseline: '.checkov.baseline' issue-on-findings: '' diff --git a/security-scanning/tests/Dockerfile b/security-scanning/tests/Dockerfile index 583b299..7f69534 100644 --- a/security-scanning/tests/Dockerfile +++ b/security-scanning/tests/Dockerfile @@ -1,7 +1,7 @@ # security-scanning/tests/Dockerfile # Minimal test image for security scan workflow testing -FROM scratch +FROM alpine:3.23 USER testuser From 86c7158fbc55717db1a2f8deb4fab0276312fb26 Mon Sep 17 00:00:00 2001 From: JonasPollokZweitag <„jonas.pollok@zweitag.de“> Date: Tue, 20 Jan 2026 15:24:40 +0100 Subject: [PATCH 53/53] chore: add check in checkov converter to avoid error --- security-scanning/checkov2ctrf.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/security-scanning/checkov2ctrf.py b/security-scanning/checkov2ctrf.py index b741019..74c46e5 100644 --- a/security-scanning/checkov2ctrf.py +++ b/security-scanning/checkov2ctrf.py @@ -1,7 +1,6 @@ import json import sys - def extract_checks(target, status): # extracts checks of a check_type (e.g. terraform) with a status ('fail' oder 'pass'). checks = [] @@ -17,12 +16,18 @@ def extract_checks(target, status): }) return checks - def checkov_to_ctrf(checkov_json): tests = [] - for target in checkov_json: - tests.extend(extract_checks(target, "fail")) - tests.extend(extract_checks(target, "pass")) + + if isinstance(checkov_json, list): + for target in checkov_json: + tests.extend(extract_checks(target, "fail")) + tests.extend(extract_checks(target, "pass")) + elif isinstance(checkov_json, dict): + tests.extend(extract_checks(checkov_json, "fail")) + tests.extend(extract_checks(checkov_json, "pass")) + else: + raise ValueError("Unerwartetes JSON-Format!") total = len(tests) passed = sum(1 for t in tests if t["status"] == "passed") @@ -56,7 +61,6 @@ def checkov_to_ctrf(checkov_json): } } - if __name__ == "__main__": if len(sys.argv) != 3: print("Usage: python checkov2ctrf.py