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

Defect Dojo integration #1200

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
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
43 changes: 31 additions & 12 deletions .github/workflows/trivy-repo-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,37 @@ jobs:
name: "trivy-repo-full-results.json"
path: './trivy-repo-full-results.json'

- name: Import Trivy Findings to DefectDojo
uses: portswigger-cloud/defectdojo-import-scan@v1
with:
defectdojo-url: ${{ secrets.DEFECTOJO_URL }}
defectdojo-username: ${{ secrets.DEFECTOJO_USERNAME }}
defectdojo-password: ${{ secrets.DEFECTOJO_PASSWORD }}
defectdojo-product-type: OPENSRP
defectdojo-product: OpenSRP-Server-Web
defectdojo-environment-type: Test
defectdojo-scan-type: Trivy Scan
defectdojo-engagement-name: Github Actions Initiated Trivy SAST Scan
scan-results-file-name: trivy-repo-full-results.json
# - name: Import Trivy Findings to DefectDojo
# uses: portswigger-cloud/defectdojo-import-scan@v1
# with:
# defectdojo-url: ${{ secrets.DEFECTOJO_URL }}
# defectdojo-username: ${{ secrets.DEFECTOJO_USERNAME }}
# defectdojo-password: ${{ secrets.DEFECTOJO_PASSWORD }}
# defectdojo-product-type: OPENSRP
# defectdojo-product: OpenSRP-Server-Web
# defectdojo-environment-type: Test
# defectdojo-scan-type: Trivy Scan
# defectdojo-engagement-name: Github Actions Initiated Trivy SAST Scan
# scan-results-file-name: trivy-repo-full-results.json

# - name: Export Trivy report to DefectDojo
# uses: defectdojo/defectdojo-action@v1
# with:
# api_url: ${{ secrets.DEFECTDOJO_API_URL }}
# api_key: ${{ secrets.DEFECTDOJO_API_KEY }}
# engagement_id: 45
# test_id: 247
# file: './trivy-repo-full-results.json'

- name: Export report to DefectDojo
run: |
curl -X POST -H "Content-Type: application/json" \
-H "Authorization: Token ${DEFECTDOJO_API_KEY}" \
-d @trivy-repo-full-results.json \
"${DEFECTDOJO_API_URL}/api/v2/engagements/45/tests/247/import-scan/"
env:
DEFECTDOJO_API_URL: ${{ secrets.DEFECTDOJO_API_URL }}
DEFECTDOJO_API_KEY: ${{ secrets.DEFECTDOJO_API_KEY }}

- name: Create summary of trivy issues on Repository Full scan
run: |
Expand Down