12 Commits
1.6.2 ... 1.6.4

Author SHA1 Message Date
95fa832a67 add telegram_bot
All checks were successful
trivy-scan-image / trivy_image_scan (push) Successful in 42s
trivy-scan-image / telegram-notify (push) Successful in 2s
2026-02-22 20:24:53 +01:00
cb460ef18d add telegram_bot 2026-02-22 20:19:16 +01:00
7f54789e0c add telegram_bot 2026-02-22 18:17:46 +01:00
20bda0cbd5 Custom-Name for Job
All checks were successful
trivy-scan-image / trivy_image_scan (push) Successful in 40s
2026-02-15 13:43:09 +01:00
7560904223 Custom-Name for Job 2026-02-15 13:12:21 +01:00
805db14672 Custom-Name for Job 2026-02-15 13:10:35 +01:00
6cb3fc1ebb Custom-Name for Job 2026-02-15 13:07:34 +01:00
62b59d3c52 Custom-Name for Job 2026-02-15 13:05:25 +01:00
e2b2c5e89c trivy_image_scan.yml for all 4 build-plattforms 2026-02-15 12:42:36 +01:00
c6a5c83321 add pull image to trivy_image_scan.yml 2026-02-15 11:31:59 +01:00
246dd03eec add pull image to trivy_image_scan.yml 2026-02-15 11:24:33 +01:00
5053791991 add apt upgrade to Dockerfile
Some checks failed
trivy-scan-image / trivy_image_scan (push) Failing after 30s
2026-02-04 23:20:37 +01:00
2 changed files with 65 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
name: trivy-scan-image name: trivy-scan-image
run-name: Trivy - Scan Docker Image run-name: Trivy - Scan Docker Image ${{ env.image_tag }}
on: on:
workflow_dispatch: # Manuelles Auslösen des Workflows workflow_dispatch: # Manuelles Auslösen des Workflows
@@ -22,13 +22,74 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: aquasec/trivy:latest container: aquasec/trivy:latest
steps: steps:
- name: Scan image with trivy - name: Scan linux/amd64-image
run: | run: |
trivy image \ trivy image \
--username ${{ env.user }} \ --username ${{ env.user }} \
--password ${{ secrets.DOCKER_PULL_TOKEN }} \ --password ${{ secrets.DOCKER_PULL_TOKEN }} \
--exit-code 1 \ --exit-code 1 \
--scanners vuln,misconfig,secret \ --scanners vuln,misconfig,secret \
--severity MEDIUM,HIGH,CRITICAL \ --severity HIGH,CRITICAL \
--ignore-unfixed \ --ignore-unfixed \
--platform linux/amd64 \
${{ env.registry_gitea }}/${{ env.user }}/${{ env.image_name_gitea }}:${{ env.image_tag }} ${{ env.registry_gitea }}/${{ env.user }}/${{ env.image_name_gitea }}:${{ env.image_tag }}
- name: Scan linux/386-image
run: |
trivy image \
--username ${{ env.user }} \
--password ${{ secrets.DOCKER_PULL_TOKEN }} \
--exit-code 1 \
--scanners vuln,misconfig,secret \
--severity HIGH,CRITICAL \
--ignore-unfixed \
--platform linux/386 \
${{ env.registry_gitea }}/${{ env.user }}/${{ env.image_name_gitea }}:${{ env.image_tag }}
- name: Scan linux/arm64-image
run: |
trivy image \
--username ${{ env.user }} \
--password ${{ secrets.DOCKER_PULL_TOKEN }} \
--exit-code 1 \
--scanners vuln,misconfig,secret \
--severity HIGH,CRITICAL \
--ignore-unfixed \
--platform linux/arm64 \
${{ env.registry_gitea }}/${{ env.user }}/${{ env.image_name_gitea }}:${{ env.image_tag }}
- name: Scan linux/arm/v7-image
run: |
trivy image \
--username ${{ env.user }} \
--password ${{ secrets.DOCKER_PULL_TOKEN }} \
--exit-code 1 \
--scanners vuln,misconfig,secret \
--severity HIGH,CRITICAL \
--ignore-unfixed \
--platform linux/arm/v7 \
${{ env.registry_gitea }}/${{ env.user }}/${{ env.image_name_gitea }}:${{ env.image_tag }}
telegram-notify:
needs: trivy_image_scan
if: always()
runs-on: ubuntu-latest
steps:
- name: Telegram Alert
run: |
case "${{ needs.trivy_image_scan.result }}" in
"success") EMOJI="✅"; MSG="OK" ;;
"failure") EMOJI="❌"; MSG="WARN!" ;;
"cancelled") EMOJI="⏹️"; MSG="Canceled" ;;
*) EMOJI="❓"; MSG="Unknown-State: ${{ needs.trivy_image_scan.result }}" ;;
esac
curl -s -X POST "https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendMessage" \
-H 'Content-Type: application/json' \
-d "{
\"chat_id\": \"${{ secrets.TELEGRAM_CHAT_ID }}\",
\"parse_mode\": \"HTML\",
\"text\":
\"$EMOJI <b>$MSG - Scan ${{ env.image_name_gitea }}:${{ env.image_tag }}</b>
<i>$(date +"%Y-%m-%d %T")</i>
Trivy-Image-Scan of: <b><i>${{ env.image_name_gitea }}:${{ env.image_tag }}</i></b>
${{ gitea.server_url }}/${{ gitea.repository }}
\"
}"

View File

@@ -9,6 +9,7 @@ ENV PYTHONUNBUFFERED=1
ENV HTTP_METHOD=POST ENV HTTP_METHOD=POST
RUN apt-get update && \ RUN apt-get update && \
apt-get upgrade -y &&\
if [ "$TARGETPLATFORM" = "linux/arm/v7" ] || [ "$TARGETPLATFORM" = "linux/386" ]; then \ if [ "$TARGETPLATFORM" = "linux/arm/v7" ] || [ "$TARGETPLATFORM" = "linux/386" ]; then \
apt-get install -y --no-install-recommends zlib1g-dev libjpeg-dev gcc; \ apt-get install -y --no-install-recommends zlib1g-dev libjpeg-dev gcc; \
fi && \ fi && \