2020-05-25 19:48:59 +02:00
// Code generated by piper's step-generator. DO NOT EDIT.
package cmd
import (
"fmt"
"os"
"path/filepath"
2022-02-21 10:23:54 +02:00
"reflect"
"strings"
2020-05-25 19:48:59 +02:00
"time"
"github.com/SAP/jenkins-library/pkg/config"
2022-02-21 10:23:54 +02:00
"github.com/SAP/jenkins-library/pkg/gcs"
2020-05-25 19:48:59 +02:00
"github.com/SAP/jenkins-library/pkg/log"
"github.com/SAP/jenkins-library/pkg/piperenv"
2021-05-17 12:14:04 +02:00
"github.com/SAP/jenkins-library/pkg/splunk"
2020-05-25 19:48:59 +02:00
"github.com/SAP/jenkins-library/pkg/telemetry"
2021-10-01 12:49:05 +02:00
"github.com/SAP/jenkins-library/pkg/validation"
2022-02-21 10:23:54 +02:00
"github.com/bmatcuk/doublestar"
2020-05-25 19:48:59 +02:00
"github.com/spf13/cobra"
)
type fortifyExecuteScanOptions struct {
2021-03-09 14:16:21 +02:00
AdditionalScanParameters [ ] string ` json:"additionalScanParameters,omitempty" `
2022-11-07 13:17:11 +02:00
AdditionalMvnParameters [ ] string ` json:"additionalMvnParameters,omitempty" `
2022-01-21 11:52:17 +02:00
Assignees [ ] string ` json:"assignees,omitempty" `
2020-06-02 13:47:07 +02:00
AuthToken string ` json:"authToken,omitempty" `
2021-06-28 12:40:20 +02:00
BuildDescriptorExcludeList [ ] string ` json:"buildDescriptorExcludeList,omitempty" `
2021-02-26 14:43:03 +02:00
CustomScanVersion string ` json:"customScanVersion,omitempty" `
2020-06-02 13:47:07 +02:00
GithubToken string ` json:"githubToken,omitempty" `
AutoCreate bool ` json:"autoCreate,omitempty" `
ModulePath string ` json:"modulePath,omitempty" `
PythonRequirementsFile string ` json:"pythonRequirementsFile,omitempty" `
AutodetectClasspath bool ` json:"autodetectClasspath,omitempty" `
MustAuditIssueGroups string ` json:"mustAuditIssueGroups,omitempty" `
SpotAuditIssueGroups string ` json:"spotAuditIssueGroups,omitempty" `
PythonRequirementsInstallSuffix string ` json:"pythonRequirementsInstallSuffix,omitempty" `
2022-08-12 15:17:11 +02:00
PythonVersion string ` json:"pythonVersion,omitempty" validate:"possible-values=python3 python2" `
2020-06-02 13:47:07 +02:00
UploadResults bool ` json:"uploadResults,omitempty" `
2021-02-26 14:43:03 +02:00
Version string ` json:"version,omitempty" `
2020-06-02 13:47:07 +02:00
BuildDescriptorFile string ` json:"buildDescriptorFile,omitempty" `
CommitID string ` json:"commitId,omitempty" `
CommitMessage string ` json:"commitMessage,omitempty" `
GithubAPIURL string ` json:"githubApiUrl,omitempty" `
Owner string ` json:"owner,omitempty" `
Repository string ` json:"repository,omitempty" `
Memory string ` json:"memory,omitempty" `
UpdateRulePack bool ` json:"updateRulePack,omitempty" `
ReportDownloadEndpoint string ` json:"reportDownloadEndpoint,omitempty" `
PollingMinutes int ` json:"pollingMinutes,omitempty" `
QuickScan bool ` json:"quickScan,omitempty" `
Translate string ` json:"translate,omitempty" `
Src [ ] string ` json:"src,omitempty" `
Exclude [ ] string ` json:"exclude,omitempty" `
APIEndpoint string ` json:"apiEndpoint,omitempty" `
ReportType string ` json:"reportType,omitempty" `
PythonAdditionalPath [ ] string ` json:"pythonAdditionalPath,omitempty" `
ArtifactURL string ` json:"artifactUrl,omitempty" `
ConsiderSuspicious bool ` json:"considerSuspicious,omitempty" `
2022-02-08 15:10:40 +02:00
ConvertToSarif bool ` json:"convertToSarif,omitempty" `
2020-06-02 13:47:07 +02:00
FprUploadEndpoint string ` json:"fprUploadEndpoint,omitempty" `
ProjectName string ` json:"projectName,omitempty" `
Reporting bool ` json:"reporting,omitempty" `
ServerURL string ` json:"serverUrl,omitempty" `
PullRequestMessageRegexGroup int ` json:"pullRequestMessageRegexGroup,omitempty" `
DeltaMinutes int ` json:"deltaMinutes,omitempty" `
SpotCheckMinimum int ` json:"spotCheckMinimum,omitempty" `
2022-08-01 23:06:05 +02:00
SpotCheckMinimumUnit string ` json:"spotCheckMinimumUnit,omitempty" validate:"possible-values=number percentage" `
2022-08-09 15:26:07 +02:00
SpotCheckMaximum int ` json:"spotCheckMaximum,omitempty" `
2020-06-02 13:47:07 +02:00
FprDownloadEndpoint string ` json:"fprDownloadEndpoint,omitempty" `
2021-11-15 13:06:48 +02:00
VersioningModel string ` json:"versioningModel,omitempty" validate:"possible-values=major major-minor semantic full" `
2020-06-02 13:47:07 +02:00
PythonInstallCommand string ` json:"pythonInstallCommand,omitempty" `
ReportTemplateID int ` json:"reportTemplateId,omitempty" `
FilterSetTitle string ` json:"filterSetTitle,omitempty" `
PullRequestName string ` json:"pullRequestName,omitempty" `
PullRequestMessageRegex string ` json:"pullRequestMessageRegex,omitempty" `
BuildTool string ` json:"buildTool,omitempty" `
ProjectSettingsFile string ` json:"projectSettingsFile,omitempty" `
2023-08-31 13:48:18 +02:00
Proxy string ` json:"proxy,omitempty" `
2020-06-02 13:47:07 +02:00
GlobalSettingsFile string ` json:"globalSettingsFile,omitempty" `
M2Path string ` json:"m2Path,omitempty" `
2020-09-18 08:19:34 +02:00
VerifyOnly bool ` json:"verifyOnly,omitempty" `
2020-11-16 11:29:21 +02:00
InstallArtifacts bool ` json:"installArtifacts,omitempty" `
2022-01-21 11:52:17 +02:00
CreateResultIssue bool ` json:"createResultIssue,omitempty" `
2020-05-25 19:48:59 +02:00
}
type fortifyExecuteScanInflux struct {
2021-03-18 11:32:03 +02:00
step_data struct {
fields struct {
fortify bool
}
tags struct {
}
}
2020-05-25 19:48:59 +02:00
fortify_data struct {
fields struct {
2022-05-20 10:24:16 +02:00
projectID int64
2020-05-25 19:48:59 +02:00
projectName string
projectVersion string
2021-08-10 10:49:31 +02:00
projectVersionID int64
2020-10-22 11:40:42 +02:00
violations int
corporateTotal int
corporateAudited int
auditAllTotal int
auditAllAudited int
spotChecksTotal int
spotChecksAudited int
spotChecksGap int
suspicious int
exploitable int
suppressed int
2020-05-25 19:48:59 +02:00
}
tags struct {
}
}
}
func ( i * fortifyExecuteScanInflux ) persist ( path , resourceName string ) {
measurementContent := [ ] struct {
measurement string
valType string
name string
2020-10-05 15:33:28 +02:00
value interface { }
2020-05-25 19:48:59 +02:00
} {
2021-03-18 11:32:03 +02:00
{ valType : config . InfluxField , measurement : "step_data" , name : "fortify" , value : i . step_data . fields . fortify } ,
2022-05-20 10:24:16 +02:00
{ valType : config . InfluxField , measurement : "fortify_data" , name : "projectID" , value : i . fortify_data . fields . projectID } ,
2020-05-25 19:48:59 +02:00
{ 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 } ,
2021-08-10 10:49:31 +02:00
{ valType : config . InfluxField , measurement : "fortify_data" , name : "projectVersionId" , value : i . fortify_data . fields . projectVersionID } ,
2020-05-25 19:48:59 +02:00
{ 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 } ,
{ valType : config . InfluxField , measurement : "fortify_data" , name : "auditAllTotal" , value : i . fortify_data . fields . auditAllTotal } ,
{ valType : config . InfluxField , measurement : "fortify_data" , name : "auditAllAudited" , value : i . fortify_data . fields . auditAllAudited } ,
{ valType : config . InfluxField , measurement : "fortify_data" , name : "spotChecksTotal" , value : i . fortify_data . fields . spotChecksTotal } ,
{ valType : config . InfluxField , measurement : "fortify_data" , name : "spotChecksAudited" , value : i . fortify_data . fields . spotChecksAudited } ,
{ valType : config . InfluxField , measurement : "fortify_data" , name : "spotChecksGap" , value : i . fortify_data . fields . spotChecksGap } ,
{ valType : config . InfluxField , measurement : "fortify_data" , name : "suspicious" , value : i . fortify_data . fields . suspicious } ,
{ valType : config . InfluxField , measurement : "fortify_data" , name : "exploitable" , value : i . fortify_data . fields . exploitable } ,
{ valType : config . InfluxField , measurement : "fortify_data" , name : "suppressed" , value : i . fortify_data . fields . suppressed } ,
}
errCount := 0
for _ , metric := range measurementContent {
err := piperenv . SetResourceParameter ( path , resourceName , filepath . Join ( metric . measurement , fmt . Sprintf ( "%vs" , metric . valType ) , metric . name ) , metric . value )
if err != nil {
log . Entry ( ) . WithError ( err ) . Error ( "Error persisting influx environment." )
errCount ++
}
}
if errCount > 0 {
2021-12-15 15:26:23 +02:00
log . Entry ( ) . Error ( "failed to persist Influx environment" )
2020-05-25 19:48:59 +02:00
}
}
2022-02-21 10:23:54 +02:00
type fortifyExecuteScanReports struct {
}
func ( p * fortifyExecuteScanReports ) persist ( stepConfig fortifyExecuteScanOptions , gcpJsonKeyFilePath string , gcsBucketId string , gcsFolderPath string , gcsSubFolder string ) {
if gcsBucketId == "" {
log . Entry ( ) . Info ( "persisting reports to GCS is disabled, because gcsBucketId is empty" )
return
}
log . Entry ( ) . Info ( "Uploading reports to Google Cloud Storage..." )
content := [ ] gcs . ReportOutputParam {
{ FilePattern : "**/*.PDF" , ParamRef : "" , StepResultType : "fortify" } ,
{ FilePattern : "**/*.fpr" , ParamRef : "" , StepResultType : "fortify" } ,
{ FilePattern : "**/fortify-scan.*" , ParamRef : "" , StepResultType : "fortify" } ,
{ FilePattern : "**/toolrun_fortify_*.json" , ParamRef : "" , StepResultType : "fortify" } ,
{ FilePattern : "**/piper_fortify_report.json" , ParamRef : "" , StepResultType : "fortify" } ,
{ FilePattern : "**/piper_fortify_report.html" , ParamRef : "" , StepResultType : "fortify" } ,
}
envVars := [ ] gcs . EnvVar {
{ Name : "GOOGLE_APPLICATION_CREDENTIALS" , Value : gcpJsonKeyFilePath , Modified : false } ,
}
gcsClient , err := gcs . NewClient ( gcs . WithEnvVars ( envVars ) )
if err != nil {
log . Entry ( ) . Errorf ( "creation of GCS client failed: %v" , err )
2022-02-22 19:32:09 +02:00
return
2022-02-21 10:23:54 +02:00
}
defer gcsClient . Close ( )
structVal := reflect . ValueOf ( & stepConfig ) . Elem ( )
inputParameters := map [ string ] string { }
for i := 0 ; i < structVal . NumField ( ) ; i ++ {
field := structVal . Type ( ) . Field ( i )
if field . Type . String ( ) == "string" {
paramName := strings . Split ( field . Tag . Get ( "json" ) , "," )
paramValue , _ := structVal . Field ( i ) . Interface ( ) . ( string )
inputParameters [ paramName [ 0 ] ] = paramValue
}
}
if err := gcs . PersistReportsToGCS ( gcsClient , content , inputParameters , gcsFolderPath , gcsBucketId , gcsSubFolder , doublestar . Glob , os . Stat ) ; err != nil {
log . Entry ( ) . Errorf ( "failed to persist reports: %v" , err )
}
}
2020-10-27 17:55:31 +02:00
// FortifyExecuteScanCommand This step executes a Fortify scan on the specified project to perform static code analysis and check the source code for security flaws.
2020-05-25 19:48:59 +02:00
func FortifyExecuteScanCommand ( ) * cobra . Command {
const STEP_NAME = "fortifyExecuteScan"
metadata := fortifyExecuteScanMetadata ( )
var stepConfig fortifyExecuteScanOptions
var startTime time . Time
var influx fortifyExecuteScanInflux
2022-02-21 10:23:54 +02:00
var reports fortifyExecuteScanReports
2021-05-17 12:14:04 +02:00
var logCollector * log . CollectorHook
Changes for Pipeline Reporting (#3213)
* Adds GetLog() function to orchestrator
* Fixes BUILD_NUMBER env variable
* Fixes correct env var for JENKINS_HOME
* Adds getEnv to read env variables with default value, adds test for jenkins GetLog() implementation
* Adds possibility to read errorJsons; updates splunk package for log files (WIP)
* Uncommenting dev code
* Adds GetLog() function to orchestrator
* Fixes BUILD_NUMBER env variable
* Fixes correct env var for JENKINS_HOME
* Adds getEnv to read env variables with default value, adds test for jenkins GetLog() implementation
* Adds possibility to read errorJsons; updates splunk package for log files (WIP)
* Uncommenting dev code
* Adds GetRequest function which holds the response in memory (not saved to disk)
* Implements GetLog() function for ADO, adds function to read PipelineRuntime
* PAT has been revoked
* Changes http package, s.t. if password only is required basic auth works too
* Adds env variable for azure token, error handling in case of unauthenticated/nil response
* Adds logging output in case env variable can not be read and fallback variable needs to be used
* Adds usage of environment variables for auth, uses jenkins api
* Adds init functionality for orchestrators, updates GetLog() and GetPipelineStartTime() function
* Adds initaliziation function for orchestrator authetnication
* Adds settings struct for orchestrator authentication
* Adds function to whole logfile to Splunk
* Struct for pipeline related telemetry information
* Increase messagebatch size to 10k
* Changes splunk package to a pointer based implementation, updates generated files and corresponding template and tests for splunk
* Changes telemetry package to pointer based implementation to have multiple telemetry objects, adjusted tests and splunk implementation
* Changes content type to txt
* Send telemetry independent of logfiles, increases amount of messages per file
* Adds JobURL for orchestrators and UnknownOrchestrator as fallback
* telemetry makes use of orchestrator specific information
* Adds orchestrator independent correlationID
* Adds custom fields for pipeline status
* go fmt
* Removes env var test - no env variables are read anymore
* Use UnknownOrchestratorConfigProvider in case the orchestrator can not be initalized
* Removes Custom fields from telemetry as these can not be reflected in SWA
* Adds custom telemetry information (piperHash,..) to each step telemetry information
* Removes falltrough in case no orchestrator has been found
* Updates tests for orchestrator package
* Adds orchestrator import in generated files
* Updates generator files for internal library
* Adds orchestrator telemetry information to steps
* Updates generated files, fatalHook writes to cpe
* Go generate from master, go fmt
* Adds Custom Data field LastErrorCode
* Removes GetLog() test
* Update init_unix.go
* Update docker_integration_test_executor.go
* Update integration_api_cli_test.go
* Reverts go1.17 fmt formatting
* Reverts go1.17 fmt formatting
* Reverts go1.17 fmt formatting
* Renames customTelemetryData to stepTelemetryData
* Adjustments to orchestrator-package, cleanup, adds JobName
* Adjusts commonPipelineEnvironment path
* Adds pipelineTelemetry struct to telemetry package, removes pipeline telemetry structs from splunk package
* Go fmt
* Changes path for errorDetails, adds debug information
* Removes custom fields from step, adds orchestrator, commithash to baseMetadata
* Adjusts tests for telemetry package
* Adds tests for orchestrator
* Updates generated files, initalization of splunk client only if its available in the config
* Fixes typo in helper go
* Update pkg/http/downloader.go
* Update pkg/http/downloader.go
* Update pkg/log/fatalHook.go
* Update fatalHook.go
* Update pkg/splunk/splunk.go
* Update pkg/telemetry/data.go
* Adds GetBuildStatus() and GetAPIInformation() to orchestrators
* error formatting
* Bugfix: dont send telemetry data if disabled, adjusts test
* go fmt
* Use correct error handling
* Update pkg/telemetry/telemetry.go
* Fixes telemetry disabled in the tests
* Fixes http tests
* Log fatal errors to logFile
* Adds CustomReportingConfig to hooks
* Cleanup comments in splunk package
* Adds possibility to send telemetry to custom endpoint
* Adds debug output for the payload
* Debug output for the payload as a string
* Adds test cases for changes in telemetry package
* go fmt
* Adds generated files for new step
* Reverts changes for http tests, causing problems with go1.15, changes need to be applied for newer go version >=1.17
* Adjusts test for sonarExecuteScan
* Adjusts test for sonarExecuteScan
* Adds explanation for customreportingConfig
* Makes disableing of customSend more obvious
* Adds custom step reporting to each step, updates generated files, adjusts helper testdata
* fixes unit test wrong usage of logging
* Send pipeline data altough there has been no error, adjust test cases
* Reverts changes for customReporting
* Updates generated files, removes customReporting
* Removes writing errorDetails to CPE
* Reverts usage of customreporting
* go fmt
* reverts changes in http_test
* reverts changes in http_test
* Skips integration cnb test
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-11-18 18:50:03 +02:00
var splunkClient * splunk . Splunk
telemetryClient := & telemetry . Telemetry { }
2020-05-25 19:48:59 +02:00
var createFortifyExecuteScanCmd = & cobra . Command {
Use : STEP_NAME ,
2020-10-27 17:55:31 +02:00
Short : "This step executes a Fortify scan on the specified project to perform static code analysis and check the source code for security flaws." ,
2020-05-25 19:48:59 +02:00
Long : ` This step executes a Fortify scan on the specified project to perform static code analysis and check the source code for security flaws .
The Fortify step triggers a scan locally on your Jenkins within a docker container so finally you have to supply a docker image with a Fortify SCA
2022-02-28 12:35:38 +02:00
and Java plus Maven / Gradle or alternatively Python installed into it for being able to perform any scans .
2021-06-14 09:54:45 +02:00
! ! ! hint "Scanning MTA projects"
2021-07-09 10:19:42 +02:00
Build type ` + " ` " + `maven` + " ` " + ` requires a so called aggregator pom which includes all modules to be scanned . If used in a mta - project which includes non - java submodules as maven dependency ( e . g . node via frontend - maven - plugin ) , exclude those by specifying java path explicitly , e . g . ` + " ` " + `java/**/src/main/java/**/*` + " ` " + ` .
Besides triggering a scan the step verifies the results after they have been uploaded and processed by the Fortify SSC . By default the following KPIs are enforced :
* All issues must be audited from the Corporate Security Requirements folder .
* All issues must be audited from the Audit All folder .
* At least one issue per category must be audited from the Spot Checks of Each Category folder .
* Nothing needs to be audited from the Optional folder . ` ,
2020-06-23 18:05:21 +02:00
PreRunE : func ( cmd * cobra . Command , _ [ ] string ) error {
2020-05-25 19:48:59 +02:00
startTime = time . Now ( )
log . SetStepName ( STEP_NAME )
log . SetVerbose ( GeneralConfig . Verbose )
2021-07-08 15:26:07 +02:00
GeneralConfig . GitHubAccessTokens = ResolveAccessTokens ( GeneralConfig . GitHubTokens )
2020-05-25 19:48:59 +02:00
path , _ := os . Getwd ( )
fatalHook := & log . FatalHook { CorrelationID : GeneralConfig . CorrelationID , Path : path }
log . RegisterHook ( fatalHook )
err := PrepareConfig ( cmd , & metadata , STEP_NAME , & stepConfig , config . OpenPiperFile )
if err != nil {
2020-06-24 10:04:05 +02:00
log . SetErrorCategory ( log . ErrorConfiguration )
2020-05-25 19:48:59 +02:00
return err
}
log . RegisterSecret ( stepConfig . AuthToken )
log . RegisterSecret ( stepConfig . GithubToken )
if len ( GeneralConfig . HookConfig . SentryConfig . Dsn ) > 0 {
sentryHook := log . NewSentryHook ( GeneralConfig . HookConfig . SentryConfig . Dsn , GeneralConfig . CorrelationID )
log . RegisterHook ( & sentryHook )
}
2021-05-17 12:14:04 +02:00
if len ( GeneralConfig . HookConfig . SplunkConfig . Dsn ) > 0 {
Changes for Pipeline Reporting (#3213)
* Adds GetLog() function to orchestrator
* Fixes BUILD_NUMBER env variable
* Fixes correct env var for JENKINS_HOME
* Adds getEnv to read env variables with default value, adds test for jenkins GetLog() implementation
* Adds possibility to read errorJsons; updates splunk package for log files (WIP)
* Uncommenting dev code
* Adds GetLog() function to orchestrator
* Fixes BUILD_NUMBER env variable
* Fixes correct env var for JENKINS_HOME
* Adds getEnv to read env variables with default value, adds test for jenkins GetLog() implementation
* Adds possibility to read errorJsons; updates splunk package for log files (WIP)
* Uncommenting dev code
* Adds GetRequest function which holds the response in memory (not saved to disk)
* Implements GetLog() function for ADO, adds function to read PipelineRuntime
* PAT has been revoked
* Changes http package, s.t. if password only is required basic auth works too
* Adds env variable for azure token, error handling in case of unauthenticated/nil response
* Adds logging output in case env variable can not be read and fallback variable needs to be used
* Adds usage of environment variables for auth, uses jenkins api
* Adds init functionality for orchestrators, updates GetLog() and GetPipelineStartTime() function
* Adds initaliziation function for orchestrator authetnication
* Adds settings struct for orchestrator authentication
* Adds function to whole logfile to Splunk
* Struct for pipeline related telemetry information
* Increase messagebatch size to 10k
* Changes splunk package to a pointer based implementation, updates generated files and corresponding template and tests for splunk
* Changes telemetry package to pointer based implementation to have multiple telemetry objects, adjusted tests and splunk implementation
* Changes content type to txt
* Send telemetry independent of logfiles, increases amount of messages per file
* Adds JobURL for orchestrators and UnknownOrchestrator as fallback
* telemetry makes use of orchestrator specific information
* Adds orchestrator independent correlationID
* Adds custom fields for pipeline status
* go fmt
* Removes env var test - no env variables are read anymore
* Use UnknownOrchestratorConfigProvider in case the orchestrator can not be initalized
* Removes Custom fields from telemetry as these can not be reflected in SWA
* Adds custom telemetry information (piperHash,..) to each step telemetry information
* Removes falltrough in case no orchestrator has been found
* Updates tests for orchestrator package
* Adds orchestrator import in generated files
* Updates generator files for internal library
* Adds orchestrator telemetry information to steps
* Updates generated files, fatalHook writes to cpe
* Go generate from master, go fmt
* Adds Custom Data field LastErrorCode
* Removes GetLog() test
* Update init_unix.go
* Update docker_integration_test_executor.go
* Update integration_api_cli_test.go
* Reverts go1.17 fmt formatting
* Reverts go1.17 fmt formatting
* Reverts go1.17 fmt formatting
* Renames customTelemetryData to stepTelemetryData
* Adjustments to orchestrator-package, cleanup, adds JobName
* Adjusts commonPipelineEnvironment path
* Adds pipelineTelemetry struct to telemetry package, removes pipeline telemetry structs from splunk package
* Go fmt
* Changes path for errorDetails, adds debug information
* Removes custom fields from step, adds orchestrator, commithash to baseMetadata
* Adjusts tests for telemetry package
* Adds tests for orchestrator
* Updates generated files, initalization of splunk client only if its available in the config
* Fixes typo in helper go
* Update pkg/http/downloader.go
* Update pkg/http/downloader.go
* Update pkg/log/fatalHook.go
* Update fatalHook.go
* Update pkg/splunk/splunk.go
* Update pkg/telemetry/data.go
* Adds GetBuildStatus() and GetAPIInformation() to orchestrators
* error formatting
* Bugfix: dont send telemetry data if disabled, adjusts test
* go fmt
* Use correct error handling
* Update pkg/telemetry/telemetry.go
* Fixes telemetry disabled in the tests
* Fixes http tests
* Log fatal errors to logFile
* Adds CustomReportingConfig to hooks
* Cleanup comments in splunk package
* Adds possibility to send telemetry to custom endpoint
* Adds debug output for the payload
* Debug output for the payload as a string
* Adds test cases for changes in telemetry package
* go fmt
* Adds generated files for new step
* Reverts changes for http tests, causing problems with go1.15, changes need to be applied for newer go version >=1.17
* Adjusts test for sonarExecuteScan
* Adjusts test for sonarExecuteScan
* Adds explanation for customreportingConfig
* Makes disableing of customSend more obvious
* Adds custom step reporting to each step, updates generated files, adjusts helper testdata
* fixes unit test wrong usage of logging
* Send pipeline data altough there has been no error, adjust test cases
* Reverts changes for customReporting
* Updates generated files, removes customReporting
* Removes writing errorDetails to CPE
* Reverts usage of customreporting
* go fmt
* reverts changes in http_test
* reverts changes in http_test
* Skips integration cnb test
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-11-18 18:50:03 +02:00
splunkClient = & splunk . Splunk { }
2021-05-17 12:14:04 +02:00
logCollector = & log . CollectorHook { CorrelationID : GeneralConfig . CorrelationID }
log . RegisterHook ( logCollector )
}
2022-06-22 13:31:17 +02:00
if err = log . RegisterANSHookIfConfigured ( GeneralConfig . CorrelationID ) ; err != nil {
log . Entry ( ) . WithError ( err ) . Warn ( "failed to set up SAP Alert Notification Service log hook" )
}
2021-10-01 12:49:05 +02:00
validation , err := validation . New ( validation . WithJSONNamesForStructFields ( ) , validation . WithPredefinedErrorMessages ( ) )
if err != nil {
return err
}
if err = validation . ValidateStruct ( stepConfig ) ; err != nil {
log . SetErrorCategory ( log . ErrorConfiguration )
return err
}
2020-05-25 19:48:59 +02:00
return nil
} ,
2020-06-23 18:05:21 +02:00
Run : func ( _ * cobra . Command , _ [ ] string ) {
Changes for Pipeline Reporting (#3213)
* Adds GetLog() function to orchestrator
* Fixes BUILD_NUMBER env variable
* Fixes correct env var for JENKINS_HOME
* Adds getEnv to read env variables with default value, adds test for jenkins GetLog() implementation
* Adds possibility to read errorJsons; updates splunk package for log files (WIP)
* Uncommenting dev code
* Adds GetLog() function to orchestrator
* Fixes BUILD_NUMBER env variable
* Fixes correct env var for JENKINS_HOME
* Adds getEnv to read env variables with default value, adds test for jenkins GetLog() implementation
* Adds possibility to read errorJsons; updates splunk package for log files (WIP)
* Uncommenting dev code
* Adds GetRequest function which holds the response in memory (not saved to disk)
* Implements GetLog() function for ADO, adds function to read PipelineRuntime
* PAT has been revoked
* Changes http package, s.t. if password only is required basic auth works too
* Adds env variable for azure token, error handling in case of unauthenticated/nil response
* Adds logging output in case env variable can not be read and fallback variable needs to be used
* Adds usage of environment variables for auth, uses jenkins api
* Adds init functionality for orchestrators, updates GetLog() and GetPipelineStartTime() function
* Adds initaliziation function for orchestrator authetnication
* Adds settings struct for orchestrator authentication
* Adds function to whole logfile to Splunk
* Struct for pipeline related telemetry information
* Increase messagebatch size to 10k
* Changes splunk package to a pointer based implementation, updates generated files and corresponding template and tests for splunk
* Changes telemetry package to pointer based implementation to have multiple telemetry objects, adjusted tests and splunk implementation
* Changes content type to txt
* Send telemetry independent of logfiles, increases amount of messages per file
* Adds JobURL for orchestrators and UnknownOrchestrator as fallback
* telemetry makes use of orchestrator specific information
* Adds orchestrator independent correlationID
* Adds custom fields for pipeline status
* go fmt
* Removes env var test - no env variables are read anymore
* Use UnknownOrchestratorConfigProvider in case the orchestrator can not be initalized
* Removes Custom fields from telemetry as these can not be reflected in SWA
* Adds custom telemetry information (piperHash,..) to each step telemetry information
* Removes falltrough in case no orchestrator has been found
* Updates tests for orchestrator package
* Adds orchestrator import in generated files
* Updates generator files for internal library
* Adds orchestrator telemetry information to steps
* Updates generated files, fatalHook writes to cpe
* Go generate from master, go fmt
* Adds Custom Data field LastErrorCode
* Removes GetLog() test
* Update init_unix.go
* Update docker_integration_test_executor.go
* Update integration_api_cli_test.go
* Reverts go1.17 fmt formatting
* Reverts go1.17 fmt formatting
* Reverts go1.17 fmt formatting
* Renames customTelemetryData to stepTelemetryData
* Adjustments to orchestrator-package, cleanup, adds JobName
* Adjusts commonPipelineEnvironment path
* Adds pipelineTelemetry struct to telemetry package, removes pipeline telemetry structs from splunk package
* Go fmt
* Changes path for errorDetails, adds debug information
* Removes custom fields from step, adds orchestrator, commithash to baseMetadata
* Adjusts tests for telemetry package
* Adds tests for orchestrator
* Updates generated files, initalization of splunk client only if its available in the config
* Fixes typo in helper go
* Update pkg/http/downloader.go
* Update pkg/http/downloader.go
* Update pkg/log/fatalHook.go
* Update fatalHook.go
* Update pkg/splunk/splunk.go
* Update pkg/telemetry/data.go
* Adds GetBuildStatus() and GetAPIInformation() to orchestrators
* error formatting
* Bugfix: dont send telemetry data if disabled, adjusts test
* go fmt
* Use correct error handling
* Update pkg/telemetry/telemetry.go
* Fixes telemetry disabled in the tests
* Fixes http tests
* Log fatal errors to logFile
* Adds CustomReportingConfig to hooks
* Cleanup comments in splunk package
* Adds possibility to send telemetry to custom endpoint
* Adds debug output for the payload
* Debug output for the payload as a string
* Adds test cases for changes in telemetry package
* go fmt
* Adds generated files for new step
* Reverts changes for http tests, causing problems with go1.15, changes need to be applied for newer go version >=1.17
* Adjusts test for sonarExecuteScan
* Adjusts test for sonarExecuteScan
* Adds explanation for customreportingConfig
* Makes disableing of customSend more obvious
* Adds custom step reporting to each step, updates generated files, adjusts helper testdata
* fixes unit test wrong usage of logging
* Send pipeline data altough there has been no error, adjust test cases
* Reverts changes for customReporting
* Updates generated files, removes customReporting
* Removes writing errorDetails to CPE
* Reverts usage of customreporting
* go fmt
* reverts changes in http_test
* reverts changes in http_test
* Skips integration cnb test
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-11-18 18:50:03 +02:00
stepTelemetryData := telemetry . CustomData { }
stepTelemetryData . ErrorCode = "1"
2020-05-25 19:48:59 +02:00
handler := func ( ) {
influx . persist ( GeneralConfig . EnvRootPath , "influx" )
2022-02-21 10:23:54 +02:00
reports . persist ( stepConfig , GeneralConfig . GCPJsonKeyFilePath , GeneralConfig . GCSBucketId , GeneralConfig . GCSFolderPath , GeneralConfig . GCSSubFolder )
2021-12-15 16:07:47 +02:00
config . RemoveVaultSecretFiles ( )
Changes for Pipeline Reporting (#3213)
* Adds GetLog() function to orchestrator
* Fixes BUILD_NUMBER env variable
* Fixes correct env var for JENKINS_HOME
* Adds getEnv to read env variables with default value, adds test for jenkins GetLog() implementation
* Adds possibility to read errorJsons; updates splunk package for log files (WIP)
* Uncommenting dev code
* Adds GetLog() function to orchestrator
* Fixes BUILD_NUMBER env variable
* Fixes correct env var for JENKINS_HOME
* Adds getEnv to read env variables with default value, adds test for jenkins GetLog() implementation
* Adds possibility to read errorJsons; updates splunk package for log files (WIP)
* Uncommenting dev code
* Adds GetRequest function which holds the response in memory (not saved to disk)
* Implements GetLog() function for ADO, adds function to read PipelineRuntime
* PAT has been revoked
* Changes http package, s.t. if password only is required basic auth works too
* Adds env variable for azure token, error handling in case of unauthenticated/nil response
* Adds logging output in case env variable can not be read and fallback variable needs to be used
* Adds usage of environment variables for auth, uses jenkins api
* Adds init functionality for orchestrators, updates GetLog() and GetPipelineStartTime() function
* Adds initaliziation function for orchestrator authetnication
* Adds settings struct for orchestrator authentication
* Adds function to whole logfile to Splunk
* Struct for pipeline related telemetry information
* Increase messagebatch size to 10k
* Changes splunk package to a pointer based implementation, updates generated files and corresponding template and tests for splunk
* Changes telemetry package to pointer based implementation to have multiple telemetry objects, adjusted tests and splunk implementation
* Changes content type to txt
* Send telemetry independent of logfiles, increases amount of messages per file
* Adds JobURL for orchestrators and UnknownOrchestrator as fallback
* telemetry makes use of orchestrator specific information
* Adds orchestrator independent correlationID
* Adds custom fields for pipeline status
* go fmt
* Removes env var test - no env variables are read anymore
* Use UnknownOrchestratorConfigProvider in case the orchestrator can not be initalized
* Removes Custom fields from telemetry as these can not be reflected in SWA
* Adds custom telemetry information (piperHash,..) to each step telemetry information
* Removes falltrough in case no orchestrator has been found
* Updates tests for orchestrator package
* Adds orchestrator import in generated files
* Updates generator files for internal library
* Adds orchestrator telemetry information to steps
* Updates generated files, fatalHook writes to cpe
* Go generate from master, go fmt
* Adds Custom Data field LastErrorCode
* Removes GetLog() test
* Update init_unix.go
* Update docker_integration_test_executor.go
* Update integration_api_cli_test.go
* Reverts go1.17 fmt formatting
* Reverts go1.17 fmt formatting
* Reverts go1.17 fmt formatting
* Renames customTelemetryData to stepTelemetryData
* Adjustments to orchestrator-package, cleanup, adds JobName
* Adjusts commonPipelineEnvironment path
* Adds pipelineTelemetry struct to telemetry package, removes pipeline telemetry structs from splunk package
* Go fmt
* Changes path for errorDetails, adds debug information
* Removes custom fields from step, adds orchestrator, commithash to baseMetadata
* Adjusts tests for telemetry package
* Adds tests for orchestrator
* Updates generated files, initalization of splunk client only if its available in the config
* Fixes typo in helper go
* Update pkg/http/downloader.go
* Update pkg/http/downloader.go
* Update pkg/log/fatalHook.go
* Update fatalHook.go
* Update pkg/splunk/splunk.go
* Update pkg/telemetry/data.go
* Adds GetBuildStatus() and GetAPIInformation() to orchestrators
* error formatting
* Bugfix: dont send telemetry data if disabled, adjusts test
* go fmt
* Use correct error handling
* Update pkg/telemetry/telemetry.go
* Fixes telemetry disabled in the tests
* Fixes http tests
* Log fatal errors to logFile
* Adds CustomReportingConfig to hooks
* Cleanup comments in splunk package
* Adds possibility to send telemetry to custom endpoint
* Adds debug output for the payload
* Debug output for the payload as a string
* Adds test cases for changes in telemetry package
* go fmt
* Adds generated files for new step
* Reverts changes for http tests, causing problems with go1.15, changes need to be applied for newer go version >=1.17
* Adjusts test for sonarExecuteScan
* Adjusts test for sonarExecuteScan
* Adds explanation for customreportingConfig
* Makes disableing of customSend more obvious
* Adds custom step reporting to each step, updates generated files, adjusts helper testdata
* fixes unit test wrong usage of logging
* Send pipeline data altough there has been no error, adjust test cases
* Reverts changes for customReporting
* Updates generated files, removes customReporting
* Removes writing errorDetails to CPE
* Reverts usage of customreporting
* go fmt
* reverts changes in http_test
* reverts changes in http_test
* Skips integration cnb test
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-11-18 18:50:03 +02:00
stepTelemetryData . Duration = fmt . Sprintf ( "%v" , time . Since ( startTime ) . Milliseconds ( ) )
stepTelemetryData . ErrorCategory = log . GetErrorCategory ( ) . String ( )
stepTelemetryData . PiperCommitHash = GitCommit
telemetryClient . SetData ( & stepTelemetryData )
telemetryClient . Send ( )
2021-05-17 12:14:04 +02:00
if len ( GeneralConfig . HookConfig . SplunkConfig . Dsn ) > 0 {
2023-07-14 15:19:57 +02:00
splunkClient . Initialize ( GeneralConfig . CorrelationID ,
GeneralConfig . HookConfig . SplunkConfig . Dsn ,
GeneralConfig . HookConfig . SplunkConfig . Token ,
GeneralConfig . HookConfig . SplunkConfig . Index ,
GeneralConfig . HookConfig . SplunkConfig . SendLogs )
splunkClient . Send ( telemetryClient . GetData ( ) , logCollector )
}
if len ( GeneralConfig . HookConfig . SplunkConfig . ProdCriblEndpoint ) > 0 {
splunkClient . Initialize ( GeneralConfig . CorrelationID ,
GeneralConfig . HookConfig . SplunkConfig . ProdCriblEndpoint ,
GeneralConfig . HookConfig . SplunkConfig . ProdCriblToken ,
GeneralConfig . HookConfig . SplunkConfig . ProdCriblIndex ,
GeneralConfig . HookConfig . SplunkConfig . SendLogs )
Changes for Pipeline Reporting (#3213)
* Adds GetLog() function to orchestrator
* Fixes BUILD_NUMBER env variable
* Fixes correct env var for JENKINS_HOME
* Adds getEnv to read env variables with default value, adds test for jenkins GetLog() implementation
* Adds possibility to read errorJsons; updates splunk package for log files (WIP)
* Uncommenting dev code
* Adds GetLog() function to orchestrator
* Fixes BUILD_NUMBER env variable
* Fixes correct env var for JENKINS_HOME
* Adds getEnv to read env variables with default value, adds test for jenkins GetLog() implementation
* Adds possibility to read errorJsons; updates splunk package for log files (WIP)
* Uncommenting dev code
* Adds GetRequest function which holds the response in memory (not saved to disk)
* Implements GetLog() function for ADO, adds function to read PipelineRuntime
* PAT has been revoked
* Changes http package, s.t. if password only is required basic auth works too
* Adds env variable for azure token, error handling in case of unauthenticated/nil response
* Adds logging output in case env variable can not be read and fallback variable needs to be used
* Adds usage of environment variables for auth, uses jenkins api
* Adds init functionality for orchestrators, updates GetLog() and GetPipelineStartTime() function
* Adds initaliziation function for orchestrator authetnication
* Adds settings struct for orchestrator authentication
* Adds function to whole logfile to Splunk
* Struct for pipeline related telemetry information
* Increase messagebatch size to 10k
* Changes splunk package to a pointer based implementation, updates generated files and corresponding template and tests for splunk
* Changes telemetry package to pointer based implementation to have multiple telemetry objects, adjusted tests and splunk implementation
* Changes content type to txt
* Send telemetry independent of logfiles, increases amount of messages per file
* Adds JobURL for orchestrators and UnknownOrchestrator as fallback
* telemetry makes use of orchestrator specific information
* Adds orchestrator independent correlationID
* Adds custom fields for pipeline status
* go fmt
* Removes env var test - no env variables are read anymore
* Use UnknownOrchestratorConfigProvider in case the orchestrator can not be initalized
* Removes Custom fields from telemetry as these can not be reflected in SWA
* Adds custom telemetry information (piperHash,..) to each step telemetry information
* Removes falltrough in case no orchestrator has been found
* Updates tests for orchestrator package
* Adds orchestrator import in generated files
* Updates generator files for internal library
* Adds orchestrator telemetry information to steps
* Updates generated files, fatalHook writes to cpe
* Go generate from master, go fmt
* Adds Custom Data field LastErrorCode
* Removes GetLog() test
* Update init_unix.go
* Update docker_integration_test_executor.go
* Update integration_api_cli_test.go
* Reverts go1.17 fmt formatting
* Reverts go1.17 fmt formatting
* Reverts go1.17 fmt formatting
* Renames customTelemetryData to stepTelemetryData
* Adjustments to orchestrator-package, cleanup, adds JobName
* Adjusts commonPipelineEnvironment path
* Adds pipelineTelemetry struct to telemetry package, removes pipeline telemetry structs from splunk package
* Go fmt
* Changes path for errorDetails, adds debug information
* Removes custom fields from step, adds orchestrator, commithash to baseMetadata
* Adjusts tests for telemetry package
* Adds tests for orchestrator
* Updates generated files, initalization of splunk client only if its available in the config
* Fixes typo in helper go
* Update pkg/http/downloader.go
* Update pkg/http/downloader.go
* Update pkg/log/fatalHook.go
* Update fatalHook.go
* Update pkg/splunk/splunk.go
* Update pkg/telemetry/data.go
* Adds GetBuildStatus() and GetAPIInformation() to orchestrators
* error formatting
* Bugfix: dont send telemetry data if disabled, adjusts test
* go fmt
* Use correct error handling
* Update pkg/telemetry/telemetry.go
* Fixes telemetry disabled in the tests
* Fixes http tests
* Log fatal errors to logFile
* Adds CustomReportingConfig to hooks
* Cleanup comments in splunk package
* Adds possibility to send telemetry to custom endpoint
* Adds debug output for the payload
* Debug output for the payload as a string
* Adds test cases for changes in telemetry package
* go fmt
* Adds generated files for new step
* Reverts changes for http tests, causing problems with go1.15, changes need to be applied for newer go version >=1.17
* Adjusts test for sonarExecuteScan
* Adjusts test for sonarExecuteScan
* Adds explanation for customreportingConfig
* Makes disableing of customSend more obvious
* Adds custom step reporting to each step, updates generated files, adjusts helper testdata
* fixes unit test wrong usage of logging
* Send pipeline data altough there has been no error, adjust test cases
* Reverts changes for customReporting
* Updates generated files, removes customReporting
* Removes writing errorDetails to CPE
* Reverts usage of customreporting
* go fmt
* reverts changes in http_test
* reverts changes in http_test
* Skips integration cnb test
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-11-18 18:50:03 +02:00
splunkClient . Send ( telemetryClient . GetData ( ) , logCollector )
2021-05-17 12:14:04 +02:00
}
2020-05-25 19:48:59 +02:00
}
log . DeferExitHandler ( handler )
defer handler ( )
Changes for Pipeline Reporting (#3213)
* Adds GetLog() function to orchestrator
* Fixes BUILD_NUMBER env variable
* Fixes correct env var for JENKINS_HOME
* Adds getEnv to read env variables with default value, adds test for jenkins GetLog() implementation
* Adds possibility to read errorJsons; updates splunk package for log files (WIP)
* Uncommenting dev code
* Adds GetLog() function to orchestrator
* Fixes BUILD_NUMBER env variable
* Fixes correct env var for JENKINS_HOME
* Adds getEnv to read env variables with default value, adds test for jenkins GetLog() implementation
* Adds possibility to read errorJsons; updates splunk package for log files (WIP)
* Uncommenting dev code
* Adds GetRequest function which holds the response in memory (not saved to disk)
* Implements GetLog() function for ADO, adds function to read PipelineRuntime
* PAT has been revoked
* Changes http package, s.t. if password only is required basic auth works too
* Adds env variable for azure token, error handling in case of unauthenticated/nil response
* Adds logging output in case env variable can not be read and fallback variable needs to be used
* Adds usage of environment variables for auth, uses jenkins api
* Adds init functionality for orchestrators, updates GetLog() and GetPipelineStartTime() function
* Adds initaliziation function for orchestrator authetnication
* Adds settings struct for orchestrator authentication
* Adds function to whole logfile to Splunk
* Struct for pipeline related telemetry information
* Increase messagebatch size to 10k
* Changes splunk package to a pointer based implementation, updates generated files and corresponding template and tests for splunk
* Changes telemetry package to pointer based implementation to have multiple telemetry objects, adjusted tests and splunk implementation
* Changes content type to txt
* Send telemetry independent of logfiles, increases amount of messages per file
* Adds JobURL for orchestrators and UnknownOrchestrator as fallback
* telemetry makes use of orchestrator specific information
* Adds orchestrator independent correlationID
* Adds custom fields for pipeline status
* go fmt
* Removes env var test - no env variables are read anymore
* Use UnknownOrchestratorConfigProvider in case the orchestrator can not be initalized
* Removes Custom fields from telemetry as these can not be reflected in SWA
* Adds custom telemetry information (piperHash,..) to each step telemetry information
* Removes falltrough in case no orchestrator has been found
* Updates tests for orchestrator package
* Adds orchestrator import in generated files
* Updates generator files for internal library
* Adds orchestrator telemetry information to steps
* Updates generated files, fatalHook writes to cpe
* Go generate from master, go fmt
* Adds Custom Data field LastErrorCode
* Removes GetLog() test
* Update init_unix.go
* Update docker_integration_test_executor.go
* Update integration_api_cli_test.go
* Reverts go1.17 fmt formatting
* Reverts go1.17 fmt formatting
* Reverts go1.17 fmt formatting
* Renames customTelemetryData to stepTelemetryData
* Adjustments to orchestrator-package, cleanup, adds JobName
* Adjusts commonPipelineEnvironment path
* Adds pipelineTelemetry struct to telemetry package, removes pipeline telemetry structs from splunk package
* Go fmt
* Changes path for errorDetails, adds debug information
* Removes custom fields from step, adds orchestrator, commithash to baseMetadata
* Adjusts tests for telemetry package
* Adds tests for orchestrator
* Updates generated files, initalization of splunk client only if its available in the config
* Fixes typo in helper go
* Update pkg/http/downloader.go
* Update pkg/http/downloader.go
* Update pkg/log/fatalHook.go
* Update fatalHook.go
* Update pkg/splunk/splunk.go
* Update pkg/telemetry/data.go
* Adds GetBuildStatus() and GetAPIInformation() to orchestrators
* error formatting
* Bugfix: dont send telemetry data if disabled, adjusts test
* go fmt
* Use correct error handling
* Update pkg/telemetry/telemetry.go
* Fixes telemetry disabled in the tests
* Fixes http tests
* Log fatal errors to logFile
* Adds CustomReportingConfig to hooks
* Cleanup comments in splunk package
* Adds possibility to send telemetry to custom endpoint
* Adds debug output for the payload
* Debug output for the payload as a string
* Adds test cases for changes in telemetry package
* go fmt
* Adds generated files for new step
* Reverts changes for http tests, causing problems with go1.15, changes need to be applied for newer go version >=1.17
* Adjusts test for sonarExecuteScan
* Adjusts test for sonarExecuteScan
* Adds explanation for customreportingConfig
* Makes disableing of customSend more obvious
* Adds custom step reporting to each step, updates generated files, adjusts helper testdata
* fixes unit test wrong usage of logging
* Send pipeline data altough there has been no error, adjust test cases
* Reverts changes for customReporting
* Updates generated files, removes customReporting
* Removes writing errorDetails to CPE
* Reverts usage of customreporting
* go fmt
* reverts changes in http_test
* reverts changes in http_test
* Skips integration cnb test
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-11-18 18:50:03 +02:00
telemetryClient . Initialize ( GeneralConfig . NoTelemetry , STEP_NAME )
fortifyExecuteScan ( stepConfig , & stepTelemetryData , & influx )
stepTelemetryData . ErrorCode = "0"
2020-05-25 19:48:59 +02:00
log . Entry ( ) . Info ( "SUCCESS" )
} ,
}
addFortifyExecuteScanFlags ( createFortifyExecuteScanCmd , & stepConfig )
return createFortifyExecuteScanCmd
}
func addFortifyExecuteScanFlags ( cmd * cobra . Command , stepConfig * fortifyExecuteScanOptions ) {
2021-03-09 14:16:21 +02:00
cmd . Flags ( ) . StringSliceVar ( & stepConfig . AdditionalScanParameters , "additionalScanParameters" , [ ] string { } , "List of additional scan parameters to be used for Fortify sourceanalyzer command execution." )
2022-11-07 13:17:11 +02:00
cmd . Flags ( ) . StringSliceVar ( & stepConfig . AdditionalMvnParameters , "additionalMvnParameters" , [ ] string { } , "List of additional maven parameters to be used for Fortify mvn command execution." )
2022-01-27 11:45:45 +02:00
cmd . Flags ( ) . StringSliceVar ( & stepConfig . Assignees , "assignees" , [ ] string { ` ` } , "Defines the assignees for the Github Issue created/updated with the results of the scan as a list of login names." )
2020-05-25 19:48:59 +02:00
cmd . Flags ( ) . StringVar ( & stepConfig . AuthToken , "authToken" , os . Getenv ( "PIPER_authToken" ) , "The FortifyToken to use for authentication" )
2021-06-28 12:40:20 +02:00
cmd . Flags ( ) . StringSliceVar ( & stepConfig . BuildDescriptorExcludeList , "buildDescriptorExcludeList" , [ ] string { ` unit-tests/pom.xml ` , ` integration-tests/pom.xml ` } , "List of build descriptors and therefore modules to exclude from the scan and assessment activities." )
2021-02-26 14:43:03 +02:00
cmd . Flags ( ) . StringVar ( & stepConfig . CustomScanVersion , "customScanVersion" , os . Getenv ( "PIPER_customScanVersion" ) , "Custom version of the Fortify project used as source." )
2020-05-25 19:48:59 +02:00
cmd . Flags ( ) . StringVar ( & stepConfig . GithubToken , "githubToken" , os . Getenv ( "PIPER_githubToken" ) , "GitHub personal access token as per https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line" )
cmd . Flags ( ) . BoolVar ( & stepConfig . AutoCreate , "autoCreate" , false , "Whether Fortify project and project version shall be implicitly auto created in case they cannot be found in the backend" )
cmd . Flags ( ) . StringVar ( & stepConfig . ModulePath , "modulePath" , ` ./ ` , "Allows providing the path for the module to scan" )
cmd . Flags ( ) . StringVar ( & stepConfig . PythonRequirementsFile , "pythonRequirementsFile" , os . Getenv ( "PIPER_pythonRequirementsFile" ) , "The requirements file used in `buildTool: 'pip'` to populate the build environment with the necessary dependencies" )
cmd . Flags ( ) . BoolVar ( & stepConfig . AutodetectClasspath , "autodetectClasspath" , true , "Whether the classpath is automatically determined via build tool i.e. maven or pip or not at all" )
cmd . Flags ( ) . StringVar ( & stepConfig . MustAuditIssueGroups , "mustAuditIssueGroups" , ` Corporate Security Requirements, Audit All ` , "Comma separated list of issue groups that must be audited completely" )
cmd . Flags ( ) . StringVar ( & stepConfig . SpotAuditIssueGroups , "spotAuditIssueGroups" , ` Spot Checks of Each Category ` , "Comma separated list of issue groups that are spot checked and for which `spotCheckMinimum` audited issues are enforced" )
cmd . Flags ( ) . StringVar ( & stepConfig . PythonRequirementsInstallSuffix , "pythonRequirementsInstallSuffix" , os . Getenv ( "PIPER_pythonRequirementsInstallSuffix" ) , "The suffix for the command used to install the requirements file in `buildTool: 'pip'` to populate the build environment with the necessary dependencies" )
cmd . Flags ( ) . StringVar ( & stepConfig . PythonVersion , "pythonVersion" , ` python3 ` , "Python version to be used in `buildTool: 'pip'`" )
cmd . Flags ( ) . BoolVar ( & stepConfig . UploadResults , "uploadResults" , true , "Whether results shall be uploaded or not" )
2021-02-26 14:43:03 +02:00
cmd . Flags ( ) . StringVar ( & stepConfig . Version , "version" , os . Getenv ( "PIPER_version" ) , "Version used in conjunction with [`versioningModel`](#versioningModel) to identify the Fortify project to be created and used for results aggregation." )
2020-09-22 17:39:40 +02:00
cmd . Flags ( ) . StringVar ( & stepConfig . BuildDescriptorFile , "buildDescriptorFile" , ` ./pom.xml ` , "Path to the build descriptor file addressing the module/folder to be scanned." )
2020-05-25 19:48:59 +02:00
cmd . Flags ( ) . StringVar ( & stepConfig . CommitID , "commitId" , os . Getenv ( "PIPER_commitId" ) , "Set the Git commit ID for identifying artifacts throughout the scan." )
cmd . Flags ( ) . StringVar ( & stepConfig . CommitMessage , "commitMessage" , os . Getenv ( "PIPER_commitMessage" ) , "Set the Git commit message for identifying pull request merges throughout the scan." )
2020-06-02 13:47:07 +02:00
cmd . Flags ( ) . StringVar ( & stepConfig . GithubAPIURL , "githubApiUrl" , ` https://api.github.com ` , "Set the GitHub API URL." )
2020-05-25 19:48:59 +02:00
cmd . Flags ( ) . StringVar ( & stepConfig . Owner , "owner" , os . Getenv ( "PIPER_owner" ) , "Set the GitHub organization." )
cmd . Flags ( ) . StringVar ( & stepConfig . Repository , "repository" , os . Getenv ( "PIPER_repository" ) , "Set the GitHub repository." )
cmd . Flags ( ) . StringVar ( & stepConfig . Memory , "memory" , ` -Xmx4G -Xms512M ` , "The amount of memory granted to the translate/scan executions" )
cmd . Flags ( ) . BoolVar ( & stepConfig . UpdateRulePack , "updateRulePack" , true , "Whether the rule pack shall be updated and pulled from Fortify SSC before scanning or not" )
cmd . Flags ( ) . StringVar ( & stepConfig . ReportDownloadEndpoint , "reportDownloadEndpoint" , ` /transfer/reportDownload.html ` , "Fortify SSC endpoint for Report downloads" )
2020-06-02 13:47:07 +02:00
cmd . Flags ( ) . IntVar ( & stepConfig . PollingMinutes , "pollingMinutes" , 30 , "The number of minutes for which an uploaded FPR artifact''s status is being polled to finish queuing/processing, if exceeded polling will be stopped and an error will be thrown" )
2020-05-25 19:48:59 +02:00
cmd . Flags ( ) . BoolVar ( & stepConfig . QuickScan , "quickScan" , false , "Whether a quick scan should be performed, please consult the related Fortify documentation on JAM on the impact of this setting" )
2020-05-27 11:45:01 +02:00
cmd . Flags ( ) . StringVar ( & stepConfig . Translate , "translate" , os . Getenv ( "PIPER_translate" ) , "Options for translate phase of Fortify. Most likely, you do not need to set this parameter. See src, exclude. If `'src'` and `'exclude'` are set they are automatically used. Technical details: It has to be a JSON string of list of maps with required key `'src'`, and optional keys `'exclude'`, `'libDirs'`, `'aspnetcore'`, and `'dotNetCoreVersion'`" )
2022-08-04 16:20:14 +02:00
cmd . Flags ( ) . StringSliceVar ( & stepConfig . Src , "src" , [ ] string { } , "A list of source directories to scan. Wildcards can be used, e.g., `'src/main/java/**/*'`. If `'translate'` is set, this will ignored. The default value for `buildTool: 'maven'` is `['**/*.xml', '**/*.html', '**/*.jsp', '**/*.js', '**/src/main/resources/**/*', '**/src/main/java/**/*', '**/src/gen/java/cds/**/*', '**/target/main/java/**/*', '**/target/main/resources/**/*', '**/target/generated-sources/**/*']`, for `buildTool: 'pip'` it is `['./**/*']`." )
2021-07-09 10:19:42 +02:00
cmd . Flags ( ) . StringSliceVar ( & stepConfig . Exclude , "exclude" , [ ] string { } , "A list of directories/files to be excluded from the scan. Wildcards can be used, e.g., `'**/Test.java'`. If `translate` is set, this will ignored. The default value for `buildTool: 'maven'` is `['**/src/test/**/*']`, for `buildTool: 'pip'` it is `['./**/tests/**/*', './**/setup.py']`." )
2020-05-25 19:48:59 +02:00
cmd . Flags ( ) . StringVar ( & stepConfig . APIEndpoint , "apiEndpoint" , ` /api/v1 ` , "Fortify SSC endpoint used for uploading the scan results and checking the audit state" )
cmd . Flags ( ) . StringVar ( & stepConfig . ReportType , "reportType" , ` PDF ` , "The type of report to be generated" )
2020-06-02 13:47:07 +02:00
cmd . Flags ( ) . StringSliceVar ( & stepConfig . PythonAdditionalPath , "pythonAdditionalPath" , [ ] string { ` ./lib ` , ` . ` } , "A list of additional paths which can be used in `buildTool: 'pip'` for customization purposes" )
cmd . Flags ( ) . StringVar ( & stepConfig . ArtifactURL , "artifactUrl" , os . Getenv ( "PIPER_artifactUrl" ) , "Path/URL pointing to an additional artifact repository for resolution of additional artifacts during the build" )
2020-05-25 19:48:59 +02:00
cmd . Flags ( ) . BoolVar ( & stepConfig . ConsiderSuspicious , "considerSuspicious" , true , "Whether suspicious issues should trigger the check to fail or not" )
2022-10-17 14:09:02 +02:00
cmd . Flags ( ) . BoolVar ( & stepConfig . ConvertToSarif , "convertToSarif" , true , "Convert the proprietary format of Fortify scan results to the open SARIF standard." )
2020-05-25 19:48:59 +02:00
cmd . Flags ( ) . StringVar ( & stepConfig . FprUploadEndpoint , "fprUploadEndpoint" , ` /upload/resultFileUpload.html ` , "Fortify SSC endpoint for FPR uploads" )
cmd . Flags ( ) . StringVar ( & stepConfig . ProjectName , "projectName" , ` {{ list .GroupID .ArtifactID | join "-" | trimAll "-" }} ` , "The project used for reporting results in SSC" )
cmd . Flags ( ) . BoolVar ( & stepConfig . Reporting , "reporting" , false , "Influences whether a report is generated or not" )
cmd . Flags ( ) . StringVar ( & stepConfig . ServerURL , "serverUrl" , os . Getenv ( "PIPER_serverUrl" ) , "Fortify SSC Url to be used for accessing the APIs" )
2020-06-02 13:47:07 +02:00
cmd . Flags ( ) . IntVar ( & stepConfig . PullRequestMessageRegexGroup , "pullRequestMessageRegexGroup" , 1 , "The group number for extracting the pull request id in `'pullRequestMessageRegex'`" )
2020-05-25 19:48:59 +02:00
cmd . Flags ( ) . IntVar ( & stepConfig . DeltaMinutes , "deltaMinutes" , 5 , "The number of minutes for which an uploaded FPR artifact is considered to be recent and healthy, if exceeded an error will be thrown" )
2022-08-01 23:06:05 +02:00
cmd . Flags ( ) . IntVar ( & stepConfig . SpotCheckMinimum , "spotCheckMinimum" , 1 , "The minimum number/percentage of issues that must be audited per category in the `Spot Checks of each Category` folder to avoid an error being thrown" )
cmd . Flags ( ) . StringVar ( & stepConfig . SpotCheckMinimumUnit , "spotCheckMinimumUnit" , ` number ` , "The unit for the spotCheckMinimum to apply." )
2022-08-09 15:26:07 +02:00
cmd . Flags ( ) . IntVar ( & stepConfig . SpotCheckMaximum , "spotCheckMaximum" , 0 , "The maximum number of issues that must be audited per category in the `Spot Checks of each Category` folder to avoid an error being thrown. Note that this flag depends on the result of spotCheckMinimum. For example if spotCheckMinimum percentage value exceeds spotCheckMaximum then spotCheckMaximum will be considerd else spotCheckMinimum is considered. If value is less than one, this flag will be ignored." )
2020-06-02 13:47:07 +02:00
cmd . Flags ( ) . StringVar ( & stepConfig . FprDownloadEndpoint , "fprDownloadEndpoint" , ` /download/currentStateFprDownload.html ` , "Fortify SSC endpoint for FPR downloads" )
2020-07-27 12:01:59 +02:00
cmd . Flags ( ) . StringVar ( & stepConfig . VersioningModel , "versioningModel" , ` major ` , "The default project versioning model used for creating the version based on the build descriptor version to report results in SSC, can be one of `'major'`, `'major-minor'`, `'semantic'`, `'full'`" )
2020-05-25 19:48:59 +02:00
cmd . Flags ( ) . StringVar ( & stepConfig . PythonInstallCommand , "pythonInstallCommand" , ` {{ .Pip }} install --user . ` , "Additional install command that can be run when `buildTool: 'pip'` is used which allows further customizing the execution environment of the scan" )
cmd . Flags ( ) . IntVar ( & stepConfig . ReportTemplateID , "reportTemplateId" , 18 , "Report template ID to be used for generating the Fortify report" )
cmd . Flags ( ) . StringVar ( & stepConfig . FilterSetTitle , "filterSetTitle" , ` SAP ` , "Title of the filter set to use for analysing the results" )
cmd . Flags ( ) . StringVar ( & stepConfig . PullRequestName , "pullRequestName" , os . Getenv ( "PIPER_pullRequestName" ) , "The name of the pull request branch which will trigger creation of a new version in Fortify SSC based on the master branch version" )
cmd . Flags ( ) . StringVar ( & stepConfig . PullRequestMessageRegex , "pullRequestMessageRegex" , ` .*Merge pull request #(\\d+) from.* ` , "Regex used to identify the PR-XXX reference within the merge commit message" )
2022-02-28 12:35:38 +02:00
cmd . Flags ( ) . StringVar ( & stepConfig . BuildTool , "buildTool" , ` maven ` , "Scan type used for the step which can be `'maven'`, `'pip'` or `'gradle'`" )
2020-05-29 15:42:35 +02:00
cmd . Flags ( ) . StringVar ( & stepConfig . ProjectSettingsFile , "projectSettingsFile" , os . Getenv ( "PIPER_projectSettingsFile" ) , "Path to the mvn settings file that should be used as project settings file." )
2023-08-31 13:48:18 +02:00
cmd . Flags ( ) . StringVar ( & stepConfig . Proxy , "proxy" , os . Getenv ( "PIPER_proxy" ) , "Proxy URL to be used for communication with the Fortify instance." )
2020-05-29 15:42:35 +02:00
cmd . Flags ( ) . StringVar ( & stepConfig . GlobalSettingsFile , "globalSettingsFile" , os . Getenv ( "PIPER_globalSettingsFile" ) , "Path to the mvn settings file that should be used as global settings file." )
cmd . Flags ( ) . StringVar ( & stepConfig . M2Path , "m2Path" , os . Getenv ( "PIPER_m2Path" ) , "Path to the location of the local repository that should be used." )
2020-09-18 08:19:34 +02:00
cmd . Flags ( ) . BoolVar ( & stepConfig . VerifyOnly , "verifyOnly" , false , "Whether the step shall only apply verification checks or whether it does a full scan and check cycle" )
2020-11-16 11:29:21 +02:00
cmd . Flags ( ) . BoolVar ( & stepConfig . InstallArtifacts , "installArtifacts" , false , "If enabled, it will install all artifacts to the local maven repository to make them available before running Fortify. This is required if any maven module has dependencies to other modules in the repository and they were not installed before." )
2022-03-30 12:20:51 +02:00
cmd . Flags ( ) . BoolVar ( & stepConfig . CreateResultIssue , "createResultIssue" , false , "Activate creation of a result issue in GitHub." )
2020-05-25 19:48:59 +02:00
cmd . MarkFlagRequired ( "authToken" )
2022-02-23 16:16:05 +02:00
cmd . Flags ( ) . MarkDeprecated ( "pythonAdditionalPath" , "this is deprecated" )
2020-07-30 09:13:46 +02:00
cmd . MarkFlagRequired ( "serverUrl" )
2020-05-25 19:48:59 +02:00
}
// retrieve step metadata
func fortifyExecuteScanMetadata ( ) config . StepData {
var theMetaData = config . StepData {
Metadata : config . StepMetadata {
2020-11-20 09:13:59 +02:00
Name : "fortifyExecuteScan" ,
Aliases : [ ] config . Alias { } ,
Description : "This step executes a Fortify scan on the specified project to perform static code analysis and check the source code for security flaws." ,
2020-05-25 19:48:59 +02:00
} ,
Spec : config . StepSpec {
Inputs : config . StepInputs {
2021-06-16 08:43:30 +02:00
Secrets : [ ] config . StepSecrets {
{ Name : "fortifyCredentialsId" , Description : "Jenkins 'Secret text' credentials ID containing token to authenticate to Fortify SSC." , Type : "jenkins" } ,
{ Name : "githubTokenCredentialsId" , Description : "Jenkins 'Secret text' credentials ID containing token to authenticate to GitHub." , Type : "jenkins" } ,
} ,
2021-03-01 14:03:42 +02:00
Resources : [ ] config . StepResources {
{ Name : "commonPipelineEnvironment" } ,
{ Name : "buildDescriptor" , Type : "stash" } ,
{ Name : "deployDescriptor" , Type : "stash" } ,
{ Name : "tests" , Type : "stash" } ,
{ Name : "opensourceConfiguration" , Type : "stash" } ,
} ,
2020-05-25 19:48:59 +02:00
Parameters : [ ] config . StepParameters {
2021-03-09 14:16:21 +02:00
{
Name : "additionalScanParameters" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "[]string" ,
Mandatory : false ,
Aliases : [ ] config . Alias { } ,
2021-06-16 08:43:30 +02:00
Default : [ ] string { } ,
2021-03-09 14:16:21 +02:00
} ,
2022-11-07 13:17:11 +02:00
{
Name : "additionalMvnParameters" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "[]string" ,
Mandatory : false ,
Aliases : [ ] config . Alias { } ,
Default : [ ] string { } ,
} ,
2022-01-21 11:52:17 +02:00
{
Name : "assignees" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "[]string" ,
Mandatory : false ,
Aliases : [ ] config . Alias { } ,
Default : [ ] string { ` ` } ,
} ,
2020-05-25 19:48:59 +02:00
{
2020-09-16 14:50:09 +02:00
Name : "authToken" ,
ResourceRef : [ ] config . ResourceReference {
{
Name : "fortifyCredentialsId" ,
Type : "secret" ,
} ,
2020-10-13 14:14:47 +02:00
{
2021-09-21 13:06:32 +02:00
Name : "fortifyVaultSecretName" ,
Type : "vaultSecret" ,
Default : "fortify" ,
2020-10-13 14:14:47 +02:00
} ,
2020-09-16 14:50:09 +02:00
} ,
Scope : [ ] string { "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "string" ,
Mandatory : true ,
Aliases : [ ] config . Alias { } ,
2021-06-16 08:43:30 +02:00
Default : os . Getenv ( "PIPER_authToken" ) ,
2020-05-25 19:48:59 +02:00
} ,
2021-06-28 12:40:20 +02:00
{
Name : "buildDescriptorExcludeList" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "[]string" ,
Mandatory : false ,
Aliases : [ ] config . Alias { } ,
Default : [ ] string { ` unit-tests/pom.xml ` , ` integration-tests/pom.xml ` } ,
} ,
2021-02-26 14:43:03 +02:00
{
Name : "customScanVersion" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "GENERAL" , "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "string" ,
Mandatory : false ,
Aliases : [ ] config . Alias { } ,
2021-06-16 08:43:30 +02:00
Default : os . Getenv ( "PIPER_customScanVersion" ) ,
2021-02-26 14:43:03 +02:00
} ,
2020-05-25 19:48:59 +02:00
{
2020-09-16 14:50:09 +02:00
Name : "githubToken" ,
ResourceRef : [ ] config . ResourceReference {
{
Name : "githubTokenCredentialsId" ,
Type : "secret" ,
} ,
2020-12-22 18:57:11 +02:00
{
2021-09-21 13:06:32 +02:00
Name : "githubVaultSecretName" ,
Type : "vaultSecret" ,
Default : "github" ,
2020-12-22 18:57:11 +02:00
} ,
2020-09-16 14:50:09 +02:00
} ,
Scope : [ ] string { "GENERAL" , "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "string" ,
Mandatory : false ,
2021-01-27 13:58:47 +02:00
Aliases : [ ] config . Alias { { Name : "access_token" } } ,
2021-06-16 08:43:30 +02:00
Default : os . Getenv ( "PIPER_githubToken" ) ,
2020-05-25 19:48:59 +02:00
} ,
{
Name : "autoCreate" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "bool" ,
Mandatory : false ,
Aliases : [ ] config . Alias { } ,
2021-06-16 08:43:30 +02:00
Default : false ,
2020-05-25 19:48:59 +02:00
} ,
{
Name : "modulePath" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "string" ,
Mandatory : false ,
Aliases : [ ] config . Alias { } ,
2021-06-16 08:43:30 +02:00
Default : ` ./ ` ,
2020-05-25 19:48:59 +02:00
} ,
{
Name : "pythonRequirementsFile" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "string" ,
Mandatory : false ,
Aliases : [ ] config . Alias { } ,
2021-06-16 08:43:30 +02:00
Default : os . Getenv ( "PIPER_pythonRequirementsFile" ) ,
2020-05-25 19:48:59 +02:00
} ,
{
Name : "autodetectClasspath" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "bool" ,
Mandatory : false ,
Aliases : [ ] config . Alias { } ,
2021-06-16 08:43:30 +02:00
Default : true ,
2020-05-25 19:48:59 +02:00
} ,
{
Name : "mustAuditIssueGroups" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "string" ,
Mandatory : false ,
Aliases : [ ] config . Alias { } ,
2021-06-16 08:43:30 +02:00
Default : ` Corporate Security Requirements, Audit All ` ,
2020-05-25 19:48:59 +02:00
} ,
{
Name : "spotAuditIssueGroups" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "string" ,
Mandatory : false ,
Aliases : [ ] config . Alias { } ,
2021-06-16 08:43:30 +02:00
Default : ` Spot Checks of Each Category ` ,
2020-05-25 19:48:59 +02:00
} ,
{
Name : "pythonRequirementsInstallSuffix" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "string" ,
Mandatory : false ,
Aliases : [ ] config . Alias { } ,
2021-06-16 08:43:30 +02:00
Default : os . Getenv ( "PIPER_pythonRequirementsInstallSuffix" ) ,
2020-05-25 19:48:59 +02:00
} ,
{
Name : "pythonVersion" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "GENERAL" , "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "string" ,
Mandatory : false ,
Aliases : [ ] config . Alias { } ,
2021-06-16 08:43:30 +02:00
Default : ` python3 ` ,
2020-05-25 19:48:59 +02:00
} ,
{
Name : "uploadResults" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "bool" ,
Mandatory : false ,
Aliases : [ ] config . Alias { } ,
2021-06-16 08:43:30 +02:00
Default : true ,
2020-05-25 19:48:59 +02:00
} ,
2021-02-26 14:43:03 +02:00
{
Name : "version" ,
ResourceRef : [ ] config . ResourceReference {
{
Name : "commonPipelineEnvironment" ,
Param : "artifactVersion" ,
} ,
} ,
Scope : [ ] string { "GENERAL" , "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "string" ,
Mandatory : false ,
2021-11-23 16:37:28 +02:00
Aliases : [ ] config . Alias { { Name : "fortifyProjectVersion" , Deprecated : true } } ,
2021-06-16 08:43:30 +02:00
Default : os . Getenv ( "PIPER_version" ) ,
2021-02-26 14:43:03 +02:00
} ,
2020-05-25 19:48:59 +02:00
{
Name : "buildDescriptorFile" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "string" ,
Mandatory : false ,
Aliases : [ ] config . Alias { } ,
2021-06-16 08:43:30 +02:00
Default : ` ./pom.xml ` ,
Conditions : [ ] config . Condition { { ConditionRef : "strings-equal" , Params : [ ] config . Param { { Name : "buildTool" , Value : "maven" } } } } ,
2020-05-25 19:48:59 +02:00
} ,
2020-09-22 17:39:40 +02:00
{
Name : "buildDescriptorFile" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "string" ,
Mandatory : false ,
Aliases : [ ] config . Alias { } ,
2021-06-16 08:43:30 +02:00
Default : ` ./setup.py ` ,
Conditions : [ ] config . Condition { { ConditionRef : "strings-equal" , Params : [ ] config . Param { { Name : "buildTool" , Value : "pip" } } } } ,
2020-09-22 17:39:40 +02:00
} ,
2022-02-28 12:35:38 +02:00
{
Name : "buildDescriptorFile" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "string" ,
Mandatory : false ,
Aliases : [ ] config . Alias { } ,
Default : ` ./build.gradle ` ,
Conditions : [ ] config . Condition { { ConditionRef : "strings-equal" , Params : [ ] config . Param { { Name : "buildTool" , Value : "gradle" } } } } ,
} ,
2020-05-25 19:48:59 +02:00
{
2020-09-16 14:50:09 +02:00
Name : "commitId" ,
ResourceRef : [ ] config . ResourceReference {
{
Name : "commonPipelineEnvironment" ,
Param : "git/commitId" ,
} ,
} ,
Scope : [ ] string { "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "string" ,
Mandatory : false ,
Aliases : [ ] config . Alias { } ,
2021-06-16 08:43:30 +02:00
Default : os . Getenv ( "PIPER_commitId" ) ,
2020-05-25 19:48:59 +02:00
} ,
{
2020-09-16 14:50:09 +02:00
Name : "commitMessage" ,
ResourceRef : [ ] config . ResourceReference {
{
Name : "commonPipelineEnvironment" ,
Param : "git/commitMessage" ,
} ,
} ,
Scope : [ ] string { "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "string" ,
Mandatory : false ,
Aliases : [ ] config . Alias { } ,
2021-06-16 08:43:30 +02:00
Default : os . Getenv ( "PIPER_commitMessage" ) ,
2020-05-25 19:48:59 +02:00
} ,
{
Name : "githubApiUrl" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "GENERAL" , "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "string" ,
Mandatory : false ,
Aliases : [ ] config . Alias { } ,
2021-06-16 08:43:30 +02:00
Default : ` https://api.github.com ` ,
2020-05-25 19:48:59 +02:00
} ,
{
2020-09-16 14:50:09 +02:00
Name : "owner" ,
ResourceRef : [ ] config . ResourceReference {
{
Name : "commonPipelineEnvironment" ,
Param : "github/owner" ,
} ,
} ,
2022-02-17 16:16:55 +02:00
Scope : [ ] string { "GENERAL" , "PARAMETERS" , "STAGES" , "STEPS" } ,
2020-09-16 14:50:09 +02:00
Type : "string" ,
Mandatory : false ,
Aliases : [ ] config . Alias { { Name : "githubOrg" } } ,
2021-06-16 08:43:30 +02:00
Default : os . Getenv ( "PIPER_owner" ) ,
2020-05-25 19:48:59 +02:00
} ,
{
2020-09-16 14:50:09 +02:00
Name : "repository" ,
ResourceRef : [ ] config . ResourceReference {
{
Name : "commonPipelineEnvironment" ,
Param : "github/repository" ,
} ,
} ,
2022-02-17 16:16:55 +02:00
Scope : [ ] string { "GENERAL" , "PARAMETERS" , "STAGES" , "STEPS" } ,
2020-09-16 14:50:09 +02:00
Type : "string" ,
Mandatory : false ,
Aliases : [ ] config . Alias { { Name : "githubRepo" } } ,
2021-06-16 08:43:30 +02:00
Default : os . Getenv ( "PIPER_repository" ) ,
2020-05-25 19:48:59 +02:00
} ,
{
Name : "memory" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "string" ,
Mandatory : false ,
Aliases : [ ] config . Alias { } ,
2021-06-16 08:43:30 +02:00
Default : ` -Xmx4G -Xms512M ` ,
2020-05-25 19:48:59 +02:00
} ,
{
Name : "updateRulePack" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "bool" ,
Mandatory : false ,
Aliases : [ ] config . Alias { } ,
2021-06-16 08:43:30 +02:00
Default : true ,
2020-05-25 19:48:59 +02:00
} ,
{
Name : "reportDownloadEndpoint" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "GENERAL" , "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "string" ,
Mandatory : false ,
Aliases : [ ] config . Alias { { Name : "fortifyReportDownloadEndpoint" } } ,
2021-06-16 08:43:30 +02:00
Default : ` /transfer/reportDownload.html ` ,
2020-05-25 19:48:59 +02:00
} ,
{
Name : "pollingMinutes" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "int" ,
Mandatory : false ,
Aliases : [ ] config . Alias { } ,
2021-06-16 08:43:30 +02:00
Default : 30 ,
2020-05-25 19:48:59 +02:00
} ,
{
Name : "quickScan" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "bool" ,
Mandatory : false ,
Aliases : [ ] config . Alias { } ,
2021-06-16 08:43:30 +02:00
Default : false ,
2020-05-25 19:48:59 +02:00
} ,
{
Name : "translate" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "string" ,
Mandatory : false ,
Aliases : [ ] config . Alias { } ,
2021-06-16 08:43:30 +02:00
Default : os . Getenv ( "PIPER_translate" ) ,
2020-05-25 19:48:59 +02:00
} ,
2020-05-27 11:45:01 +02:00
{
Name : "src" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "PARAMETERS" , "STAGES" , "STEPS" } ,
2020-06-02 13:47:07 +02:00
Type : "[]string" ,
2020-05-27 11:45:01 +02:00
Mandatory : false ,
Aliases : [ ] config . Alias { } ,
2021-06-16 08:43:30 +02:00
Default : [ ] string { } ,
2020-05-27 11:45:01 +02:00
} ,
{
Name : "exclude" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "PARAMETERS" , "STAGES" , "STEPS" } ,
2020-06-02 13:47:07 +02:00
Type : "[]string" ,
2020-05-27 11:45:01 +02:00
Mandatory : false ,
Aliases : [ ] config . Alias { } ,
2021-06-16 08:43:30 +02:00
Default : [ ] string { } ,
2020-05-27 11:45:01 +02:00
} ,
2020-05-25 19:48:59 +02:00
{
Name : "apiEndpoint" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "GENERAL" , "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "string" ,
Mandatory : false ,
Aliases : [ ] config . Alias { { Name : "fortifyApiEndpoint" } } ,
2021-06-16 08:43:30 +02:00
Default : ` /api/v1 ` ,
2020-05-25 19:48:59 +02:00
} ,
{
Name : "reportType" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "string" ,
Mandatory : false ,
Aliases : [ ] config . Alias { } ,
2021-06-16 08:43:30 +02:00
Default : ` PDF ` ,
2020-05-25 19:48:59 +02:00
} ,
{
2022-02-23 16:16:05 +02:00
Name : "pythonAdditionalPath" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "[]string" ,
Mandatory : false ,
Aliases : [ ] config . Alias { } ,
Default : [ ] string { ` ./lib ` , ` . ` } ,
DeprecationMessage : "this is deprecated" ,
2020-05-25 19:48:59 +02:00
} ,
{
Name : "artifactUrl" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "string" ,
Mandatory : false ,
Aliases : [ ] config . Alias { } ,
2021-06-16 08:43:30 +02:00
Default : os . Getenv ( "PIPER_artifactUrl" ) ,
2020-05-25 19:48:59 +02:00
} ,
{
Name : "considerSuspicious" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "bool" ,
Mandatory : false ,
Aliases : [ ] config . Alias { } ,
2021-06-16 08:43:30 +02:00
Default : true ,
2020-05-25 19:48:59 +02:00
} ,
2022-02-08 15:10:40 +02:00
{
Name : "convertToSarif" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "bool" ,
Mandatory : false ,
Aliases : [ ] config . Alias { } ,
2022-10-17 14:09:02 +02:00
Default : true ,
2022-02-08 15:10:40 +02:00
} ,
2020-05-25 19:48:59 +02:00
{
Name : "fprUploadEndpoint" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "GENERAL" , "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "string" ,
Mandatory : false ,
Aliases : [ ] config . Alias { { Name : "fortifyFprUploadEndpoint" } } ,
2021-06-16 08:43:30 +02:00
Default : ` /upload/resultFileUpload.html ` ,
2020-05-25 19:48:59 +02:00
} ,
{
Name : "projectName" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "string" ,
Mandatory : false ,
Aliases : [ ] config . Alias { { Name : "fortifyProjectName" } } ,
2021-06-16 08:43:30 +02:00
Default : ` {{ list .GroupID .ArtifactID | join "-" | trimAll "-" }} ` ,
2020-05-25 19:48:59 +02:00
} ,
{
Name : "reporting" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "bool" ,
Mandatory : false ,
Aliases : [ ] config . Alias { } ,
2021-06-16 08:43:30 +02:00
Default : false ,
2020-05-25 19:48:59 +02:00
} ,
{
Name : "serverUrl" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "GENERAL" , "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "string" ,
2020-07-30 09:13:46 +02:00
Mandatory : true ,
2021-11-23 16:37:28 +02:00
Aliases : [ ] config . Alias { { Name : "fortifyServerUrl" } , { Name : "sscUrl" , Deprecated : true } } ,
2021-06-16 08:43:30 +02:00
Default : os . Getenv ( "PIPER_serverUrl" ) ,
2020-05-25 19:48:59 +02:00
} ,
{
Name : "pullRequestMessageRegexGroup" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "int" ,
Mandatory : false ,
Aliases : [ ] config . Alias { } ,
2021-06-16 08:43:30 +02:00
Default : 1 ,
2020-05-25 19:48:59 +02:00
} ,
{
Name : "deltaMinutes" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "int" ,
Mandatory : false ,
Aliases : [ ] config . Alias { } ,
2021-06-16 08:43:30 +02:00
Default : 5 ,
2020-05-25 19:48:59 +02:00
} ,
{
Name : "spotCheckMinimum" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "int" ,
Mandatory : false ,
Aliases : [ ] config . Alias { } ,
2021-06-16 08:43:30 +02:00
Default : 1 ,
2020-05-25 19:48:59 +02:00
} ,
2022-08-01 23:06:05 +02:00
{
Name : "spotCheckMinimumUnit" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "string" ,
Mandatory : false ,
Aliases : [ ] config . Alias { } ,
Default : ` number ` ,
} ,
{
2022-08-09 15:26:07 +02:00
Name : "spotCheckMaximum" ,
2022-08-01 23:06:05 +02:00
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "int" ,
Mandatory : false ,
Aliases : [ ] config . Alias { } ,
Default : 0 ,
} ,
2020-05-25 19:48:59 +02:00
{
Name : "fprDownloadEndpoint" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "GENERAL" , "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "string" ,
Mandatory : false ,
Aliases : [ ] config . Alias { { Name : "fortifyFprDownloadEndpoint" } } ,
2021-06-16 08:43:30 +02:00
Default : ` /download/currentStateFprDownload.html ` ,
2020-05-25 19:48:59 +02:00
} ,
{
2020-07-27 12:01:59 +02:00
Name : "versioningModel" ,
2020-05-25 19:48:59 +02:00
ResourceRef : [ ] config . ResourceReference { } ,
2020-07-27 12:01:59 +02:00
Scope : [ ] string { "PARAMETERS" , "GENERAL" , "STAGES" , "STEPS" } ,
2020-05-25 19:48:59 +02:00
Type : "string" ,
Mandatory : false ,
2021-11-23 16:37:28 +02:00
Aliases : [ ] config . Alias { { Name : "defaultVersioningModel" , Deprecated : true } } ,
2021-06-16 08:43:30 +02:00
Default : ` major ` ,
2020-05-25 19:48:59 +02:00
} ,
{
Name : "pythonInstallCommand" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "string" ,
Mandatory : false ,
Aliases : [ ] config . Alias { } ,
2021-06-16 08:43:30 +02:00
Default : ` {{ .Pip }} install --user . ` ,
2020-05-25 19:48:59 +02:00
} ,
{
Name : "reportTemplateId" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "int" ,
Mandatory : false ,
Aliases : [ ] config . Alias { } ,
2021-06-16 08:43:30 +02:00
Default : 18 ,
2020-05-25 19:48:59 +02:00
} ,
{
Name : "filterSetTitle" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "string" ,
Mandatory : false ,
Aliases : [ ] config . Alias { } ,
2021-06-16 08:43:30 +02:00
Default : ` SAP ` ,
2020-05-25 19:48:59 +02:00
} ,
{
Name : "pullRequestName" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "string" ,
Mandatory : false ,
Aliases : [ ] config . Alias { } ,
2021-06-16 08:43:30 +02:00
Default : os . Getenv ( "PIPER_pullRequestName" ) ,
2020-05-25 19:48:59 +02:00
} ,
{
Name : "pullRequestMessageRegex" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "string" ,
Mandatory : false ,
Aliases : [ ] config . Alias { } ,
2021-06-16 08:43:30 +02:00
Default : ` .*Merge pull request #(\\d+) from.* ` ,
2020-05-25 19:48:59 +02:00
} ,
{
Name : "buildTool" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "GENERAL" , "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "string" ,
Mandatory : false ,
Aliases : [ ] config . Alias { } ,
2021-06-16 08:43:30 +02:00
Default : ` maven ` ,
2020-05-25 19:48:59 +02:00
} ,
2020-05-29 15:42:35 +02:00
{
Name : "projectSettingsFile" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "GENERAL" , "STEPS" , "STAGES" , "PARAMETERS" } ,
Type : "string" ,
Mandatory : false ,
Aliases : [ ] config . Alias { { Name : "maven/projectSettingsFile" } } ,
2021-06-16 08:43:30 +02:00
Default : os . Getenv ( "PIPER_projectSettingsFile" ) ,
2020-05-29 15:42:35 +02:00
} ,
2023-08-31 13:48:18 +02:00
{
Name : "proxy" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "STEPS" , "STAGES" , "PARAMETERS" } ,
Type : "string" ,
Mandatory : false ,
Aliases : [ ] config . Alias { } ,
Default : os . Getenv ( "PIPER_proxy" ) ,
} ,
2020-05-29 15:42:35 +02:00
{
Name : "globalSettingsFile" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "GENERAL" , "STEPS" , "STAGES" , "PARAMETERS" } ,
Type : "string" ,
Mandatory : false ,
Aliases : [ ] config . Alias { { Name : "maven/globalSettingsFile" } } ,
2021-06-16 08:43:30 +02:00
Default : os . Getenv ( "PIPER_globalSettingsFile" ) ,
2020-05-29 15:42:35 +02:00
} ,
{
Name : "m2Path" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "GENERAL" , "STEPS" , "STAGES" , "PARAMETERS" } ,
Type : "string" ,
Mandatory : false ,
Aliases : [ ] config . Alias { { Name : "maven/m2Path" } } ,
2021-06-16 08:43:30 +02:00
Default : os . Getenv ( "PIPER_m2Path" ) ,
2020-05-29 15:42:35 +02:00
} ,
2020-09-18 08:19:34 +02:00
{
Name : "verifyOnly" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "PARAMETERS" , "STAGES" , "STEPS" } ,
Type : "bool" ,
Mandatory : false ,
Aliases : [ ] config . Alias { } ,
2021-06-16 08:43:30 +02:00
Default : false ,
2020-09-18 08:19:34 +02:00
} ,
2020-11-16 11:29:21 +02:00
{
Name : "installArtifacts" ,
ResourceRef : [ ] config . ResourceReference { } ,
Scope : [ ] string { "GENERAL" , "STEPS" , "STAGES" , "PARAMETERS" } ,
Type : "bool" ,
Mandatory : false ,
Aliases : [ ] config . Alias { } ,
2021-06-16 08:43:30 +02:00
Default : false ,
2020-11-16 11:29:21 +02:00
} ,
2022-01-21 11:52:17 +02:00
{
Name : "createResultIssue" ,
ResourceRef : [ ] config . ResourceReference {
{
Name : "commonPipelineEnvironment" ,
2022-03-31 10:52:54 +02:00
Param : "custom/isOptimizedAndScheduled" ,
2022-01-21 11:52:17 +02:00
} ,
} ,
2022-03-30 12:20:51 +02:00
Scope : [ ] string { "GENERAL" , "PARAMETERS" , "STAGES" , "STEPS" } ,
2022-01-21 11:52:17 +02:00
Type : "bool" ,
Mandatory : false ,
Aliases : [ ] config . Alias { } ,
Default : false ,
} ,
2020-05-25 19:48:59 +02:00
} ,
} ,
2020-11-20 09:13:59 +02:00
Containers : [ ] config . Container {
{ } ,
} ,
Outputs : config . StepOutputs {
Resources : [ ] config . StepResources {
{
Name : "influx" ,
Type : "influx" ,
Parameters : [ ] map [ string ] interface { } {
2021-12-15 10:40:50 +02:00
{ "name" : "step_data" , "fields" : [ ] map [ string ] string { { "name" : "fortify" } } } ,
2022-05-20 10:24:16 +02:00
{ "name" : "fortify_data" , "fields" : [ ] map [ string ] string { { "name" : "projectID" } , { "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" } } } ,
2020-11-20 09:13:59 +02:00
} ,
} ,
2022-02-21 10:23:54 +02:00
{
Name : "reports" ,
Type : "reports" ,
Parameters : [ ] map [ string ] interface { } {
{ "filePattern" : "**/*.PDF" , "type" : "fortify" } ,
{ "filePattern" : "**/*.fpr" , "type" : "fortify" } ,
{ "filePattern" : "**/fortify-scan.*" , "type" : "fortify" } ,
{ "filePattern" : "**/toolrun_fortify_*.json" , "type" : "fortify" } ,
{ "filePattern" : "**/piper_fortify_report.json" , "type" : "fortify" } ,
{ "filePattern" : "**/piper_fortify_report.html" , "type" : "fortify" } ,
} ,
} ,
2020-11-20 09:13:59 +02:00
} ,
} ,
2020-05-25 19:48:59 +02:00
} ,
}
return theMetaData
}