Skip to content

Project autocreation leads to multiple projects #5583

@deubert-it

Description

@deubert-it

Current Behavior

In our gitlab pipelines we provide a template that sends via trivy generated sboms to our DependencyTrack instance. In our REST request to /api/v1/bom we provide the parameters:

autoCreate=true
projectName=myProjectName
projectVersion=1.0.0

This will successfully upload the bom and create the project and version.

Now from a subsequent pipeline with a new bom and parameters like these:

autoCreate=true
projectName=myProjectName
projectVersion=1.0.1

We would expect to add this sbom to the same project.

However, we currently land in a state where it seems only partially linked.

  • Projects will be visible multiple times in the project list, and have unique project UUIDs, at least in visible URL like https://dependencytrack/projects/UUID will differ
  • However when clicking on one of the projects, the version dropdown correctly shows all available versions

I checked the REST endpoint if there could be more things supplied to give DependencyTrack more "hints", as gitlab would offer more things to match projects, but besides an actual project UUID (which I don't have when relying on autocreation if it doesn't exist) and tags, I can't seem to set things that I could set via UI.

From gitlab perspective, we could easily supply:

  • namespace/group/vendor in DT could be the gitlab project part like groupname/subgroup/projectname
  • packageurl could be the gitlab project url
  • SWID Tag ID could be the gitlab project id

Steps to Reproduce

  1. without an existing project, upload sbom via /api/v1/bom with these parameters (new project + new version)
autoCreate=true
projectName=myProjectName
projectVersion=1.0.0
  1. with the existing project, upload sbom via /api/v1/bom with these parameters (existing project + new version)
autoCreate=true
projectName=myProjectName
projectVersion=1.0.1

Expected Behavior

Subsequent sbom uploads with autoCreate=on should only create a new project if it is actually a new project.

Dependency-Track Version

4.13.4

Dependency-Track Distribution

Container Image

Database Server

H2

Database Server Version

No response

Browser

Google Chrome

Checklist

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions