Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
b6cf6c7
chore: add setup-python action
Dec 17, 2025
2f7eba8
chore: add setup-trivy action
Dec 17, 2025
691003c
chore: add test reporter templates
Dec 17, 2025
1d7267e
chore: add scan report -> ctrf converter
Dec 17, 2025
e41d141
chore: add first version of configurable security scan action
Dec 18, 2025
2a6187f
fix: : with space
Dec 18, 2025
ee9857b
fix: removed double steps call
Dec 18, 2025
8252341
chore: added real name
Dec 18, 2025
704a27b
Merge branch 'main' into chore--create-configurable-Security-Scan
kevinkupski Jan 2, 2026
d3b557b
chore: split in two different workflows
Jan 14, 2026
4f5b774
chore: removed python setup action
Jan 14, 2026
88e4e26
chore: use format instead of +
Jan 14, 2026
73bf961
chore: removed dependency to removed step
Jan 14, 2026
73e6ab9
fix: set missing required parameter
Jan 14, 2026
af16ef4
chore: renamed GITHUB_TOKEN secret
Jan 14, 2026
a53cd54
chore: use native bash for retry
Jan 14, 2026
9ed9eab
chore: checkout scripts in checkov workflow
Jan 14, 2026
60a208d
fix: wrong indentation
Jan 14, 2026
6cede3f
fix: wrong indentation
Jan 14, 2026
c97c47c
fix: remove quotes from boolean
Jan 14, 2026
8ff1cac
test: added branch reference to scanning checkout
Jan 14, 2026
a23df45
chore: checkout security scripts from repo
Jan 14, 2026
57c4eaf
fix: removed quotes from boolean
Jan 14, 2026
0c7a2e1
fix: -o instead of >
Jan 14, 2026
0977cd2
fix: enable continue on error
Jan 15, 2026
f7b8cd4
chore: renamed trivyconfig2ctrf convert script
Jan 15, 2026
7b87f9b
chore: reduced scans to one job
Jan 15, 2026
c0643f6
fix: single quotes instead of double
Jan 15, 2026
c0fc269
fix: indetation
Jan 15, 2026
c5eea69
chore: only allow one ticket assignee
Jan 20, 2026
46796ab
chore: add converter and template for filesystem
Jan 20, 2026
aa922d6
chore: removed @ in assignees array
Jan 20, 2026
d855220
chore: use configureable severity level
Jan 20, 2026
b874941
chore: changed secret check to bool
Jan 20, 2026
495f1b0
chore: severities need all levels that are to displayed
Jan 20, 2026
98bfa36
fix: set assignee right
Jan 20, 2026
218eae7
chore: removed ticket assignment
Jan 20, 2026
38013c9
test: count severities seperate in image scan
Jan 20, 2026
3686b2b
chore: little format changes
Jan 20, 2026
ab313b2
chore: extende title in config scan
Jan 20, 2026
57a88a6
chore: removed references from image scan summary
Jan 20, 2026
ffdfc7b
chore: removed trivy setup action
Jan 20, 2026
cb2c656
chore: redesigned summary tables
Jan 20, 2026
143a0b4
fix: use valid ifs
Jan 20, 2026
169a6c6
chore: renamed trivyignorefile -> ignorefile
Jan 20, 2026
d99f648
chore: add Readme for security scans
Jan 20, 2026
ef78535
chore: small changes in templates
Jan 20, 2026
72c1b07
chore: add test workflow for security scan
Jan 20, 2026
d11fb9b
chore: add Healthcheck to test image
Jan 20, 2026
3e82945
chore: CRITICAL instead of any
Jan 20, 2026
a5e6e2a
chore: use Test Image that ist empty
Jan 20, 2026
312c69f
chore: removed sum of fs scan report
Jan 20, 2026
05810a7
chore: create checkov baseline for tests
Jan 20, 2026
86c7158
chore: add check in checkov converter to avoid error
Jan 20, 2026
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
59 changes: 59 additions & 0 deletions .checkov.baseline
Original file line number Diff line number Diff line change
@@ -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"
]
}
]
}
]
}
125 changes: 125 additions & 0 deletions .github/workflows/checkov-scan.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# .github/workflows/security-scan.yaml
name: Security Scan

on:
workflow_call:
inputs:
baseline:
description: 'Path to the Checkov baseline file (default: none)'
default: ''
required: false
type: string
path:
description: 'Directory path where the scan should be performed (default: .)'
required: false
default: '.'
type: string
soft-fail-on:
description: 'Lowest severity level to cause a failed scan (default: LOW)'
required: false
default: 'LOW'
type: string
use-test-reporter:
description: 'Attach the test results as a report (default: true)'
required: false
default: true
type: boolean
issue-on-findings:
description: 'One GitHub user to mention when creating an issue for failed scans (e.g., username). If left empty, no issue will be created.'
required: false
default: ''
type: string

