Skip to content

Commit

Permalink
feat: Add Debricked support for GitLab SCA Import (implements fortify#52
Browse files Browse the repository at this point in the history
 for GitLab)
  • Loading branch information
kadraman committed Jan 31, 2023
1 parent a2bfd34 commit c9565e3
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ json.gitlab.debricked.format:
file: $[vuln.fullFileName]
dependency:
package:
name: $[vuln.details?.customAttributes?.componentName]
version: $[vuln.details?.customAttributes?.componentVersion]
name: $[vuln.details?.customAttributes?.componentName > '' ? vuln.details?.customAttributes?.componentName :'Not Set']
version: $[vuln.details?.customAttributes?.componentVersion > '' ? vuln.details?.customAttributes?.componentVersion :'Not Set' ]



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ json.gitlab.sonatype.format:
location:
file: $[vuln.fullFileName]
dependency:
package.name: $[vuln.details?.customAttributes?.artifact]
version: $[vuln.details?.customAttributes?.version]
package.name: $[vuln.details?.customAttributes?.artifact > '' ? vuln.details?.customAttributes?.artifact :'Not Set']
version: $[vuln.details?.customAttributes?.version > '' ? vuln.details?.customAttributes?.version :'Not Set']



Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ fortify_scanning:
dast: gl-fortify-dast.json
```
The configuration file `/config/FoDToGitLab.yml` used in this example outputs all available GitLab reports. Alternatively, you can use `/config/FoDToGitLabSAST.yml` or `/config/FoDToGitLabDAST.yml` to output only a SAST or DAST report respectively. Note that contrary to the [SSC implementation](#ssc-to-gitlab), outputting Sonatype/dependency scanning
The configuration file `/config/FoDToGitLab.yml` used in this example outputs all available GitLab reports. Alternatively, you can use `/config/FoDToGitLabSAST.yml` or `/config/FoDToGitLabDAST.yml` to output only a SAST or DAST report respectively. Note that contrary to the [SSC implementation](#ssc-to-gitlab), outputting Debricked or Sonatype dependency scanning
results from FoD is not yet supported.
As described in the [CI/CD Integration](#cicd-integration) section, you can optionally combine this with other Fortify tools to create a full workflow that scans your code and makes the results available on GitLab.
Expand All @@ -510,10 +510,12 @@ fortify_scanning:
reports:
sast: gl-fortify-sast.json
dast: gl-fortify-dast.json
dependency_scanning: gl-fortify-depscan.json
dependency_scanning: gl-fortify-debricked-depscan.json
# Or for Sonatype Nexus IQ use: gl-fortify-sonatype-depscan.json
```
The configuration file `/config/SSCToGitLab.yml` used in this example outputs all available GitLab reports. Alternatively, you can use `/config/SSCToGitLabSAST.yml`, `/config/SSCToGitLabDAST.yml`, or `/config/SSCToGitLabSonatype.yml` to output only a SAST, DAST or Sonatype report respectively.
The configuration file `/config/SSCToGitLab.yml` used in this example outputs all available GitLab reports. Alternatively, you can use `/config/SSCToGitLabSAST.yml`, `/config/SSCToGitLabDAST.yml`, `/config/SSCToGitLabDebricked.yml` or `/config/SSCToGitLabSonatype.yml`
to output only a SAST, DAST, Debricked SCA or Sonatype SCA report respectively.
As described in the [CI/CD Integration](#cicd-integration) section, you can optionally combine this with other Fortify tools to create a full workflow that scans your code and makes the results available on GitLab.
Expand Down Expand Up @@ -596,6 +598,7 @@ At the moment of writing, DefectDojo supports GitLab SAST and GitLab Dependency
* [Export FoD SAST results to a GitLab SAST report](#fod-to-gitlab) and import this report into DefectDojo
* [Export SSC SAST results to a GitLab SAST report](#ssc-to-gitlab) and import this report into DefectDojo
* [Export SSC Debricked results to a GitLab Dependency Scanning report](#ssc-to-gitlab) and import this report into DefectDojo
* [Export SSC Sonatype results to a GitLab Dependency Scanning report](#ssc-to-gitlab) and import this report into DefectDojo
* [Export other FoD or SSC results to CSV format](#csv-export) and import the CSV file into DefectDojo
Expand Down
10 changes: 7 additions & 3 deletions config/SSCToGitLab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

export:
from: ssc
to: json.gitlab.sast, json.gitlab.dast, json.gitlab.sonatype
to: json.gitlab.sast, json.gitlab.dast, json.gitlab.sonatype, json.gitlab.debricked

ssc:
version:
Expand Down Expand Up @@ -31,5 +31,9 @@ json.gitlab.dast.output:
json.gitlab.sonatype.output:
stdout: false # Disabled by default to avoid vulnerability data being exposed through log files
pretty: true # Useful for debugging, disable for optimal performance
file: ${export.dir}/gl-fortify-depscan.json # Output file

file: ${export.dir}/gl-fortify-sonatype-depscan.json # Output file

json.gitlab.debricked.output:
stdout: false # Disabled by default to avoid vulnerability data being exposed through log files
pretty: true # Useful for debugging, disable for optimal performance
file: ${export.dir}/gl-fortify-debricked-depscan.json # Output file
2 changes: 1 addition & 1 deletion config/SSCToGitLabDebricked.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ export.dir: ${CI_PROJECT_DIR:${export.default.dir}} # Unless overridden, use
json.gitlab.debricked.output:
stdout: false # Disabled by default to avoid vulnerability data being exposed through log files
pretty: true # Useful for debugging, disable for optimal performance
file: ${export.dir}/gl-fortify-depscan.json # Output file
file: ${export.dir}/gl-fortify-debricked-depscan.json # Output file

2 changes: 1 addition & 1 deletion config/SSCToGitLabSonatype.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ export.dir: ${CI_PROJECT_DIR:${export.default.dir}} # Unless overridden, use
json.gitlab.sonatype.output:
stdout: false # Disabled by default to avoid vulnerability data being exposed through log files
pretty: true # Useful for debugging, disable for optimal performance
file: ${export.dir}/gl-fortify-depscan.json # Output file
file: ${export.dir}/gl-fortify-sonatype-depscan.json # Output file

0 comments on commit c9565e3

Please sign in to comment.