From 2a4b5c49a1aa0299ec2d493ae37864ba7a5a3181 Mon Sep 17 00:00:00 2001 From: psmf22 <117990501+psmf22@users.noreply.github.com> Date: Fri, 22 Sep 2023 11:07:31 +0200 Subject: [PATCH 1/7] chore: iimprove version detection for tool install commands automatically selects newest subversion for provided major version (ie 5.4.0 for 5) --- .../fortify/cli/tool/_common/helper/ToolDownloadDescriptor.java | 2 +- .../com/fortify/cli/tool/fod-uploader/fod-uploader.yaml | 1 + .../resources/com/fortify/cli/tool/sc-client/sc-client.yaml | 1 + .../com/fortify/cli/tool/vuln-exporter/vuln-exporter.yaml | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/_common/helper/ToolDownloadDescriptor.java b/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/_common/helper/ToolDownloadDescriptor.java index 9647f0924b..9f3a67229d 100644 --- a/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/_common/helper/ToolDownloadDescriptor.java +++ b/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/_common/helper/ToolDownloadDescriptor.java @@ -39,7 +39,7 @@ public final Stream getVersionsStream() { public final ToolVersionDownloadDescriptor getVersion(String version) { return getVersionsStream() - .filter(v->v.getVersion().equals(version)) + .filter(v->v.getVersion().startsWith(version)) .findFirst().orElseThrow(()->new IllegalArgumentException("Version "+version+" not defined")); } diff --git a/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/fod-uploader/fod-uploader.yaml b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/fod-uploader/fod-uploader.yaml index 5ecf6dd2d2..76360b2493 100644 --- a/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/fod-uploader/fod-uploader.yaml +++ b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/fod-uploader/fod-uploader.yaml @@ -1,3 +1,4 @@ +#Versions must be listed in descending order defaultDownloadUrl: https://github.com/fod-dev/fod-uploader-java/releases/download/v{toolVersion}/FodUpload.jar defaultVersion: 5.4.0 versions: diff --git a/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/sc-client/sc-client.yaml b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/sc-client/sc-client.yaml index 18226e342e..b90e84a806 100644 --- a/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/sc-client/sc-client.yaml +++ b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/sc-client/sc-client.yaml @@ -1,3 +1,4 @@ +#Versions must be listed in descending order defaultDownloadUrl: https://tools.fortify.com/scancentral/Fortify_ScanCentral_Client_{toolVersion}_x64.zip defaultVersion: 23.1.0 versions: diff --git a/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/vuln-exporter/vuln-exporter.yaml b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/vuln-exporter/vuln-exporter.yaml index 6b11014ad2..15c19f51c3 100644 --- a/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/vuln-exporter/vuln-exporter.yaml +++ b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/vuln-exporter/vuln-exporter.yaml @@ -1,3 +1,4 @@ +#Versions must be listed in descending order defaultDownloadUrl: https://github.com/fortify/FortifyVulnerabilityExporter/releases/download/v{toolVersion}/FortifyVulnerabilityExporter.zip defaultVersion: 2.0.3 versions: From f2ed17615d25e15c91c115168aa965ec9e4311d2 Mon Sep 17 00:00:00 2001 From: psmf22 <117990501+psmf22@users.noreply.github.com> Date: Fri, 22 Sep 2023 13:26:18 +0200 Subject: [PATCH 2/7] chore: update tool commands - remove "latest" option removed "latest" entry for tool yaml files, "latest" is now translated to "default" behind the scenes but pulls the latest known version rather than the latest version --- .../cli/tool/_common/helper/ToolDownloadDescriptor.java | 2 +- .../com/fortify/cli/tool/fod-uploader/fod-uploader.yaml | 3 --- .../resources/com/fortify/cli/tool/sc-client/sc-client.yaml | 3 --- .../com/fortify/cli/tool/vuln-exporter/vuln-exporter.yaml | 3 --- 4 files changed, 1 insertion(+), 10 deletions(-) diff --git a/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/_common/helper/ToolDownloadDescriptor.java b/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/_common/helper/ToolDownloadDescriptor.java index 9f3a67229d..78a639aa14 100644 --- a/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/_common/helper/ToolDownloadDescriptor.java +++ b/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/_common/helper/ToolDownloadDescriptor.java @@ -44,7 +44,7 @@ public final ToolVersionDownloadDescriptor getVersion(String version) { } public final ToolVersionDownloadDescriptor getVersionOrDefault(String versionName) { - if ( StringUtils.isBlank(versionName) || "default".equals(versionName) ) { + if ( StringUtils.isBlank(versionName) || "default".equals(versionName) || "latest".equals(versionName) ) { versionName = defaultVersion; } return getVersion(versionName); diff --git a/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/fod-uploader/fod-uploader.yaml b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/fod-uploader/fod-uploader.yaml index 76360b2493..19ef7cc8d1 100644 --- a/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/fod-uploader/fod-uploader.yaml +++ b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/fod-uploader/fod-uploader.yaml @@ -2,9 +2,6 @@ defaultDownloadUrl: https://github.com/fod-dev/fod-uploader-java/releases/download/v{toolVersion}/FodUpload.jar defaultVersion: 5.4.0 versions: - - version: latest - downloadUrl: https://github.com/fod-dev/fod-uploader-java/releases/latest/download/FodUpload.jar - digest: SHA-256:7d3fc9ada2df3cd5ed6159685d36656d04cef6ddda69bff2110702c052e64fce - version: 5.4.0 digest: SHA-256:7d3fc9ada2df3cd5ed6159685d36656d04cef6ddda69bff2110702c052e64fce - version: 5.3.1 diff --git a/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/sc-client/sc-client.yaml b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/sc-client/sc-client.yaml index b90e84a806..92c9b36a7d 100644 --- a/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/sc-client/sc-client.yaml +++ b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/sc-client/sc-client.yaml @@ -2,9 +2,6 @@ defaultDownloadUrl: https://tools.fortify.com/scancentral/Fortify_ScanCentral_Client_{toolVersion}_x64.zip defaultVersion: 23.1.0 versions: - - version: latest - downloadUrl: https://tools.fortify.com/scancentral/Fortify_ScanCentral_Client_Latest_x64.zip - digest: SHA-256:012e00fab914495ad235e8658207702869e02fffbd4d2adfcc3c2baf50fe8de9 - version: 23.1.0 digest: SHA-256:012e00fab914495ad235e8658207702869e02fffbd4d2adfcc3c2baf50fe8de9 - version: 22.2.1 diff --git a/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/vuln-exporter/vuln-exporter.yaml b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/vuln-exporter/vuln-exporter.yaml index 15c19f51c3..78926769eb 100644 --- a/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/vuln-exporter/vuln-exporter.yaml +++ b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/vuln-exporter/vuln-exporter.yaml @@ -2,9 +2,6 @@ defaultDownloadUrl: https://github.com/fortify/FortifyVulnerabilityExporter/releases/download/v{toolVersion}/FortifyVulnerabilityExporter.zip defaultVersion: 2.0.3 versions: - - version: latest - downloadUrl: https://github.com/fortify/FortifyVulnerabilityExporter/releases/latest/download/FortifyVulnerabilityExporter.zip - digest: SHA-256:6f3b83b1046dc76038e8fb2121c4dbf5c976fa4cb10c3826d591f6fb31c14bee - version: 2.0.3 digest: SHA-256:6f3b83b1046dc76038e8fb2121c4dbf5c976fa4cb10c3826d591f6fb31c14bee - version: 2.0.2 From d38f53b936aa27748b1d32de820fa436bbed669e Mon Sep 17 00:00:00 2001 From: psmf22 <117990501+psmf22@users.noreply.github.com> Date: Fri, 22 Sep 2023 15:57:45 +0200 Subject: [PATCH 3/7] chore: added bugtracker-utillity tool commands added bugtracker-utility commands, adjusted AbstractToolUninstallCommand to accept "latest" or "default" version and translate to proper version number --- .../cli/cmd/AbstractToolUninstallCommand.java | 1 + .../cli/tool/_main/cli/cmd/ToolCommands.java | 2 + .../cmd/ToolBugTrackerUtilityCommands.java | 31 +++++++++++ .../ToolBugTrackerUtilityInstallCommand.java | 53 +++++++++++++++++++ .../cmd/ToolBugTrackerUtilityListCommand.java | 26 +++++++++ ...ToolBugTrackerUtilityUninstallCommand.java | 26 +++++++++ .../bugtracker-utility.yaml | 6 +++ .../cli/tool/i18n/ToolMessages.properties | 10 ++++ 8 files changed, 155 insertions(+) create mode 100644 fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/bugtracker_utility/cli/cmd/ToolBugTrackerUtilityCommands.java create mode 100644 fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/bugtracker_utility/cli/cmd/ToolBugTrackerUtilityInstallCommand.java create mode 100644 fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/bugtracker_utility/cli/cmd/ToolBugTrackerUtilityListCommand.java create mode 100644 fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/bugtracker_utility/cli/cmd/ToolBugTrackerUtilityUninstallCommand.java create mode 100644 fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/bugtracker-utility/bugtracker-utility.yaml diff --git a/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/_common/cli/cmd/AbstractToolUninstallCommand.java b/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/_common/cli/cmd/AbstractToolUninstallCommand.java index c14489f360..8fdfe4f9ad 100644 --- a/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/_common/cli/cmd/AbstractToolUninstallCommand.java +++ b/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/_common/cli/cmd/AbstractToolUninstallCommand.java @@ -37,6 +37,7 @@ public abstract class AbstractToolUninstallCommand extends AbstractOutputCommand @Override public final JsonNode getJsonNode() { String toolName = getToolName(); + version = ToolHelper.getToolDownloadDescriptor(toolName).getVersionOrDefault(version).getVersion(); ToolVersionCombinedDescriptor descriptor = ToolHelper.loadToolVersionCombinedDescriptor(toolName, version); if ( descriptor==null ) { throw new IllegalArgumentException("Tool installation not found"); diff --git a/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/_main/cli/cmd/ToolCommands.java b/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/_main/cli/cmd/ToolCommands.java index 0875dc4285..2c7b003b87 100644 --- a/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/_main/cli/cmd/ToolCommands.java +++ b/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/_main/cli/cmd/ToolCommands.java @@ -13,6 +13,7 @@ package com.fortify.cli.tool._main.cli.cmd; import com.fortify.cli.common.cli.cmd.AbstractContainerCommand; +import com.fortify.cli.tool.bugtracker_utility.cli.cmd.ToolBugTrackerUtilityCommands; import com.fortify.cli.tool.fod_uploader.cli.cmd.ToolFoDUploaderCommands; import com.fortify.cli.tool.sc_client.cli.cmd.ToolSCClientCommands; import com.fortify.cli.tool.vuln_exporter.cli.cmd.ToolVulnExporterCommands; @@ -23,6 +24,7 @@ name = "tool", resourceBundle = "com.fortify.cli.tool.i18n.ToolMessages", subcommands = { + ToolBugTrackerUtilityCommands.class, ToolFoDUploaderCommands.class, ToolSCClientCommands.class, ToolVulnExporterCommands.class diff --git a/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/bugtracker_utility/cli/cmd/ToolBugTrackerUtilityCommands.java b/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/bugtracker_utility/cli/cmd/ToolBugTrackerUtilityCommands.java new file mode 100644 index 0000000000..544a285d51 --- /dev/null +++ b/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/bugtracker_utility/cli/cmd/ToolBugTrackerUtilityCommands.java @@ -0,0 +1,31 @@ +/******************************************************************************* + * Copyright 2021, 2022 Open Text. + * + * The only warranties for products and services of Open Text + * and its affiliates and licensors ("Open Text") are as may + * be set forth in the express warranty statements accompanying + * such products and services. Nothing herein should be construed + * as constituting an additional warranty. Open Text shall not be + * liable for technical or editorial errors or omissions contained + * herein. The information contained herein is subject to change + * without notice. + *******************************************************************************/ +package com.fortify.cli.tool.bugtracker_utility.cli.cmd; + +import com.fortify.cli.common.cli.cmd.AbstractContainerCommand; + +import picocli.CommandLine.Command; + +@Command( + name = ToolBugTrackerUtilityCommands.TOOL_NAME, + aliases = {"bugtrackerutility"}, + subcommands = { + ToolBugTrackerUtilityInstallCommand.class, + ToolBugTrackerUtilityListCommand.class, + ToolBugTrackerUtilityUninstallCommand.class + } + +) +public class ToolBugTrackerUtilityCommands extends AbstractContainerCommand { + static final String TOOL_NAME = "bugtracker-utility"; +} diff --git a/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/bugtracker_utility/cli/cmd/ToolBugTrackerUtilityInstallCommand.java b/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/bugtracker_utility/cli/cmd/ToolBugTrackerUtilityInstallCommand.java new file mode 100644 index 0000000000..cfd0a5cfe5 --- /dev/null +++ b/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/bugtracker_utility/cli/cmd/ToolBugTrackerUtilityInstallCommand.java @@ -0,0 +1,53 @@ +/******************************************************************************* + * Copyright 2021, 2023 Open Text. + * + * The only warranties for products and services of Open Text + * and its affiliates and licensors ("Open Text") are as may + * be set forth in the express warranty statements accompanying + * such products and services. Nothing herein should be construed + * as constituting an additional warranty. Open Text shall not be + * liable for technical or editorial errors or omissions contained + * herein. The information contained herein is subject to change + * without notice. + *******************************************************************************/ +package com.fortify.cli.tool.bugtracker_utility.cli.cmd; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; + +import com.fortify.cli.common.output.cli.mixin.OutputHelperMixins; +import com.fortify.cli.tool._common.cli.cmd.AbstractToolInstallCommand; +import com.fortify.cli.tool._common.helper.ToolHelper; +import com.fortify.cli.tool._common.helper.ToolVersionInstallDescriptor; +import com.fortify.cli.tool._common.util.FileUtils; + +import lombok.Getter; +import picocli.CommandLine.Command; +import picocli.CommandLine.Mixin; + +@Command(name = OutputHelperMixins.Install.CMD_NAME) +public class ToolBugTrackerUtilityInstallCommand extends AbstractToolInstallCommand { + @Getter @Mixin private OutputHelperMixins.Install outputHelper; + @Getter private String toolName = ToolBugTrackerUtilityCommands.TOOL_NAME; + + @Override + protected InstallType getInstallType() { + return InstallType.EXTRACT_ZIP; + } + + @Override + protected void postInstall(ToolVersionInstallDescriptor descriptor) throws IOException { + Path binPath = descriptor.getBinPath(); + Files.createDirectories(binPath); + FileUtils.copyResourceToDir(ToolHelper.getResourceFile(getToolName(), "extra-files/bin/FortifyBugTrackerUtility"), binPath); + FileUtils.copyResourceToDir(ToolHelper.getResourceFile(getToolName(), "extra-files/bin/FortifyBugTrackerUtility.bat"), binPath); + + String version = descriptor.getOriginalDownloadDescriptor().getVersion(); + String jarName = String.format("FortifyBugTrackerUtility-%s.jar", version); + + descriptor.getInstallPath().resolve(jarName).toFile().renameTo( + descriptor.getInstallPath().resolve("FortifyBugTrackerUtility.jar").toFile()); + + } +} diff --git a/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/bugtracker_utility/cli/cmd/ToolBugTrackerUtilityListCommand.java b/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/bugtracker_utility/cli/cmd/ToolBugTrackerUtilityListCommand.java new file mode 100644 index 0000000000..97040ed883 --- /dev/null +++ b/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/bugtracker_utility/cli/cmd/ToolBugTrackerUtilityListCommand.java @@ -0,0 +1,26 @@ +/******************************************************************************* + * Copyright 2021, 2023 Open Text. + * + * The only warranties for products and services of Open Text + * and its affiliates and licensors ("Open Text") are as may + * be set forth in the express warranty statements accompanying + * such products and services. Nothing herein should be construed + * as constituting an additional warranty. Open Text shall not be + * liable for technical or editorial errors or omissions contained + * herein. The information contained herein is subject to change + * without notice. + *******************************************************************************/ +package com.fortify.cli.tool.bugtracker_utility.cli.cmd; + +import com.fortify.cli.common.output.cli.mixin.OutputHelperMixins; +import com.fortify.cli.tool._common.cli.cmd.AbstractToolListCommand; + +import lombok.Getter; +import picocli.CommandLine.Command; +import picocli.CommandLine.Mixin; + +@Command(name = OutputHelperMixins.List.CMD_NAME) +public class ToolBugTrackerUtilityListCommand extends AbstractToolListCommand { + @Getter @Mixin private OutputHelperMixins.List outputHelper; + @Getter private String toolName = ToolBugTrackerUtilityCommands.TOOL_NAME; +} diff --git a/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/bugtracker_utility/cli/cmd/ToolBugTrackerUtilityUninstallCommand.java b/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/bugtracker_utility/cli/cmd/ToolBugTrackerUtilityUninstallCommand.java new file mode 100644 index 0000000000..3dc29400a0 --- /dev/null +++ b/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/bugtracker_utility/cli/cmd/ToolBugTrackerUtilityUninstallCommand.java @@ -0,0 +1,26 @@ +/******************************************************************************* + * Copyright 2021, 2023 Open Text. + * + * The only warranties for products and services of Open Text + * and its affiliates and licensors ("Open Text") are as may + * be set forth in the express warranty statements accompanying + * such products and services. Nothing herein should be construed + * as constituting an additional warranty. Open Text shall not be + * liable for technical or editorial errors or omissions contained + * herein. The information contained herein is subject to change + * without notice. + *******************************************************************************/ +package com.fortify.cli.tool.bugtracker_utility.cli.cmd; + +import com.fortify.cli.common.output.cli.mixin.OutputHelperMixins; +import com.fortify.cli.tool._common.cli.cmd.AbstractToolUninstallCommand; + +import lombok.Getter; +import picocli.CommandLine.Command; +import picocli.CommandLine.Mixin; + +@Command(name = OutputHelperMixins.Uninstall.CMD_NAME) +public class ToolBugTrackerUtilityUninstallCommand extends AbstractToolUninstallCommand { + @Getter @Mixin private OutputHelperMixins.Uninstall outputHelper; + @Getter private String toolName = ToolBugTrackerUtilityCommands.TOOL_NAME; +} diff --git a/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/bugtracker-utility/bugtracker-utility.yaml b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/bugtracker-utility/bugtracker-utility.yaml new file mode 100644 index 0000000000..7bc1accd4e --- /dev/null +++ b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/bugtracker-utility/bugtracker-utility.yaml @@ -0,0 +1,6 @@ +#Versions must be listed in descending order +defaultDownloadUrl: https://github.com/fortify-ps/FortifyBugTrackerUtility/releases/download/{toolVersion}/FortifyBugTrackerUtility-{toolVersion}-dist.zip +defaultVersion: 4.12 +versions: + - version: 4.12 + digest: SHA-256:3c5142c63be6a6338f827e26ee79fdb70566dffd5a31680dce05544452c8a56a \ No newline at end of file diff --git a/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/i18n/ToolMessages.properties b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/i18n/ToolMessages.properties index cf3caec282..78d6aeafca 100644 --- a/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/i18n/ToolMessages.properties +++ b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/i18n/ToolMessages.properties @@ -15,6 +15,16 @@ fcli.tool.install.on-digest-mismatch = Action to take if there is a digest misma fcli.tool.uninstall.version = Tool version to uninstall. fcli.tool.output.header.isDefaultVersion = Default +# fcli tool bugtracker-utility +fcli.tool.bugtracker-utility.usage.header = Manage Fortify on Demand (FoD) Uploader installations. (https://github.com/fod-dev/fod-uploader-java) +fcli.tool.bugtracker-utility.install.usage.header = Download and install FortifyBugTrackerUtility. +fcli.tool.bugtracker-utility.install.confirm.0 = Confirm replacing existing FortifyBugTrackerUtility installation. +fcli.tool.bugtracker-utility.install.confirm.1 = If a non-empty destination directory exists, the installation will fail unless this option is specified. +fcli.tool.bugtracker-utility.list.usage.header = List FortifyBugTrackerUtility available and installed versions. If you don't see the latest version(s) listed, please submit an issue on the fcli issue tracker to request adding support for the missing versions. +fcli.tool.bugtracker-utility.uninstall.usage.header = Uninstall FortifyBugTrackerUtility. +fcli.tool.bugtracker-utility.uninstall.usage.description = This command removes a FortifyBugTrackerUtility installation that was previously installed using the 'fcli tool bugtracker-utility install' command. +fcli.tool.bugtracker-utility.uninstall.confirm = Confirm removal of FortifyBugTrackerUtility. + # fcli tool fod-uploader fcli.tool.fod-uploader.usage.header = Manage Fortify on Demand (FoD) Uploader installations. (https://github.com/fod-dev/fod-uploader-java) fcli.tool.fod-uploader.install.usage.header = Download and install Fortify on Demand Uploader. From a9d10d7e5f20e39ee5908de8320a8b60ecdd1067 Mon Sep 17 00:00:00 2001 From: psmf22 <117990501+psmf22@users.noreply.github.com> Date: Fri, 22 Sep 2023 16:08:02 +0200 Subject: [PATCH 4/7] chore: added tests for tools module --- .../tool/ToolBugTrackerUtilitySpec.groovy | 70 +++++++++++++++++++ .../cli/ftest/tool/ToolFoDUploaderSpec.groovy | 69 ++++++++++++++++++ .../cli/ftest/tool/ToolScClientSpec.groovy | 69 ++++++++++++++++++ .../ftest/tool/ToolVulnExporterSpec.groovy | 69 ++++++++++++++++++ 4 files changed, 277 insertions(+) create mode 100644 fcli-other/fcli-functional-test/src/ftest/groovy/com/fortify/cli/ftest/tool/ToolBugTrackerUtilitySpec.groovy create mode 100644 fcli-other/fcli-functional-test/src/ftest/groovy/com/fortify/cli/ftest/tool/ToolFoDUploaderSpec.groovy create mode 100644 fcli-other/fcli-functional-test/src/ftest/groovy/com/fortify/cli/ftest/tool/ToolScClientSpec.groovy create mode 100644 fcli-other/fcli-functional-test/src/ftest/groovy/com/fortify/cli/ftest/tool/ToolVulnExporterSpec.groovy diff --git a/fcli-other/fcli-functional-test/src/ftest/groovy/com/fortify/cli/ftest/tool/ToolBugTrackerUtilitySpec.groovy b/fcli-other/fcli-functional-test/src/ftest/groovy/com/fortify/cli/ftest/tool/ToolBugTrackerUtilitySpec.groovy new file mode 100644 index 0000000000..9ba3f8372a --- /dev/null +++ b/fcli-other/fcli-functional-test/src/ftest/groovy/com/fortify/cli/ftest/tool/ToolBugTrackerUtilitySpec.groovy @@ -0,0 +1,70 @@ +/** + * Copyright 2023 Open Text. + * + * The only warranties for products and services of Open Text + * and its affiliates and licensors ("Open Text") are as may + * be set forth in the express warranty statements accompanying + * such products and services. Nothing herein should be construed + * as constituting an additional warranty. Open Text shall not be + * liable for technical or editorial errors or omissions contained + * herein. The information contained herein is subject to change + * without notice. + */ +package com.fortify.cli.ftest.tool + +import static com.fortify.cli.ftest._common.spec.FcliSessionType.SSC + +import com.fortify.cli.ftest._common.Fcli +import com.fortify.cli.ftest._common.spec.FcliBaseSpec +import com.fortify.cli.ftest._common.spec.FcliSession +import com.fortify.cli.ftest._common.spec.Prefix +import com.fortify.cli.ftest.ssc._common.SSCRoleSupplier +import com.fortify.cli.ftest.ssc._common.SSCRoleSupplier.SSCRole +import spock.lang.AutoCleanup +import spock.lang.Requires +import spock.lang.Shared +import spock.lang.Stepwise + +@Prefix("tool.bugtracker-utility") @Stepwise +class ToolBugTrackerUtilitySpec extends FcliBaseSpec { + + def "install"() { + def args = "tool bugtracker-utility install -y latest" + when: + def result = Fcli.run(args) + then: + verifyAll(result.stdout) { + size()>0 + it[0].replace(' ', '').equals("NameVersionDefaultInstalledInstalldirBindirAction") + it[1].replace(" ", "").contains("YesYes") + it[1].contains("INSTALLED") + } + } + + def "listVersions"() { + def args = "tool bugtracker-utility list" + when: + def result = Fcli.run(args) + then: + verifyAll(result.stdout) { + size()>0 + it[0].replace(' ', '').equals("NameVersionDefaultInstalledInstalldirBindir") + it[1].replace(" ", "").startsWith("bugtracker-utility") + it[1].replace(" ", "").contains("YesYes") + } + } + + def "uninstall"() { + def args = "tool bugtracker-utility uninstall -y default" + when: + def result = Fcli.run(args) + then: + verifyAll(result.stdout) { + size()>0 + it[0].replace(' ', '').equals("NameVersionDefaultInstalledInstalldirBindirAction") + it[1].replace(" ", "").contains("YesNoN/AN/AUNINSTALLED") + } + } + + +} diff --git a/fcli-other/fcli-functional-test/src/ftest/groovy/com/fortify/cli/ftest/tool/ToolFoDUploaderSpec.groovy b/fcli-other/fcli-functional-test/src/ftest/groovy/com/fortify/cli/ftest/tool/ToolFoDUploaderSpec.groovy new file mode 100644 index 0000000000..287cb1422d --- /dev/null +++ b/fcli-other/fcli-functional-test/src/ftest/groovy/com/fortify/cli/ftest/tool/ToolFoDUploaderSpec.groovy @@ -0,0 +1,69 @@ +/** + * Copyright 2023 Open Text. + * + * The only warranties for products and services of Open Text + * and its affiliates and licensors ("Open Text") are as may + * be set forth in the express warranty statements accompanying + * such products and services. Nothing herein should be construed + * as constituting an additional warranty. Open Text shall not be + * liable for technical or editorial errors or omissions contained + * herein. The information contained herein is subject to change + * without notice. + */ +package com.fortify.cli.ftest.tool + +import static com.fortify.cli.ftest._common.spec.FcliSessionType.SSC + +import com.fortify.cli.ftest._common.Fcli +import com.fortify.cli.ftest._common.spec.FcliBaseSpec +import com.fortify.cli.ftest._common.spec.FcliSession +import com.fortify.cli.ftest._common.spec.Prefix +import com.fortify.cli.ftest.ssc._common.SSCRoleSupplier +import com.fortify.cli.ftest.ssc._common.SSCRoleSupplier.SSCRole +import spock.lang.AutoCleanup +import spock.lang.Requires +import spock.lang.Shared +import spock.lang.Stepwise + +@Prefix("tool.fod-uploader") @Stepwise +class ToolFoDUploaderSpec extends FcliBaseSpec { + + def "install"() { + def args = "tool fod-uploader install -y latest" + when: + def result = Fcli.run(args) + then: + verifyAll(result.stdout) { + size()>0 + it[0].replace(' ', '').equals("NameVersionDefaultInstalledInstalldirBindirAction") + it[1].replace(" ", "").contains("YesYes") + it[1].contains("INSTALLED") + } + } + + def "listVersions"() { + def args = "tool fod-uploader list" + when: + def result = Fcli.run(args) + then: + verifyAll(result.stdout) { + size()>0 + it[0].replace(' ', '').equals("NameVersionDefaultInstalledInstalldirBindir") + it[1].replace(" ", "").startsWith("fod-uploader") + it[1].replace(" ", "").contains("YesYes") + } + } + + def "uninstall"() { + def args = "tool fod-uploader uninstall -y default" + when: + def result = Fcli.run(args) + then: + verifyAll(result.stdout) { + size()>0 + it[0].replace(' ', '').equals("NameVersionDefaultInstalledInstalldirBindirAction") + it[1].replace(" ", "").contains("YesNoN/AN/AUNINSTALLED") + } + } + +} diff --git a/fcli-other/fcli-functional-test/src/ftest/groovy/com/fortify/cli/ftest/tool/ToolScClientSpec.groovy b/fcli-other/fcli-functional-test/src/ftest/groovy/com/fortify/cli/ftest/tool/ToolScClientSpec.groovy new file mode 100644 index 0000000000..6938ae059c --- /dev/null +++ b/fcli-other/fcli-functional-test/src/ftest/groovy/com/fortify/cli/ftest/tool/ToolScClientSpec.groovy @@ -0,0 +1,69 @@ +/** + * Copyright 2023 Open Text. + * + * The only warranties for products and services of Open Text + * and its affiliates and licensors ("Open Text") are as may + * be set forth in the express warranty statements accompanying + * such products and services. Nothing herein should be construed + * as constituting an additional warranty. Open Text shall not be + * liable for technical or editorial errors or omissions contained + * herein. The information contained herein is subject to change + * without notice. + */ +package com.fortify.cli.ftest.tool + +import static com.fortify.cli.ftest._common.spec.FcliSessionType.SSC + +import com.fortify.cli.ftest._common.Fcli +import com.fortify.cli.ftest._common.spec.FcliBaseSpec +import com.fortify.cli.ftest._common.spec.FcliSession +import com.fortify.cli.ftest._common.spec.Prefix +import com.fortify.cli.ftest.ssc._common.SSCRoleSupplier +import com.fortify.cli.ftest.ssc._common.SSCRoleSupplier.SSCRole +import spock.lang.AutoCleanup +import spock.lang.Requires +import spock.lang.Shared +import spock.lang.Stepwise + +@Prefix("tool.sc-client") @Stepwise +class ToolScClientSpec extends FcliBaseSpec { + + def "install"() { + def args = "tool sc-client install -y latest" + when: + def result = Fcli.run(args) + then: + verifyAll(result.stdout) { + size()>0 + it[0].replace(' ', '').equals("NameVersionDefaultInstalledInstalldirBindirAction") + it[1].replace(" ", "").contains("YesYes") + it[1].contains("INSTALLED") + } + } + + def "listVersions"() { + def args = "tool sc-client list" + when: + def result = Fcli.run(args) + then: + verifyAll(result.stdout) { + size()>0 + it[0].replace(' ', '').equals("NameVersionDefaultInstalledInstalldirBindir") + it[1].replace(" ", "").startsWith("sc-client") + it[1].replace(" ", "").contains("YesYes") + } + } + + def "uninstall"() { + def args = "tool sc-client uninstall -y default" + when: + def result = Fcli.run(args) + then: + verifyAll(result.stdout) { + size()>0 + it[0].replace(' ', '').equals("NameVersionDefaultInstalledInstalldirBindirAction") + it[1].replace(" ", "").contains("YesNoN/AN/AUNINSTALLED") + } + } + +} diff --git a/fcli-other/fcli-functional-test/src/ftest/groovy/com/fortify/cli/ftest/tool/ToolVulnExporterSpec.groovy b/fcli-other/fcli-functional-test/src/ftest/groovy/com/fortify/cli/ftest/tool/ToolVulnExporterSpec.groovy new file mode 100644 index 0000000000..37340336a8 --- /dev/null +++ b/fcli-other/fcli-functional-test/src/ftest/groovy/com/fortify/cli/ftest/tool/ToolVulnExporterSpec.groovy @@ -0,0 +1,69 @@ +/** + * Copyright 2023 Open Text. + * + * The only warranties for products and services of Open Text + * and its affiliates and licensors ("Open Text") are as may + * be set forth in the express warranty statements accompanying + * such products and services. Nothing herein should be construed + * as constituting an additional warranty. Open Text shall not be + * liable for technical or editorial errors or omissions contained + * herein. The information contained herein is subject to change + * without notice. + */ +package com.fortify.cli.ftest.tool + +import static com.fortify.cli.ftest._common.spec.FcliSessionType.SSC + +import com.fortify.cli.ftest._common.Fcli +import com.fortify.cli.ftest._common.spec.FcliBaseSpec +import com.fortify.cli.ftest._common.spec.FcliSession +import com.fortify.cli.ftest._common.spec.Prefix +import com.fortify.cli.ftest.ssc._common.SSCRoleSupplier +import com.fortify.cli.ftest.ssc._common.SSCRoleSupplier.SSCRole +import spock.lang.AutoCleanup +import spock.lang.Requires +import spock.lang.Shared +import spock.lang.Stepwise + +@Prefix("tool.vuln-exporter") @Stepwise +class ToolVulnExporterSpec extends FcliBaseSpec { + + def "install"() { + def args = "tool vuln-exporter install -y latest" + when: + def result = Fcli.run(args) + then: + verifyAll(result.stdout) { + size()>0 + it[0].replace(' ', '').equals("NameVersionDefaultInstalledInstalldirBindirAction") + it[1].replace(" ", "").contains("YesYes") + it[1].contains("INSTALLED") + } + } + + def "listVersions"() { + def args = "tool vuln-exporter list" + when: + def result = Fcli.run(args) + then: + verifyAll(result.stdout) { + size()>0 + it[0].replace(' ', '').equals("NameVersionDefaultInstalledInstalldirBindir") + it[1].replace(" ", "").startsWith("vuln-exporter") + it[1].replace(" ", "").contains("YesYes") + } + } + + def "uninstall"() { + def args = "tool vuln-exporter uninstall -y default" + when: + def result = Fcli.run(args) + then: + verifyAll(result.stdout) { + size()>0 + it[0].replace(' ', '').equals("NameVersionDefaultInstalledInstalldirBindirAction") + it[1].replace(" ", "").contains("YesNoN/AN/AUNINSTALLED") + } + } + +} From 5779b944b9013b6da9d40f0648073767c74aaf92 Mon Sep 17 00:00:00 2001 From: psmf22 <117990501+psmf22@users.noreply.github.com> Date: Fri, 13 Oct 2023 11:31:10 +0200 Subject: [PATCH 5/7] chore: implement feedback --- .../_common/cli/cmd/AbstractToolUninstallCommand.java | 1 - .../cli/tool/_common/helper/ToolDownloadDescriptor.java | 8 ++++++++ .../com/fortify/cli/tool/_common/helper/ToolHelper.java | 1 + .../cli/cmd/ToolBugTrackerUtilityInstallCommand.java | 2 ++ .../cli/tool/bugtracker-utility/bugtracker-utility.yaml | 2 +- .../com/fortify/cli/tool/fod-uploader/fod-uploader.yaml | 2 +- .../com/fortify/cli/tool/sc-client/sc-client.yaml | 2 +- .../com/fortify/cli/tool/vuln-exporter/vuln-exporter.yaml | 2 +- 8 files changed, 15 insertions(+), 5 deletions(-) diff --git a/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/_common/cli/cmd/AbstractToolUninstallCommand.java b/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/_common/cli/cmd/AbstractToolUninstallCommand.java index 8fdfe4f9ad..c14489f360 100644 --- a/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/_common/cli/cmd/AbstractToolUninstallCommand.java +++ b/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/_common/cli/cmd/AbstractToolUninstallCommand.java @@ -37,7 +37,6 @@ public abstract class AbstractToolUninstallCommand extends AbstractOutputCommand @Override public final JsonNode getJsonNode() { String toolName = getToolName(); - version = ToolHelper.getToolDownloadDescriptor(toolName).getVersionOrDefault(version).getVersion(); ToolVersionCombinedDescriptor descriptor = ToolHelper.loadToolVersionCombinedDescriptor(toolName, version); if ( descriptor==null ) { throw new IllegalArgumentException("Tool installation not found"); diff --git a/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/_common/helper/ToolDownloadDescriptor.java b/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/_common/helper/ToolDownloadDescriptor.java index 78a639aa14..04db92d81d 100644 --- a/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/_common/helper/ToolDownloadDescriptor.java +++ b/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/_common/helper/ToolDownloadDescriptor.java @@ -12,6 +12,7 @@ *******************************************************************************/ package com.fortify.cli.tool._common.helper; +import java.util.Optional; import java.util.stream.Stream; import com.formkiq.graalvm.annotations.Reflectable; @@ -38,6 +39,13 @@ public final Stream getVersionsStream() { } public final ToolVersionDownloadDescriptor getVersion(String version) { + Optional exactMatch = getVersionsStream().filter(v->v.getVersion().equals(version).findFirst(); + if(exactMatch.isPresent()) { + return exactMatch.get(); + } + if(version.indexOf('.')==-1 || version.indexOf('.')==version.lastIndexOf('.')) { + version.concat("."); + } return getVersionsStream() .filter(v->v.getVersion().startsWith(version)) .findFirst().orElseThrow(()->new IllegalArgumentException("Version "+version+" not defined")); diff --git a/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/_common/helper/ToolHelper.java b/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/_common/helper/ToolHelper.java index 69df067b2d..6c2d44ecd2 100644 --- a/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/_common/helper/ToolHelper.java +++ b/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/_common/helper/ToolHelper.java @@ -45,6 +45,7 @@ public static final ToolVersionInstallDescriptor loadToolVersionInstallDescripto } public static final ToolVersionCombinedDescriptor loadToolVersionCombinedDescriptor(String toolName, String version) { + version = getToolDownloadDescriptor(toolName).getVersionOrDefault(version).getVersion(); ToolVersionInstallDescriptor installDescriptor = loadToolVersionInstallDescriptor(toolName, version); return installDescriptor==null ? null : new ToolVersionCombinedDescriptor(toolName, getToolDownloadDescriptor(toolName).getVersion(version), installDescriptor); } diff --git a/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/bugtracker_utility/cli/cmd/ToolBugTrackerUtilityInstallCommand.java b/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/bugtracker_utility/cli/cmd/ToolBugTrackerUtilityInstallCommand.java index cfd0a5cfe5..7d013e7c10 100644 --- a/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/bugtracker_utility/cli/cmd/ToolBugTrackerUtilityInstallCommand.java +++ b/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/bugtracker_utility/cli/cmd/ToolBugTrackerUtilityInstallCommand.java @@ -46,6 +46,8 @@ protected void postInstall(ToolVersionInstallDescriptor descriptor) throws IOExc String version = descriptor.getOriginalDownloadDescriptor().getVersion(); String jarName = String.format("FortifyBugTrackerUtility-%s.jar", version); + //we are renaming the jar to remove the version reference + //this allows us to use pre-written bat/bash wrappers rather than having to dynamically generate those descriptor.getInstallPath().resolve(jarName).toFile().renameTo( descriptor.getInstallPath().resolve("FortifyBugTrackerUtility.jar").toFile()); diff --git a/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/bugtracker-utility/bugtracker-utility.yaml b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/bugtracker-utility/bugtracker-utility.yaml index 7bc1accd4e..112a6ee6f4 100644 --- a/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/bugtracker-utility/bugtracker-utility.yaml +++ b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/bugtracker-utility/bugtracker-utility.yaml @@ -1,4 +1,4 @@ -#Versions must be listed in descending order +#Versions must be listed in descending order to guarantee proper version selection when users provide a partial version number defaultDownloadUrl: https://github.com/fortify-ps/FortifyBugTrackerUtility/releases/download/{toolVersion}/FortifyBugTrackerUtility-{toolVersion}-dist.zip defaultVersion: 4.12 versions: diff --git a/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/fod-uploader/fod-uploader.yaml b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/fod-uploader/fod-uploader.yaml index 19ef7cc8d1..3d1cbfb781 100644 --- a/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/fod-uploader/fod-uploader.yaml +++ b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/fod-uploader/fod-uploader.yaml @@ -1,4 +1,4 @@ -#Versions must be listed in descending order +#Versions must be listed in descending order to guarantee proper version selection when users provide a partial version number defaultDownloadUrl: https://github.com/fod-dev/fod-uploader-java/releases/download/v{toolVersion}/FodUpload.jar defaultVersion: 5.4.0 versions: diff --git a/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/sc-client/sc-client.yaml b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/sc-client/sc-client.yaml index 92c9b36a7d..35e221787b 100644 --- a/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/sc-client/sc-client.yaml +++ b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/sc-client/sc-client.yaml @@ -1,4 +1,4 @@ -#Versions must be listed in descending order +#Versions must be listed in descending order to guarantee proper version selection when users provide a partial version number defaultDownloadUrl: https://tools.fortify.com/scancentral/Fortify_ScanCentral_Client_{toolVersion}_x64.zip defaultVersion: 23.1.0 versions: diff --git a/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/vuln-exporter/vuln-exporter.yaml b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/vuln-exporter/vuln-exporter.yaml index 78926769eb..e8a586ee3b 100644 --- a/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/vuln-exporter/vuln-exporter.yaml +++ b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/vuln-exporter/vuln-exporter.yaml @@ -1,4 +1,4 @@ -#Versions must be listed in descending order +#Versions must be listed in descending order to guarantee proper version selection when users provide a partial version number defaultDownloadUrl: https://github.com/fortify/FortifyVulnerabilityExporter/releases/download/v{toolVersion}/FortifyVulnerabilityExporter.zip defaultVersion: 2.0.3 versions: From 62b62e440943aef7cb1bba51b9e306b15a13ee32 Mon Sep 17 00:00:00 2001 From: psmf22 <117990501+psmf22@users.noreply.github.com> Date: Fri, 13 Oct 2023 11:33:54 +0200 Subject: [PATCH 6/7] chore: forgot to save --- .../cli/tool/_common/helper/ToolDownloadDescriptor.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/_common/helper/ToolDownloadDescriptor.java b/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/_common/helper/ToolDownloadDescriptor.java index 04db92d81d..866e95b838 100644 --- a/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/_common/helper/ToolDownloadDescriptor.java +++ b/fcli-core/fcli-tool/src/main/java/com/fortify/cli/tool/_common/helper/ToolDownloadDescriptor.java @@ -39,11 +39,15 @@ public final Stream getVersionsStream() { } public final ToolVersionDownloadDescriptor getVersion(String version) { - Optional exactMatch = getVersionsStream().filter(v->v.getVersion().equals(version).findFirst(); + if(version.startsWith("v")) { + version.replace("v", ""); + } + Optional exactMatch = getVersionsStream().filter(v->v.getVersion().equals(version)).findFirst(); if(exactMatch.isPresent()) { return exactMatch.get(); } - if(version.indexOf('.')==-1 || version.indexOf('.')==version.lastIndexOf('.')) { + //add a dot to the input to avoid selecting wrong versions (i.e. 2.10 instead of 2.1.x for input "2.1") + if(version.indexOf('.')==-1 || (version.indexOf('.')==version.lastIndexOf('.') && !version.endsWith("."))) { version.concat("."); } return getVersionsStream() From b437d5c6bbfbab5918771efb213d18d02f0bf5b5 Mon Sep 17 00:00:00 2001 From: psmf22 <117990501+psmf22@users.noreply.github.com> Date: Fri, 13 Oct 2023 11:38:53 +0200 Subject: [PATCH 7/7] chore: update vuln-exporter.yaml --- .../com/fortify/cli/tool/vuln-exporter/vuln-exporter.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/vuln-exporter/vuln-exporter.yaml b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/vuln-exporter/vuln-exporter.yaml index e8a586ee3b..10b3236b85 100644 --- a/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/vuln-exporter/vuln-exporter.yaml +++ b/fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/vuln-exporter/vuln-exporter.yaml @@ -1,7 +1,9 @@ #Versions must be listed in descending order to guarantee proper version selection when users provide a partial version number defaultDownloadUrl: https://github.com/fortify/FortifyVulnerabilityExporter/releases/download/v{toolVersion}/FortifyVulnerabilityExporter.zip -defaultVersion: 2.0.3 +defaultVersion: 2.0.4 versions: + - version: 2.0.4 + digest: SHA-256:e4793235e2d1152a98975b5aa3baee4ab440ae08ba03e320ec0c4882cd325a2b - version: 2.0.3 digest: SHA-256:6f3b83b1046dc76038e8fb2121c4dbf5c976fa4cb10c3826d591f6fb31c14bee - version: 2.0.2