jobs:

checkov_scan:
outputs:
NOTIFICATION: ${{ steps.scan.outcome == 'failure' && 'true' || 'false' }}
runs-on: ubuntu-latest

steps:
- name: checkout repository
uses: actions/checkout@v4

- name: checkout security-scanning scripts
uses: actions/checkout@v4
with:
repository: zweitag/github-actions
ref: chore--create-configurable-Security-Scan
path: _security-tools
sparse-checkout: security-scanning

- name: create output folder
run: mkdir -p ./scan-results

- uses: actions/setup-python@v5
with:
python-version: "3.13"

- name: setup Checkov
run: pip install checkov

- name: run Checkov
id: scan
env:
BASELINE: ${{ inputs.baseline != '' && format('--baseline {0}', inputs.baseline) || '' }}
SOFTFAIL: ${{ inputs.soft-fail-on != '' && format('--soft-fail-on {0}', inputs.soft-fail-on) || '' }}
run: |
checkov \
--directory ${{ inputs.path }} \
--output json \
$BASELINE \
$SOFTFAIL > ./scan-results/checkov.json

- name: convert Checkov report to CTRF format
if: always() && inputs.use-test-reporter
run: |
python3 _security-tools/security-scanning/checkov2ctrf.py \
./scan-results/checkov.json \
./scan-results/checkov.ctrf.json

- name: Publish Test Report
if: always() && inputs.use-test-reporter
uses: ctrf-io/github-test-reporter@v1
with:
report-path: './scan-results/checkov.ctrf.json'
template-path: '_security-tools/security-scanning/config_scan_template.hbs'
custom-report: true

create_issue:
needs: [checkov_scan]
runs-on: ubuntu-latest
if: ${{ inputs.issue-on-findings != 'false' }}

steps:
- name: Create issue/Comment on issue
uses: actions/github-script@v7
with:
script: |
const repo = context.repo.repo;
const owner = context.repo.owner;
const issue_title = 'Security scan failed';
const issue_body = '@${{ inputs.issue-on-findings }} One or more security scans failed. Please check the workflow run for more information: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}\nPlease check if the vulnerabilities are fixable. If there is a fix: Create a ticket for the fix or resolve it.\n'
const existing_issue = await github.rest.issues.listForRepo({
owner,
repo,
state: 'open',
labels: 'security-scan-failure'
});
if (existing_issue.data.length === 0) {
await github.rest.issues.create({
owner,
repo,
title: issue_title,
body: issue_body,
labels: ['security-scan-failure']
});
} else {
const issue_number = existing_issue.data[0].number;
await github.rest.issues.createComment({
owner,
repo,
issue_number,
body: issue_body
});
}
67 changes: 67 additions & 0 deletions .github/workflows/test-security-scan.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# .github/workflows/test-security-scan.yaml
name: Test Security Scan Workflows

on:
pull_request:
paths:
- '.github/workflows/trivy-scan.yaml'
- '.github/workflows/checkov-scan.yaml'
- '.github/workflows/test-security-scan.yaml'
- 'security-scanning/**'
push:
branches:
- main
paths:
- '.github/workflows/trivy-scan.yaml'
- '.github/workflows/checkov-scan.yaml'
- '.github/workflows/test-security-scan.yaml'
- 'security-scanning/**'

jobs:
# Trivy Scan Tests

test-trivy-filesystem:
name: Test Trivy Filesystem Scan
uses: ./.github/workflows/trivy-scan.yaml
with:
scan-type: filesystem
severity-level: CRITICAL
use-test-reporter: true
check-secrets: true
issue-on-findings: ''
secrets:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

test-trivy-config:
name: Test Trivy Config Scan
uses: ./.github/workflows/trivy-scan.yaml
with:
scan-type: config
severity-level: CRITICAL
use-test-reporter: true
issue-on-findings: ''

test-trivy-image:
name: Test Trivy Image Scan
uses: ./.github/workflows/trivy-scan.yaml
with:
scan-type: image
path: './security-scanning/tests'
severity-level: CRITICAL
use-test-reporter: true
issue-on-findings: ''
secrets:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# ==========================================
# Checkov Scan Tests
# ==========================================

test-checkov:
name: Test Checkov Scan
uses: ./.github/workflows/checkov-scan.yaml
with:
soft-fail-on: CRITICAL
use-test-reporter: true
baseline: '.checkov.baseline'
issue-on-findings: ''
Loading