Skip to content
Draft
Changes from 3 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
56 changes: 31 additions & 25 deletions .github/workflows/ddn-workspace-testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
branches: [main]
paths:
- registry/**
- .github/workflows/ddn-workspace-testing.yaml
workflow_dispatch:
inputs:
connectors:
Expand Down Expand Up @@ -342,7 +343,26 @@ jobs:

echo "✅ Basic functionality tests passed"

- name: Run Trivy vulnerability scanner (json output)
uses: aquasecurity/trivy-action@0.32.0
with:
image-ref: "ddn-workspace:test"
format: json
output: trivy-results.json
scanners: vuln

- name: Upload Trivy scan results to PromptQL Security Agent
uses: hasura/security-agent-tools/upload-file@v1
with:
file_path: trivy-results.json
security_agent_api_key: ${{ secrets.SECURITY_AGENT_API_KEY }}
tags: |
service=ddn-native-workspace
source_code_path=ddn-workspace
docker_file_path=ddn-workspace/Dockerfile
scanner=trivy
image_name=ddn-workspace:test
product_domain=hasura-ddn-workspace

- name: Save DDN Workspace image
run: |
Expand All @@ -356,6 +376,17 @@ jobs:
path: ddn-workspace.tar.gz
retention-days: 1

- name: Fail build on High/Critical Vulnerabilities
uses: aquasecurity/trivy-action@0.32.0
with:
skip-setup-trivy: true # setup was already done by the previous call to this action above
image-ref: "ddn-workspace:test"
format: table
severity: "CRITICAL,HIGH"
scanners: vuln
ignore-unfixed: true
exit-code: 1

test-connectors:
needs: [setup-connector-tests, build-ddn-workspace]
runs-on: ubuntu-latest
Expand Down Expand Up @@ -462,28 +493,3 @@ jobs:
fi

echo "🎉 All DDN workspace tests completed successfully!"

- name: Run Trivy vulnerability scan
uses: aquasecurity/trivy-action@master
with:
image-ref: "ddn-workspace:test"
format: "sarif"
output: "trivy-results.sarif"

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

- name: Print Trivy vulnerability scan results
uses: aquasecurity/trivy-action@master
with:
image-ref: "ddn-workspace:test"
format: "table"
exit-code: 0
ignore-unfixed: true
vuln-type: "os,library"
severity: "CRITICAL,HIGH"


Comment on lines 465 to 489
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codingkarthik I have two questions for you:

  • Running the scan in the build-ddn-workspace leads to a "no space left on disk" error like this. Was it the reason we chose to run the trivy scan as part of test-connectors job?
  • Right now test-connectors job is failing like this - it might be valid test failure or a flake (I will let you determine). But do you think it is okay to run this CI job on all PRs and in the main branch to keep the tests passing always?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Running the scan in the build-ddn-workspace leads to a "no space left on disk" error like this. Was it the reason we chose to run the trivy scan as part of test-connectors job?

No, I just wanted the testing bit to be separate from the building ddn workspace bit. I have never seen the no space left on disk error.

Right now test-connectors job is failing like this - it might be valid test failure or a flake (I will let you determine). But do you think it is okay to run this CI job on all PRs and in the main branch to keep the tests passing always?

I think this is a bug in the DDN workspace testing framework, the test is now picking up the wrong version of the connector. I will fix this in this PR itself.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a patch to revert to run the scan after the tests. I think tests are still failing - could you check once?

Loading