1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-10-30 23:57:50 +02:00

Enhance fortify influx data (#3040)

This commit is contained in:
Sven Merk
2021-08-10 10:49:31 +02:00
committed by GitHub
parent 15f533c536
commit 90110c0702
3 changed files with 8 additions and 3 deletions

View File

@@ -279,14 +279,15 @@ func verifyFFProjectCompliance(config fortifyExecuteScanOptions, sys fortify.Sys
if err != nil {
return errors.Wrap(err, "failed to analyze unaudited issues"), reports
}
numberOfSuspiciousExplotable, issueGroupsSuspiciousExploitable := analyseSuspiciousExploitable(config, sys, projectVersion, filterSet, issueFilterSelectorSet, influx, auditStatus)
numberOfViolations += numberOfSuspiciousExplotable
numberOfSuspiciousExploitable, issueGroupsSuspiciousExploitable := analyseSuspiciousExploitable(config, sys, projectVersion, filterSet, issueFilterSelectorSet, influx, auditStatus)
numberOfViolations += numberOfSuspiciousExploitable
issueGroups = append(issueGroups, issueGroupsSuspiciousExploitable...)
log.Entry().Infof("Counted %v violations, details: %v", numberOfViolations, auditStatus)
influx.fortify_data.fields.projectName = *project.Name
influx.fortify_data.fields.projectVersion = *projectVersion.Name
influx.fortify_data.fields.projectVersionID = projectVersion.ID
influx.fortify_data.fields.violations = numberOfViolations
scanReport := fortify.CreateCustomReport(prepareReportData(influx), issueGroups)

View File

@@ -85,6 +85,7 @@ type fortifyExecuteScanInflux struct {
fields struct {
projectName string
projectVersion string
projectVersionID int64
violations int
corporateTotal int
corporateAudited int
@@ -112,6 +113,7 @@ func (i *fortifyExecuteScanInflux) persist(path, resourceName string) {
{valType: config.InfluxField, measurement: "step_data", name: "fortify", value: i.step_data.fields.fortify},
{valType: config.InfluxField, measurement: "fortify_data", name: "projectName", value: i.fortify_data.fields.projectName},
{valType: config.InfluxField, measurement: "fortify_data", name: "projectVersion", value: i.fortify_data.fields.projectVersion},
{valType: config.InfluxField, measurement: "fortify_data", name: "projectVersionId", value: i.fortify_data.fields.projectVersionID},
{valType: config.InfluxField, measurement: "fortify_data", name: "violations", value: i.fortify_data.fields.violations},
{valType: config.InfluxField, measurement: "fortify_data", name: "corporateTotal", value: i.fortify_data.fields.corporateTotal},
{valType: config.InfluxField, measurement: "fortify_data", name: "corporateAudited", value: i.fortify_data.fields.corporateAudited},
@@ -865,7 +867,7 @@ func fortifyExecuteScanMetadata() config.StepData {
Type: "influx",
Parameters: []map[string]interface{}{
{"Name": "step_data"}, {"fields": []map[string]string{{"name": "fortify"}}},
{"Name": "fortify_data"}, {"fields": []map[string]string{{"name": "projectName"}, {"name": "projectVersion"}, {"name": "violations"}, {"name": "corporateTotal"}, {"name": "corporateAudited"}, {"name": "auditAllTotal"}, {"name": "auditAllAudited"}, {"name": "spotChecksTotal"}, {"name": "spotChecksAudited"}, {"name": "spotChecksGap"}, {"name": "suspicious"}, {"name": "exploitable"}, {"name": "suppressed"}}},
{"Name": "fortify_data"}, {"fields": []map[string]string{{"name": "projectName"}, {"name": "projectVersion"}, {"name": "projectVersionId"}, {"name": "violations"}, {"name": "corporateTotal"}, {"name": "corporateAudited"}, {"name": "auditAllTotal"}, {"name": "auditAllAudited"}, {"name": "spotChecksTotal"}, {"name": "spotChecksAudited"}, {"name": "spotChecksGap"}, {"name": "suspicious"}, {"name": "exploitable"}, {"name": "suppressed"}}},
},
},
},

View File

@@ -616,6 +616,8 @@ spec:
fields:
- name: projectName
- name: projectVersion
- name: projectVersionId
type: int64
- name: violations
type: int
- name: corporateTotal