Skip to content
Open
Changes from all commits
Commits
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
60 changes: 60 additions & 0 deletions .github/workflows/kafka-connect-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ jobs:

kafka-connect-tests:
runs-on: ubuntu-24.04
permissions:
contents: read
security-events: write
strategy:
max-parallel: 15
matrix:
Expand Down Expand Up @@ -103,3 +106,60 @@ jobs:
name: test logs
path: |
**/build/testlogs
# ------------------------------------------------------------------
# Trivy CVE scan
#
# Scans bundled jars for known vulnerabilities.
# Only runs on JVM 21 — dependency CVEs are JVM-independent so
# a single scan avoids redundant work.
#
# Behaviour:
# - If a CVE is found, the step will fail. However, since this job
# is not a required one, it will not block merging.
# - On push to main/release branches: results are uploaded as
# SARIF to the GitHub Security tab for ongoing tracking.
# - On PRs: SARIF upload is skipped because GitHub's Security
# tab only accepts results from default/protected branches.
# CVE findings are visible in the CI log output instead.
# ------------------------------------------------------------------
- name: Build Kafka Connect distribution for scanning
if: matrix.jvm == 21
run: |
./gradlew -DsparkVersions= -DflinkVersions= -DkafkaVersions=3 \
:iceberg-kafka-connect:iceberg-kafka-connect-runtime:distZip \
-Pquick=true -x test -x javadoc
- name: Unpack distribution for scanning
if: matrix.jvm == 21
run: |
mkdir -p /tmp/kafka-connect-scan
unzip kafka-connect/kafka-connect-runtime/build/distributions/iceberg-kafka-connect-runtime-*.zip \
-d /tmp/kafka-connect-scan
# Scan and output results as SARIF (for upload on push) while also
# printing a human-readable summary to the CI log.
- name: Run Trivy vulnerability scan
if: matrix.jvm == 21
uses: lhotari/sandboxed-trivy-action@f01374b6cc3bf7264ab238293e94f6db7ada6dd0 # v1.0.2
with:
scan-type: 'rootfs'
scan-ref: '/tmp/kafka-connect-scan'
scanners: 'vuln'
ignore-unfixed: true
Comment thread
rmoff marked this conversation as resolved.
exit-code: '1'
format: 'sarif'
output: 'trivy-results.sarif'
# Print human-readable results to the CI log so they're visible
# without downloading the SARIF file.
- name: Print Trivy scan results
if: always() && matrix.jvm == 21
run: |
if [ -f trivy-results.sarif ]; then
echo "## Trivy CVE Scan Results"
jq -r '.runs[].results[] | "- \(.ruleId): \(.message.text)"' trivy-results.sarif 2>/dev/null || echo "No findings or unable to parse SARIF."
else
echo "No SARIF file found — scan may have failed to install."
fi
- name: Upload Trivy results to GitHub Security tab
if: always() && matrix.jvm == 21 && github.event_name == 'push'
uses: github/codeql-action/upload-sarif@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
with:
sarif_file: 'trivy-results.sarif'
Loading