Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use wrapper by default in audit maven & gradle #1804

Merged
merged 9 commits into from
Mar 14, 2023
2 changes: 1 addition & 1 deletion scan/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ func createGenericAuditCmd(c *cli.Context) (*audit.GenericAuditCommand, error) {
}

return auditCmd.SetExcludeTestDependencies(c.Bool(cliutils.ExcludeTestDeps)).
SetUseWrapper(c.BoolT(cliutils.UseWrapper)).
SetUseWrapper(c.Bool(cliutils.AuditUseWrapper)).
SetInsecureTls(c.Bool(cliutils.InsecureTls)).
SetNpmScope(c.String(cliutils.DepType)).
SetPipRequirementsFile(c.String(cliutils.RequirementsFile)),
Expand Down
21 changes: 13 additions & 8 deletions utils/cliutils/commandsflags.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ const (

// Unique gradle-config flags
usesPlugin = "uses-plugin"
UseWrapper = "use-wrapper"
ConfigUseWrapper = "use-wrapper"
deployMavenDesc = "deploy-maven-desc"
deployIvyDesc = "deploy-ivy-desc"
ivyDescPattern = "ivy-desc-pattern"
Expand Down Expand Up @@ -445,6 +445,7 @@ const (
licenses = "licenses"
vuln = "vuln"
ExtendedTable = "extended-table"
AuditUseWrapper = "audit-use-wrapper"

// *** Mission Control Commands' flags ***
missionControlPrefix = "mc-"
Expand Down Expand Up @@ -1007,9 +1008,9 @@ var flagsMap = map[string]cli.Flag{
Name: usesPlugin,
Usage: "[Default: false] Set to true if the Gradle Artifactory Plugin is already applied in the build script.` `",
},
UseWrapper: cli.BoolTFlag{
Name: UseWrapper,
Usage: "[Default: true] [Gradle] Set to false if you do not wish to use the Gradle wrapper.` `",
ConfigUseWrapper: cli.BoolFlag{
Name: ConfigUseWrapper,
Usage: "[Default: false] [Gradle] Set to true if you'd like to use the Gradle wrapper.` `",
},
deployMavenDesc: cli.BoolTFlag{
Name: deployMavenDesc,
Expand Down Expand Up @@ -1259,6 +1260,10 @@ var flagsMap = map[string]cli.Flag{
Name: ExtendedTable,
Usage: "[Default: false] Set to true if you'd like the table to include extended fields such as 'CVSS' & 'Xray Issue Id'. Ignored if provided 'format' is not 'table'. ` `",
},
AuditUseWrapper: cli.BoolTFlag{
Name: AuditUseWrapper,
Usage: "[Default: True] Set to fale if you wish to not use the wrapper ",
sarao1310 marked this conversation as resolved.
Show resolved Hide resolved
},
licenses: cli.BoolFlag{
Name: licenses,
Usage: "[Default: false] Set to true if you'd like to receive licenses from Xray scanning. ` `",
Expand Down Expand Up @@ -1556,10 +1561,10 @@ var commandFlags = map[string][]string{
glcQuiet, InsecureTls, retries, retryWaitTime,
},
MvnConfig: {
global, serverIdResolve, serverIdDeploy, repoResolveReleases, repoResolveSnapshots, repoDeployReleases, repoDeploySnapshots, includePatterns, excludePatterns,
global, serverIdResolve, serverIdDeploy, repoResolveReleases, repoResolveSnapshots, repoDeployReleases, repoDeploySnapshots, includePatterns, excludePatterns, ConfigUseWrapper,
},
GradleConfig: {
global, serverIdResolve, serverIdDeploy, repoResolve, repoDeploy, usesPlugin, UseWrapper, deployMavenDesc,
global, serverIdResolve, serverIdDeploy, repoResolve, repoDeploy, usesPlugin, ConfigUseWrapper, deployMavenDesc,
deployIvyDesc, ivyDescPattern, ivyArtifactsPattern,
},
Mvn: {
Expand Down Expand Up @@ -1740,13 +1745,13 @@ var commandFlags = map[string][]string{
},
Audit: {
xrUrl, user, password, accessToken, serverId, InsecureTls, project, watches, repoPath, licenses, xrOutput, ExcludeTestDeps,
UseWrapper, DepType, RequirementsFile, fail, ExtendedTable, workingDirs, Mvn, Gradle, Npm, Yarn, Go, Nuget, Pip, Pipenv, Poetry,
AuditUseWrapper, DepType, RequirementsFile, fail, ExtendedTable, workingDirs, Mvn, Gradle, Npm, Yarn, Go, Nuget, Pip, Pipenv, Poetry,
},
AuditMvn: {
xrUrl, user, password, accessToken, serverId, InsecureTls, project, watches, repoPath, licenses, xrOutput, fail, ExtendedTable,
},
AuditGradle: {
xrUrl, user, password, accessToken, serverId, ExcludeTestDeps, UseWrapper, project, watches, repoPath, licenses, xrOutput, fail, ExtendedTable,
xrUrl, user, password, accessToken, serverId, ExcludeTestDeps, ConfigUseWrapper, project, watches, repoPath, licenses, xrOutput, fail, ExtendedTable,
},
AuditNpm: {
xrUrl, user, password, accessToken, serverId, DepType, project, watches, repoPath, licenses, xrOutput, fail, ExtendedTable,
Expand Down