mercedes-benz / sechub

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

Define and document the TAR and zip structure for data sections #1163

Closed de-jcup closed 2 years ago

de-jcup commented 2 years ago

Situation

This is (not only) a sub issue of #1166

When https://github.com/mercedes-benz/sechub/issues/1154 and https://github.com/mercedes-benz/sechub/issues/1098 are implemented a user is able to upload multiple binaries, sources etc. give them names and reference the files/folders inside the sechub configuration file

But doing this, we must

Wanted

Solution

General Definition

We map the JSON model into the file system by using always following path pattern:

/__data__/$storageDataType/$dataObjectName/$originPath

Examples

Next steps

Implement

de-jcup commented 2 years ago

Example 1

The JSON looks like:

{
  "apiVersion" : "1.0",
  "data" : {
    "sources" : [ {
      "name" : "open-api-file-reference",
      "fileystem" : {
        "files" : [ "gamechanger-webapp/src/main/resources/openapi3.json" ]
      }
    } ]
  },
  "codeScan" : {
    "fileSystem" : {
      "folders" : [ "gamechanger-android/src/main/java", "gamechanger-server/src/main/java" ]
    },
    "excludes" : [ "**/mytestcode/**", "**/documentation/**" ],
    "additionalFilenameExtensions" : [ ".cplusplus", ".py9" ],
    "uses" : [ "open-api-file-reference"]
  },
  "webScan" : {
    "openApi" : {
      "uses" : [ "open-api-file-reference" ]
    },
    "uri" : "https://productfailure.demo.example.org"
  }
}

All of those parts do contain sources and will be combined inside sourcecode.zip which is uploaded only ONE time.

The resulting zip file will have following content:

/__data__/sources/open-api-file-reference/gamechanger-webapp/src/main/resources/openapi3.json
/gamechanger-android/src/main/java
/gamechanger-server/src/main/java