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
63 changes: 63 additions & 0 deletions .github/workflows/trivy-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: 'Trivy Security Scans'

on:
schedule:
# Run every day at 12 AM IST (which is 6:30 PM UTC)
- cron: "46 7 * * *"

jobs:
trivy_fs_scan:
name: Trivy Filesystem Scan
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Run Trivy filesystem scan
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
scan-ref: '.'
ignore-unfixed: true
severity: 'HIGH,CRITICAL'
format: 'sarif'
output: 'trivy-fs-results.sarif'

- name: Upload Trivy filesystem results to GitHub Security tab
if: always()
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: 'trivy-fs-results.sarif'

trivy_image_scan:
Comment on lines +10 to +33
name: Trivy Docker Image Scan
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Build and load Docker image
uses: docker/build-push-action@v6
with:
context: ./logs-function
file: ./logs-function/Dockerfile
load: true
tags: oci-log-integration-scan:latest

- name: Run Trivy image scan
uses: aquasecurity/trivy-action@master
with:
scan-type: 'image'
image-ref: 'oci-log-integration-scan:latest'
ignore-unfixed: true
severity: 'HIGH,CRITICAL'
format: 'sarif'
output: 'trivy-image-results.sarif'

- name: Upload Trivy image results to GitHub Security tab
if: always()
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: 'trivy-image-results.sarif'
Comment on lines +34 to +63
Loading