How to Upload Vulnerability Reports to Teamscale
A vulnerability report is a machine-readable document describing the third-party components a build depends on, together with metadata such as their versions, licenses and known vulnerabilities. Teamscale currently accepts vulnerability reports in the form of Software Bills of Materials (SBOMs). Teamscale can import the reports your builds produce and display their components and vulnerabilities in the Software Composition perspective.
Uploading vulnerability reports complements the JFrog Xray connector. It lets you populate the Software Composition perspective straight from your CI pipeline, without configuring a Software Composition Analysis (SCA) tool connector for the project.
Supported Formats
Teamscale accepts the following SBOM formats:
| Format | Serialization | Notes |
|---|---|---|
| CycloneDX | JSON or XML | Prefer this format if you need vulnerability data (see Vulnerabilities). |
| SPDX 2.x | JSON only | Components and licenses only; SPDX carries no vulnerability data (see Vulnerabilities). |
Teamscale automatically detects the format by looking inside the file, so naming it is not necessary. For this Teamscale reads the first 64 KB of the report. Keep the identifying parts (bomFormat / spdxVersion) of the file at the top in case you apply post-processing to your reports.
Teamscale rejects a file that it cannot recognize or parse, and teamscale-upload then fails with an error message.
Generating a Report
Any tool that writes one of the formats above can feed Teamscale. Common choices are:
- The CycloneDX plugins for build tools such as Maven, Gradle, npm or .NET.
- Syft for containers, images and file systems.
- Trivy, which additionally reports the vulnerabilities it finds.
- Grype, which adds vulnerabilities to an SBOM you already have.
Build-tool plugins such as the CycloneDX ones list the components but no vulnerabilities. Use a scanner if you want Teamscale to show vulnerabilities as well. Refer to the documentation of your tool for how to make it write CycloneDX or SPDX.
Prerequisites
- The Teamscale server must be reachable via HTTP(S) from the machine performing the upload.
- You need a Teamscale user with the Perform External Uploads permission for the target project — the same permission required for other external uploads. For a production setup we recommend creating a technical user with the Build role.
- You need that user's access key (not their password). You can generate an access key on the profile page:
<TEAMSCALE_URL>/user/access-key. - You need
teamscale-uploadversion 2.11.0 or later.
No analysis profile setting or SCA connector needs to be enabled for the upload to work.
Identifying the Upload
Every upload takes three values, whatever upload method you use:
- The build name names the build the report belongs to, for example the service or component that was built. It groups the successive versions of the same build pipeline.
- The version is the build number identifying this upload within the build. You supply it yourself, for example your CI build number.
- The commit is the version control revision the build was produced from. Teamscale uses it to link the build, and the violations derived from it, to the corresponding code commit.
The build name and version together identify the report. Re-uploading with the same build name and version overwrites the previously uploaded report, whichever commit you give. See Choosing Build Name and Build Version for how to pick the two values.
Upload via Command Linerecommended
The teamscale-upload command line utility uploads vulnerability reports through its vulnerability-report command. Its connection options, the necessary Teamscale user permissions and the ways to pass the access key are the same as when uploading external analysis data.
teamscale-upload vulnerability-report \
--server https://<TEAMSCALE_URL> \
--project <PROJECT> \
--user <USER> \
--accesskey <ACCESSKEY> \
--build-name <BUILD_NAME> \
--build-version <BUILD_VERSION> \
<PATH/TO/REPORT/FILE>teamscale-upload exits with code 0 if the upload succeeded. Any other exit code indicates a problem, which teamscale-upload logs to the console. Run teamscale-upload vulnerability-report --help to see all options.
Options
| Option | Required | Description |
|---|---|---|
--server | yes | The URL of the Teamscale server. |
--project | yes | The ID of the Teamscale project to upload to. |
--user | yes | The Teamscale user that performs the upload. |
--accesskey | no | The access key of that user. You can also provide it in the environment variable TEAMSCALE_ACCESS_KEY, which keeps it out of the command line. |
--build-name | yes | Name of the build artifact the report describes, for example, a module, a service, a binary or the output of a CI job. Use the same name every time you rebuild that artifact. See Choosing Build Name and Build Version. |
--build-version | yes | Free-form text that identifies this upload within the build, for example, a branch name, a release version or a commit hash. See Choosing Build Name and Build Version. |
--commit | no | The commit the build was produced from. Teamscale uses it to link the build and its violations to that commit. If you omit it, teamscale-upload detects the commit from your CI system or from the Git or SVN checkout in the working directory. |
REPORT | yes | The path or pattern of the report file. It must resolve to exactly one file. Teamscale detects the format automatically. |
Both the build name and the build version may contain slashes, so values such as feature/login can be used as-is. Neither value may contain the # character.
Teamscale stores and parses the report while handling the upload, so its components and vulnerabilities are available in the Web UI and via the REST API as soon as the upload finishes.
Reading the Uploaded Data
The components, vulnerabilities and violations of the uploaded reports can also be read via the REST API, for example, to gate a pipeline on them. These endpoints are documented in the API reference of your Teamscale instance, as described here.
Specifying the Commit
You can specify the commit to which an upload should be attached with --commit <COMMIT_ID>, where <COMMIT_ID> is the ID of the commit in your version control system (for example, the commit hash in a Git repository).
If you omit --commit, teamscale-upload detects the commit from the environment variables of your CI system or from a Git or SVN checkout in the current working directory. The upload fails if no commit can be detected, because Teamscale needs the commit to link the report to your code.
Choosing Build Name and Build Version
The two values decide which reports Teamscale keeps and how you find them later.
Build name. The build name identifies the build artifact, for example, a module, a service, a library, a binary or the output of a CI job. Use one build name per artifact, and use exactly the same name each time you rebuild that artifact. If the name changes between builds, Teamscale shows the uploads as separate builds.
Build version. The build version is free-form text. Teamscale does not interpret it and does not attach further meaning to it. It keeps one report per combination of build name and build version:
- If you upload a report with a new build version, Teamscale adds it as a new version of the build.
- If you upload a report with a build name and build version that already exist, the new report replaces the old one. Teamscale also replaces the commit that it links to that version.
The commit plays no role in this decision. Teamscale replaces a report only if both the build name and the build version match.
Choose the build version according to which reports you want to keep:
| You want to keep | Use as build version | Example values |
|---|---|---|
| The latest report of each branch | The branch name | main, feature/login |
| One report per release | The release version | 2026.6.0, 2026.6.1 |
| One report per release on each branch | Branch name and release version | main/2026.6.0, release-2026.6/2026.6.1 |
| One report per commit | A value that contains the commit hash | main/0842320e |
The latest report of each branch. Use the branch name as build version. Every new commit on the branch uploads its report with the same build version, so the new report replaces the previous one. Teamscale therefore stores only the most recent report of each branch.
One report per release. Use the version number of your software, for example, 2026.6.0 and then 2026.6.1. Every release gets its own entry, so you can compare the components of different releases. If you rebuild a release, the new report replaces the old one.
Branch and release combined. Combine both values into one build version, for example, main/2026.6.0. You can then tell the uploads apart by branch and by release. Teamscale stores the combined value as plain text, so choose a format that you can read later.
One report per commit. The build version must differ for every commit. The easiest way is to include the commit hash, for example, $CI_COMMIT_SHA on GitLab CI. You can add the branch name as well, for example, main/0842320e, to see the branch in the Builds view. Teamscale then stores a report for every commit, so the number of versions grows with every upload.
Different strategies for different branches. You can use several of these strategies for the same build at the same time. For example, your feature branches can upload with the branch name as build version, so Teamscale keeps only their latest report. At the same time, your release branches can upload with the release version, so Teamscale keeps one report per release. Make sure that the values of the different strategies never coincide, because equal values replace each other.
Uploading Several Reports for One Commit
You can upload any number of reports for the same commit, for example, one per module or one per container image. Give each report its own build name. Because the build names differ, the reports do not replace each other, even though they share the commit.
You can then view the reports of a commit in two ways:
- Combined. The SBOM view and the Violations view show the components and violations of all reports uploaded for the selected commit in one table. The Build column shows which report each entry comes from.
- Individually. The Builds view lists each build separately. Open a build version to see the components, vulnerabilities and violations of that single report.
Uploading from a CI Pipeline
Generate the report as part of your build with the tool of your choice, then upload the resulting file with the identifiers your CI system already provides. The following example uses GitLab CI variables and keeps the latest report of each branch:
# The access key is read from the masked CI variable TEAMSCALE_ACCESS_KEY.
# The commit is detected automatically.
teamscale-upload vulnerability-report \
--server https://teamscale-server:8080 \
--project my-project \
--user build \
--build-name my-service \
--build-version "$CI_COMMIT_REF_NAME" \
bom.jsonTo keep a report for every commit instead, use --build-version "$CI_COMMIT_REF_NAME/$CI_COMMIT_SHA". See Choosing Build Name and Build Version for further options.
Store the access key as a masked CI variable rather than in the pipeline definition.
Upload via Docker Image
Pass the vulnerability-report command and its options after the image name (see example below). Mounting the workspace, detecting the commit inside the container and the file permissions of the report work as described for external analysis data.
docker pull cqse/teamscale-upload:latest
docker run --rm \
-v "$PWD:/workspace:ro" \
-e TEAMSCALE_ACCESS_KEY \
cqse/teamscale-upload:latest \
vulnerability-report \
--server https://<TEAMSCALE_URL> --project <PROJECT> --user <USER> \
--build-name <BUILD_NAME> --build-version <BUILD_VERSION> bom.jsonUpload via GitHub Action
If you build on GitHub, the Teamscale Upload action can upload the report as a build step, as it does for external analysis data. Set its command input to vulnerability-report, name the build via build-name and build-version, and pass the report through files.
Upload via REST API
If you cannot use the teamscale-upload utility, you can upload the report via the REST API. External analysis reports such as test coverage, findings and metrics are uploaded through the external-analysis session endpoints (see How to Upload External Analysis Data). Vulnerability reports are also external data, but they use a dedicated endpoint:
- HTTP method:
POST - Request URL:
http://<TEAMSCALE_URL>/api/v2026.8/projects/<PROJECT>/vulnerability-report?build-name=<BUILD_NAME>&version=<VERSION>&revision=<COMMIT_HASH> - Body:
multipart/form-datawith a single form field namedfileholding the report file. - Authentication: HTTP Basic Authentication with a Teamscale user and their access key (not their password).
- Response: HTTP 204 (no content) on success. An unparseable or empty file, or a missing parameter, results in HTTP 400 with an explanatory message.
<PROJECT> is the ID of the Teamscale project to upload to. The build-name, version and revision parameters carry the values described in Identifying the Upload, and all three are required.
The report's components and vulnerabilities are available in the Web UI and via the REST API as soon as the upload returns.
Sample Upload with curl
curl --request POST --user build:<ACCESSKEY> \
--form "file=@sbom.cyclonedx.json" \
"http://teamscale-server:8080/api/v2026.8/projects/my-project/vulnerability-report?build-name=my-service&version=1.4.2&revision=0842320ef195b2d9190ab32b2d24b4a77eb522b1"Always Quote the URL
The URL must be enclosed in quotes. Most shells treat the & character specially and would otherwise truncate the URL.
Vulnerabilities
Teamscale surfaces only the vulnerabilities the uploaded report itself contains. It does not run its own security checks on the components and does not query external vulnerability databases. How much vulnerability data is available therefore depends on the format:
- CycloneDX files can carry a dedicated
vulnerabilitiessection, which Teamscale imports in full. - SPDX 2.x has no vulnerability section, so reports in this format generally carry no vulnerability data.
Use CycloneDX if you want Teamscale to show vulnerabilities and the resulting policy violations for your components.
Each vulnerability in the report becomes both a vulnerability (shown on the build details) and a violation of type security (shown in the Violations view, where it can be marked as tolerated or false positive). Teamscale normalizes the severity ratings of the report to Critical, High, Medium, Low, None or Unknown.
Viewing Uploaded Reports
Uploaded reports appear in the Software Composition perspective:
- The SBOM view lists the components of all reports uploaded for the selected commit.
- The Builds view lists each build and its versions; the build details include an SBOM tab with that version's components and a Vulnerabilities tab.
- The Violations view lists the policy violations derived from the vulnerabilities of the reports uploaded for the selected commit, where you can mark them as tolerated or false positive.
