Who can help me?
With the following composition of gitlab-ci.yml:
DT_SCA:
stage: test
script:
- git clone https://gitlab.com/.../test.git
- cd test/
- curl
-X "PUT" "http://х.х.х.х:8080/api/v1/bom"
-H "X-API-Key:xxxx"
-H "Content-Type:multipart/form-data" /// option 2. -H "Content-Type:application/json'
-d @хххх.xml /// option 2. -d @хххх.json
I get a 500 error (Internal Server Error).
Tried different variations, always different errors.
At the same time, there is no official possibility of integration. Help me please.
Is there a ready solution? Thank you!
As I generate my SBOM with trivy this is how I send its result to Dependency Track:
dt-import-sbom-scan:
extends: .dt-upload
needs: ["trivy-fs-sbom-scan"]
script:
- |
curl -X "POST" "http://<YOUR_URL>/api/v1/bom" \
-H 'Content-Type: application/json' \
-H "X-Api-Key: $DT-API-KEY" \
-F "autoCreate=true" \
-F "projectName=$CI_PROJECT_NAME" \
-F "projectVersion=$CI_COMMIT_BRANCH" \
-F "[email protected]"
rules:
- if: $TRIVY_FS_SBOM == "false"
when: never
For .dt-upload
I used this:
.dt-upload:
stage: .post
image: docker:stable
services:
- name: docker:dind
before_script:
- apk add --update curl
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With