diff --git a/.gitignore b/.gitignore index 015214d69..825223822 100644 --- a/.gitignore +++ b/.gitignore @@ -15,4 +15,4 @@ horusec-analysis-*.json cmd/horusec/start/examples/ vendor obj/ -/dist +/dist \ No newline at end of file diff --git a/cmd/app/start/start_test.go b/cmd/app/start/start_test.go index 54b14273a..de06c64e0 100644 --- a/cmd/app/start/start_test.go +++ b/cmd/app/start/start_test.go @@ -40,66 +40,6 @@ import ( "github.com/ZupIT/horusec/internal/utils/prompt" ) -const ( - FlagAnalysisTimeout = "--analysis-timeout" - FlagAuthorization = "--authorization" - FlagCertificatePath = "--certificate-path" - FlagContainerBindProjectPath = "--container-bind-project-path" - FlagCustomRulesPath = "--custom-rules-path" - FlagDisableDocker = "--disable-docker" - FlagEnableCommitAuthor = "--enable-commit-author" - FlagEnableGitHistory = "--enable-git-history" - FlagEnableOwaspDependencyCheck = "--enable-owasp-dependency-check" - FlagEnableShellcheck = "--enable-shellcheck" - FlagFalsePositive = "--false-positive" - FlagHeaders = "--headers" - FlagHorusecUrl = "--horusec-url" - FlagIgnore = "--ignore" - FlagIgnoreSeverity = "--ignore-severity" - FlagInformationSeverity = "--information-severity" - FlagInsecureSkipVerify = "--insecure-skip-verify" - FlagJsonOutputFile = "--json-output-file" - FlagMonitorRetryCount = "--monitor-retry-count" - FlagOutputFormat = "--output-format" - FlagProjectPath = "--project-path" - FlagRepositoryName = "--repository-name" - FlagRequestTimeout = "--request-timeout" - FlagReturnError = "--return-error" - FlagRiskAccept = "--risk-accept" - FlagShowVulnerabilitiesTypes = "--show-vulnerabilities-types" -) - -func getFlags() []string { - return []string{ - FlagAnalysisTimeout, - FlagAuthorization, - FlagCertificatePath, - FlagContainerBindProjectPath, - FlagCustomRulesPath, - FlagDisableDocker, - FlagEnableCommitAuthor, - FlagEnableGitHistory, - FlagEnableOwaspDependencyCheck, - FlagEnableShellcheck, - FlagFalsePositive, - FlagHeaders, - FlagHorusecUrl, - FlagIgnore, - FlagIgnoreSeverity, - FlagInformationSeverity, - FlagInsecureSkipVerify, - FlagJsonOutputFile, - FlagMonitorRetryCount, - FlagOutputFormat, - FlagProjectPath, - FlagRepositoryName, - FlagRequestTimeout, - FlagReturnError, - FlagRiskAccept, - FlagShowVulnerabilitiesTypes, - } -} - func TestMain(m *testing.M) { _ = os.RemoveAll("./examples") _ = os.RemoveAll("./tmp") @@ -145,7 +85,7 @@ func TestNewStartCommand(t *testing.T) { } flags = append(flags, "--"+flag.Name) }) - expectedFlags := getFlags() + expectedFlags := testutil.GetAllStartFlags() assert.Equal(t, len(expectedFlags), len(flags)) for _, flag := range flags { assert.Contains(t, expectedFlags, flag) @@ -181,7 +121,7 @@ func TestStartCommand_ExecuteUnitTests(t *testing.T) { }, { name: "Should execute command exec without error and not ask if is to run in current directory", - args: []string{FlagProjectPath, testutil.RootPath}, + args: []string{testutil.StartFlagProjectPath, testutil.RootPath}, err: false, onFn: func(prompt *prompt.Mock, requirements *requirements.Mock, analyzer *analyzer.Mock) { prompt.On("Ask").Return("Y", nil) @@ -199,7 +139,7 @@ func TestStartCommand_ExecuteUnitTests(t *testing.T) { { name: "Should execute command exec and return error because found vulnerabilities (-p,-e)", - args: []string{FlagProjectPath, testutil.RootPath, FlagReturnError}, + args: []string{testutil.StartFlagProjectPath, testutil.RootPath, testutil.StartFlagReturnError}, err: true, onFn: func(prompt *prompt.Mock, requirements *requirements.Mock, analyzer *analyzer.Mock) { analyzer.On("Analyze").Return(10, nil) @@ -216,7 +156,7 @@ func TestStartCommand_ExecuteUnitTests(t *testing.T) { }, { name: "Should execute command exec and return error because found error when ask but run in current folder", - args: []string{FlagReturnError}, + args: []string{testutil.StartFlagReturnError}, err: true, onFn: func(prompt *prompt.Mock, requirements *requirements.Mock, analyzer *analyzer.Mock) { analyzer.On("Analyze").Return(0, nil) @@ -232,7 +172,7 @@ func TestStartCommand_ExecuteUnitTests(t *testing.T) { }, { name: "Should execute command exec without error and validate if git is installed(--enable-git-history)", - args: []string{FlagEnableGitHistory, FlagReturnError}, + args: []string{testutil.StartFlagEnableGitHistory, testutil.StartFlagReturnError}, err: false, onFn: func(prompt *prompt.Mock, requirements *requirements.Mock, analyzer *analyzer.Mock) { prompt.On("Ask").Return("Y", nil) @@ -253,7 +193,7 @@ func TestStartCommand_ExecuteUnitTests(t *testing.T) { }, { name: "Should execute command exec without error and not ask because is different project path(-p, -e)", - args: []string{FlagReturnError, FlagProjectPath, os.TempDir()}, + args: []string{testutil.StartFlagReturnError, testutil.StartFlagProjectPath, os.TempDir()}, err: false, onFn: func(prompt *prompt.Mock, requirements *requirements.Mock, analyzer *analyzer.Mock) { prompt.On("Ask").Return("Y", nil) @@ -271,7 +211,7 @@ func TestStartCommand_ExecuteUnitTests(t *testing.T) { }, { name: "Should execute command exec and return error because found not accept proceed", - args: []string{FlagReturnError}, + args: []string{testutil.StartFlagReturnError}, err: true, onFn: func(prompt *prompt.Mock, requirements *requirements.Mock, analyzer *analyzer.Mock) { analyzer.On("Analyze").Return(0, nil) @@ -287,7 +227,7 @@ func TestStartCommand_ExecuteUnitTests(t *testing.T) { }, { name: "Should execute command exec and return error because found invalid RepositoryAuthorization field", - args: []string{FlagProjectPath, os.TempDir(), FlagAuthorization, "NOT_VALID_AUTHORIZATION", FlagReturnError}, + args: []string{testutil.StartFlagProjectPath, os.TempDir(), testutil.StartFlagAuthorization, "NOT_VALID_AUTHORIZATION", testutil.StartFlagReturnError}, err: true, onFn: func(prompt *prompt.Mock, requirements *requirements.Mock, analyzer *analyzer.Mock) { prompt.On("Ask").Return("Y", nil) @@ -306,7 +246,7 @@ func TestStartCommand_ExecuteUnitTests(t *testing.T) { }, { name: "Should execute command exec and return success because found valid RepositoryAuthorization field(-a)", - args: []string{FlagProjectPath, os.TempDir(), FlagAuthorization, "76034e43-bdb8-48d9-a0ad-fc674f0354bb", FlagReturnError}, + args: []string{testutil.StartFlagProjectPath, os.TempDir(), testutil.StartFlagAuthorization, "76034e43-bdb8-48d9-a0ad-fc674f0354bb", testutil.StartFlagReturnError}, err: false, onFn: func(prompt *prompt.Mock, requirements *requirements.Mock, analyzer *analyzer.Mock) { prompt.On("Ask").Return("Y", nil) @@ -325,7 +265,7 @@ func TestStartCommand_ExecuteUnitTests(t *testing.T) { }, { name: "Should execute command exec without error using json output(-o json, -O)", - args: []string{FlagProjectPath, testutil.RootPath, FlagJsonOutputFile, filepath.Join(testutil.RootPath, "cmd", "app", "start", "tmp-json.json"), FlagOutputFormat, "json", FlagReturnError}, + args: []string{testutil.StartFlagProjectPath, testutil.RootPath, testutil.StartFlagJSONOutputFilePath, filepath.Join(testutil.RootPath, "cmd", "app", "start", "tmp-json.json"), testutil.StartFlagOutputFormat, "json", testutil.StartFlagReturnError}, err: false, onFn: func(prompt *prompt.Mock, requirements *requirements.Mock, analyzer *analyzer.Mock) { prompt.On("Ask").Return("Y", nil) @@ -344,7 +284,7 @@ func TestStartCommand_ExecuteUnitTests(t *testing.T) { }, { name: "Should execute command exec with error using unknown type output(-o unknown, -O)", - args: []string{FlagProjectPath, testutil.RootPath, FlagJsonOutputFile, filepath.Join(testutil.RootPath, "cmd", "app", "start", "tmp-unknownType.json"), FlagOutputFormat, "unknownTypeOutput", FlagReturnError}, + args: []string{testutil.StartFlagProjectPath, testutil.RootPath, testutil.StartFlagJSONOutputFilePath, filepath.Join(testutil.RootPath, "cmd", "app", "start", "tmp-unknownType.json"), testutil.StartFlagOutputFormat, "unknownTypeOutput", testutil.StartFlagReturnError}, err: true, onFn: func(prompt *prompt.Mock, requirements *requirements.Mock, analyzer *analyzer.Mock) { analyzer.On("Analyze").Return(0, nil) @@ -363,7 +303,7 @@ func TestStartCommand_ExecuteUnitTests(t *testing.T) { }, { name: "Should execute command exec without error using sonarqube output (-o sonarqube, -O)", - args: []string{FlagProjectPath, testutil.RootPath, FlagJsonOutputFile, filepath.Join(testutil.RootPath, "cmd", "app", "start", "tmp-sonarqube.json"), FlagOutputFormat, "sonarqube", FlagReturnError}, + args: []string{testutil.StartFlagProjectPath, testutil.RootPath, testutil.StartFlagJSONOutputFilePath, filepath.Join(testutil.RootPath, "cmd", "app", "start", "tmp-sonarqube.json"), testutil.StartFlagOutputFormat, "sonarqube", testutil.StartFlagReturnError}, err: false, onFn: func(prompt *prompt.Mock, requirements *requirements.Mock, analyzer *analyzer.Mock) { analyzer.On("Analyze").Return(0, nil) @@ -382,7 +322,7 @@ func TestStartCommand_ExecuteUnitTests(t *testing.T) { }, { name: "Should execute command exec without error showing info vulnerabilities (--information-severity)", - args: []string{FlagProjectPath, testutil.RootPath, FlagInformationSeverity}, + args: []string{testutil.StartFlagProjectPath, testutil.RootPath, testutil.StartFlagInformationSeverity}, err: false, onFn: func(prompt *prompt.Mock, requirements *requirements.Mock, analyzer *analyzer.Mock) { prompt.On("Ask").Return("Y", nil) @@ -400,7 +340,7 @@ func TestStartCommand_ExecuteUnitTests(t *testing.T) { }, { name: "Should execute command exec without error sending to web application (-u,-a)", - args: []string{FlagProjectPath, testutil.RootPath, FlagHorusecUrl, "https://google.com", FlagAuthorization, "76034e43-bdb8-48d9-a0ad-fc674f0354bb"}, + args: []string{testutil.StartFlagProjectPath, testutil.RootPath, testutil.StartFlagHorusecURL, "https://google.com", testutil.StartFlagAuthorization, "76034e43-bdb8-48d9-a0ad-fc674f0354bb"}, err: false, onFn: func(prompt *prompt.Mock, requirements *requirements.Mock, analyzer *analyzer.Mock) { analyzer.On("Analyze").Return(0, nil) @@ -420,7 +360,7 @@ func TestStartCommand_ExecuteUnitTests(t *testing.T) { }, { name: "Should execute command exec with error sending to a invalid url web application (-u,-a)", - args: []string{FlagProjectPath, testutil.RootPath, FlagHorusecUrl, "*vsaf&&", FlagAuthorization, "76034e43-bdb8-48d9-a0ad-fc674f0354bb"}, + args: []string{testutil.StartFlagProjectPath, testutil.RootPath, testutil.StartFlagHorusecURL, "*vsaf&&", testutil.StartFlagAuthorization, "76034e43-bdb8-48d9-a0ad-fc674f0354bb"}, err: true, onFn: func(prompt *prompt.Mock, requirements *requirements.Mock, analyzer *analyzer.Mock) { analyzer.On("Analyze").Return(0, nil) @@ -438,7 +378,7 @@ func TestStartCommand_ExecuteUnitTests(t *testing.T) { }, { name: "Should execute command exec without error and return vulnerabilities but ignore vulnerabilities of type HIGH (-s)", - args: []string{FlagProjectPath, testutil.RootPath, FlagIgnoreSeverity, "CRITICAL, LOW"}, + args: []string{testutil.StartFlagProjectPath, testutil.RootPath, testutil.StartFlagIgnoreSeverity, "CRITICAL, LOW"}, err: false, onFn: func(prompt *prompt.Mock, requirements *requirements.Mock, analyzer *analyzer.Mock) { @@ -457,7 +397,7 @@ func TestStartCommand_ExecuteUnitTests(t *testing.T) { }, { name: "Should execute command exec with error and not return vulnerabilities when set to ignore unknown type of vulnerability (-s)", - args: []string{FlagProjectPath, testutil.RootPath, FlagIgnoreSeverity, "potato, shoes"}, + args: []string{testutil.StartFlagProjectPath, testutil.RootPath, testutil.StartFlagIgnoreSeverity, "potato, shoes"}, err: true, onFn: func(prompt *prompt.Mock, requirements *requirements.Mock, analyzer *analyzer.Mock) { analyzer.On("Analyze").Return(0, nil) @@ -475,7 +415,7 @@ func TestStartCommand_ExecuteUnitTests(t *testing.T) { }, { name: "Should execute command exec without error and not return vulnerabilities when set valid certificate path (-C --certificate-path)", - args: []string{FlagProjectPath, testutil.RootPath, FlagCertificatePath, filepath.Join(testutil.RootPath, "..")}, + args: []string{testutil.StartFlagProjectPath, testutil.RootPath, testutil.StartFlagCertificatePath, filepath.Join(testutil.RootPath, "..")}, err: false, onFn: func(prompt *prompt.Mock, requirements *requirements.Mock, analyzer *analyzer.Mock) { analyzer.On("Analyze").Return(0, nil) @@ -493,7 +433,7 @@ func TestStartCommand_ExecuteUnitTests(t *testing.T) { }, { name: "Should execute command exec with error and not return vulnerabilities when set invalid certificate path (-C --certificate-path)", - args: []string{FlagProjectPath, testutil.RootPath, FlagCertificatePath, "invalidPath"}, + args: []string{testutil.StartFlagProjectPath, testutil.RootPath, testutil.StartFlagCertificatePath, "invalidPath"}, err: true, onFn: func(prompt *prompt.Mock, requirements *requirements.Mock, analyzer *analyzer.Mock) { analyzer.On("Analyze").Return(0, nil) @@ -511,7 +451,7 @@ func TestStartCommand_ExecuteUnitTests(t *testing.T) { }, { name: "Should execute command exec without error and not return vulnerabilities when set valid analysis timeout (-t --analysis-timeout)\"", - args: []string{FlagProjectPath, testutil.RootPath, FlagAnalysisTimeout, "123"}, + args: []string{testutil.StartFlagProjectPath, testutil.RootPath, testutil.StartFlagAnalysisTimeout, "123"}, err: false, onFn: func(prompt *prompt.Mock, requirements *requirements.Mock, analyzer *analyzer.Mock) { analyzer.On("Analyze").Return(0, nil) @@ -529,7 +469,7 @@ func TestStartCommand_ExecuteUnitTests(t *testing.T) { }, { name: "Should execute command exec with error and not return vulnerabilities when set invalid analysis timeout (-t --analysis-timeout)", - args: []string{FlagProjectPath, testutil.RootPath, FlagAnalysisTimeout, "potato"}, + args: []string{testutil.StartFlagProjectPath, testutil.RootPath, testutil.StartFlagAnalysisTimeout, "potato"}, err: true, onFn: func(prompt *prompt.Mock, requirements *requirements.Mock, analyzer *analyzer.Mock) { analyzer.On("Analyze").Return(0, nil) @@ -546,7 +486,7 @@ func TestStartCommand_ExecuteUnitTests(t *testing.T) { }, { name: "Should execute command exec without error and not return vulnerabilities when set disable docker (-D --disable-docker)", - args: []string{FlagDisableDocker}, + args: []string{testutil.StartFlagDisableDocker}, err: false, onFn: func(prompt *prompt.Mock, requirements *requirements.Mock, analyzer *analyzer.Mock) { analyzer.On("Analyze").Return(0, nil) @@ -563,7 +503,7 @@ func TestStartCommand_ExecuteUnitTests(t *testing.T) { }, { name: "Should execute command exec without error and not return vulnerabilities when set valid request timeout (-r --request-timeout)", - args: []string{FlagRequestTimeout, "123"}, + args: []string{testutil.StartFlagRequestTimeout, "123"}, err: false, onFn: func(prompt *prompt.Mock, requirements *requirements.Mock, analyzer *analyzer.Mock) { analyzer.On("Analyze").Return(0, nil) @@ -580,7 +520,7 @@ func TestStartCommand_ExecuteUnitTests(t *testing.T) { }, { name: "Should execute command exec with error and not return vulnerabilities when set invalid request timeout (-r --request-timeout)", - args: []string{FlagRequestTimeout, "potato"}, + args: []string{testutil.StartFlagRequestTimeout, "potato"}, err: true, onFn: func(prompt *prompt.Mock, requirements *requirements.Mock, analyzer *analyzer.Mock) { analyzer.On("Analyze").Return(0, nil) diff --git a/e2e/commands/generate/generate_test.go b/e2e/commands/generate/generate_test.go index 670178644..fcc84c5f6 100644 --- a/e2e/commands/generate/generate_test.go +++ b/e2e/commands/generate/generate_test.go @@ -16,13 +16,14 @@ package generate_test import ( "fmt" + "os" + "path/filepath" + "strings" + . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" "github.com/onsi/gomega/gbytes" "github.com/onsi/gomega/gexec" - "os" - "path/filepath" - "strings" "github.com/ZupIT/horusec/internal/utils/testutil" ) @@ -46,9 +47,9 @@ var _ = Describe("Run horusec CLI with generate argument", func() { BeforeEach(func() { flags = map[string]string{ - "--config-file-path": configFilePath, + testutil.GlobalFlagConfigFilePath: configFilePath, } - cmd := testutil.GinkgoGetHorusecCmdWithFlags(testutil.GenerateCmd, flags) + cmd := testutil.GinkgoGetHorusecCmdWithFlags(testutil.CmdGenerate, flags) session, err = gexec.Start(cmd, outBuffer, errBuffer) }) diff --git a/e2e/commands/version/version_test.go b/e2e/commands/version/version_test.go index 3dc473c04..e283cf7e1 100644 --- a/e2e/commands/version/version_test.go +++ b/e2e/commands/version/version_test.go @@ -31,7 +31,7 @@ var _ = Describe("Run horusec CLI with version argument", func() { ) BeforeEach(func() { - cmd := testutil.GinkgoGetHorusecCmd(testutil.VersionCmd) + cmd := testutil.GinkgoGetHorusecCmd(testutil.CmdVersion) outBuffer = gbytes.NewBuffer() session, err = gexec.Start(cmd, outBuffer, outBuffer) }) diff --git a/e2e/scan/scan_test.go b/e2e/scan/scan_test.go index d4847da5c..93e63c2ac 100644 --- a/e2e/scan/scan_test.go +++ b/e2e/scan/scan_test.go @@ -21,6 +21,8 @@ import ( "os" "path" + "github.com/ZupIT/horusec/internal/enums/outputtype" + "github.com/google/uuid" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" @@ -127,12 +129,12 @@ var _ = Describe("Scan vulnerabilities example folder", func() { output := path.Join(os.TempDir(), fmt.Sprintf("horusec-analysis-%s.json", uuid.New().String())) flags := map[string]string{ - "-p": tt.target, - "-o": "json", - "-O": output, + testutil.StartFlagProjectPath: tt.target, + testutil.StartFlagOutputFormat: outputtype.JSON, + testutil.StartFlagJSONOutputFilePath: output, } - cmd := testutil.GinkgoGetHorusecCmdWithFlags(testutil.StartCmd, flags) + cmd := testutil.GinkgoGetHorusecCmdWithFlags(testutil.CmdStart, flags) stdout := bytes.NewBufferString("") stderr := bytes.NewBufferString("") diff --git a/internal/utils/file/file_test.go b/internal/utils/file/file_test.go index dc2543fd3..2a976792b 100644 --- a/internal/utils/file/file_test.go +++ b/internal/utils/file/file_test.go @@ -18,8 +18,9 @@ import ( "path/filepath" "testing" - "github.com/ZupIT/horusec/internal/utils/testutil" "github.com/stretchr/testify/assert" + + "github.com/ZupIT/horusec/internal/utils/testutil" ) func TestGetFilePathIntoBasePath(t *testing.T) { diff --git a/internal/utils/testutil/binary.go b/internal/utils/testutil/binary.go index e4a5ae2e0..de2bf762e 100644 --- a/internal/utils/testutil/binary.go +++ b/internal/utils/testutil/binary.go @@ -24,27 +24,15 @@ import ( "github.com/onsi/ginkgo" ) -type HorusecCmd string - -func (h HorusecCmd) String() string { - return string(h) -} - -const ( - VersionCmd HorusecCmd = "version" - StartCmd HorusecCmd = "start" - GenerateCmd HorusecCmd = "generate" -) - -func GinkgoGetHorusecCmd(horusecCmd HorusecCmd) *exec.Cmd { +func GinkgoGetHorusecCmd(horusecCmd string) *exec.Cmd { bin := ginkgoBuildHorusecBinary() - args := setLogLevelArgsToHorusecCmd(horusecCmd.String()) + args := setLogLevelArgsToHorusecCmd(horusecCmd) return exec.Command(bin, args...) } -func GinkgoGetHorusecCmdWithFlags(cmdArg HorusecCmd, flags map[string]string) *exec.Cmd { +func GinkgoGetHorusecCmdWithFlags(cmdArg string, flags map[string]string) *exec.Cmd { bin := ginkgoBuildHorusecBinary() - args := setLogLevelArgsToHorusecCmd(cmdArg.String()) + args := setLogLevelArgsToHorusecCmd(cmdArg) for flag, value := range flags { args = append(args, fmt.Sprintf("%s=%s", flag, value)) } diff --git a/internal/utils/testutil/cli_args.go b/internal/utils/testutil/cli_args.go new file mode 100644 index 000000000..918cdb967 --- /dev/null +++ b/internal/utils/testutil/cli_args.go @@ -0,0 +1,74 @@ +// Copyright 2020 ZUP IT SERVICOS EM TECNOLOGIA E INOVACAO SA +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package testutil + +// Available Commands +const ( + CmdVersion = "version" + CmdStart = "start" + CmdGenerate = "generate" +) + +// Available Global Flags +const ( + GlobalFlagConfigFilePath = "--config-file-path" + GlobalFlagHelp = "--help" + GlobalFlagLogFilePath = "--log-file-path" + GlobalFlagLogLevel = "--log-level" +) + +// Available Flags for start command +const ( + StartFlagAnalysisTimeout = "--analysis-timeout" + StartFlagAuthorization = "--authorization" + StartFlagCertificatePath = "--certificate-path" + StartFlagContainerBindProjectPath = "--container-bind-project-path" + StartFlagCustomRulesPath = "--custom-rules-path" + StartFlagDisableDocker = "--disable-docker" + StartFlagEnableCommitAuthor = "--enable-commit-author" + StartFlagEnableGitHistory = "--enable-git-history" + StartFlagEnableOwaspDependencyCheck = "--enable-owasp-dependency-check" + StartFlagEnableShellcheck = "--enable-shellcheck" + StartFlagFalsePositive = "--false-positive" + StartFlagHeaders = "--headers" + StartFlagHorusecURL = "--horusec-url" + StartFlagIgnore = "--ignore" + StartFlagIgnoreSeverity = "--ignore-severity" + StartFlagInformationSeverity = "--information-severity" + StartFlagInsecureSkipVerify = "--insecure-skip-verify" + StartFlagJSONOutputFilePath = "--json-output-file" + StartFlagMonitorRetryCount = "--monitor-retry-count" + StartFlagOutputFormat = "--output-format" + StartFlagProjectPath = "--project-path" + StartFlagRepositoryName = "--repository-name" + StartFlagRequestTimeout = "--request-timeout" + StartFlagReturnError = "--return-error" + StartFlagRiskAccept = "--risk-accept" + StartFlagShowVulnerabilitiesTypes = "--show-vulnerabilities-types" +) + +func GetAllStartFlags() []string { + return []string{ + StartFlagAnalysisTimeout, StartFlagAuthorization, StartFlagCertificatePath, + StartFlagContainerBindProjectPath, StartFlagCustomRulesPath, StartFlagDisableDocker, + StartFlagEnableCommitAuthor, StartFlagEnableGitHistory, StartFlagEnableOwaspDependencyCheck, + StartFlagEnableShellcheck, StartFlagFalsePositive, StartFlagHeaders, + StartFlagHorusecURL, StartFlagIgnore, StartFlagIgnoreSeverity, + StartFlagInformationSeverity, StartFlagInsecureSkipVerify, StartFlagJSONOutputFilePath, + StartFlagMonitorRetryCount, StartFlagOutputFormat, StartFlagProjectPath, + StartFlagRepositoryName, StartFlagRequestTimeout, StartFlagReturnError, + StartFlagRiskAccept, StartFlagShowVulnerabilitiesTypes, + } +}