Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(impl):[TRI-1569] container scan last image in docker hub #488

Merged
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions .github/workflows/irs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,10 @@ jobs:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
repository: ${{ env.IMAGE_NAMESPACE }}/${{ env.IMAGE_NAME }}

trigger-trivy-image-scan:
if: >-
github.event_name != 'pull_request'
needs:
- build_images
uses: ./.github/workflows/trivy-docker-hub-scan.yml
33 changes: 33 additions & 0 deletions .github/workflows/trivy-docker-hub-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: "Trivy vulnerability scanner for Docker Hub Image"
Fixed Show fixed Hide fixed
Fixed Show fixed Hide fixed

Check notice

Code scanning / KICS

IAM Access Analyzer Not Enabled

'AWS::AccessAnalyzer::Analyzer' is undefined

on:
workflow_dispatch: # Trigger manually
workflow_call: # Trigger by another workflow
schedule:
- cron: "0 0 * * *"

jobs:
image-scan:
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

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

- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: 'tractusx/irs-api:latest'
format: 'sarif'
output: 'trivy-results.sarif'

- run: cat trivy-results.sarif

- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: 'trivy-results.sarif'