mercedes-benz / sechub

SecHub provides a central API to test software with different security tools.
https://mercedes-benz.github.io/sechub/
MIT License
259 stars 58 forks source link

Enhance report model with version control meta data #3094

Closed de-jcup closed 2 months ago

de-jcup commented 2 months ago

Situation

Currently we have no explicit version control information inside our report model. With #3093 we will provide revision information for secret scan findings

But some information are missing with #3093

Wanted

It shall be possible to provide relevant version control information inside a job report

Solution

Extend inside meta data. Here an example for the new element syntax:


{
  "metaData": { 
    "versionControl" : {
         "type" : "git",
         "location" : "https://github.com/sechub/example-repository.git",
         "revision" : {
             "id" : "57adf786209eaf01d9f26beb0a9e9fffdcf5f04b"
         }
    }
  }
}

Thoughts about future scenario of handling multiple version control data

SecHub currently focuses on one repository only. This is the reason why we do not use a an array for version control information here: It is clear that the complete report, every finding is referencing this version control only. And if the finding has no revision set, it will use the revision defined at the meta data section.

If there is any need in future to provide multiple version control definitions, we can still do

But currently there is no need for such a handling - we keep it as simple as possible for the moment.