Skip to content
Open
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
32 changes: 32 additions & 0 deletions .github/workflows/dependency-track.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
on:
pull_request:

name: Dependency Track

jobs:
trivy:
runs-on: ubuntu-latest

container:
image: aquasec/trivy:0.67.2

steps:
- run: trivy --version
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: trivy fs --format cyclonedx --output /tmp/trivy-cyclonedx.json .
- run: apk --no-cache add curl
- run: |
IS_LATEST=false
if [ "${{ github.head_ref }}" = "${{ github.event.repository.default_branch }}" ]; then
IS_LATEST=true
fi
curl -X "POST" "https://dependency-track-sbom.corp.zoo.dev/api/v1/bom" \
-H 'Content-Type: multipart/form-data' \
-H "X-Api-Key: ${{ secrets.DEPENDENCY_TRACK_AUTOMATION_API_KEY }}" \
-F "autoCreate=true" \
-F "projectName=${{ github.repository }}" \
-F "projectVersion=${{ github.head_ref }}" \
-F "isLatest=$IS_LATEST" \
-F "bom=@/tmp/trivy-cyclonedx.json"

Check failure on line 32 in .github/workflows/dependency-track.yml

View workflow job for this annotation

GitHub Actions / semgrep-oss/scan

run-shell-injection

Using variable interpolation ... with github context data in a run step could allow an attacker to inject their own code into the runner. This would allow them to steal secrets and code. github context data can have arbitrary user input and should be treated as untrusted. Instead use an intermediate environment variable with env to store the data and use the environment variable in the run script. Be sure to use doublequotes the environment variable like this ENVVAR.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea