Added support for importing SARIF files and specifying download format for SCA scans#941
Open
kadraman wants to merge 2 commits intofortify:dev/v3.xfrom
Open
Added support for importing SARIF files and specifying download format for SCA scans#941kadraman wants to merge 2 commits intofortify:dev/v3.xfrom
kadraman wants to merge 2 commits intofortify:dev/v3.xfrom
Conversation
…ing SAST scan results in SARIF format feat: `fcli fod oss-scan download`: Add `--format` option to support selecting CycloneDX or SPDX SBOM formats feat: `fcli fod oss-scan download-latest`: Add `--format` option to support selecting CycloneDX or SPDX SBOM formats
There was a problem hiding this comment.
Pull request overview
This PR extends the FoD module to support importing SAST results from SARIF and to allow selecting an SBOM download format for Open Source scan downloads.
Changes:
- Added a new
fod sast-scan import-sarifcommand wired to a new FoD endpoint constant. - Added
--formatoption support forfod oss-scan downloadanddownload-latest(SBOM format query parameter). - Updated FoD i18n messages and introduced an
SBOMFormatenum plus scan descriptor attribute mapping support.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| fcli-core/fcli-fod/src/main/resources/com/fortify/cli/fod/i18n/FoDMessages.properties | Adds help/i18n strings for SARIF import and OSS download format options. |
| fcli-core/fcli-fod/src/main/java/com/fortify/cli/fod/sast_scan/cli/cmd/FoDSastScanImportSarifCommand.java | New SARIF import command implementation for SAST scans. |
| fcli-core/fcli-fod/src/main/java/com/fortify/cli/fod/sast_scan/cli/cmd/FoDSastScanCommands.java | Registers the new SARIF import subcommand. |
| fcli-core/fcli-fod/src/main/java/com/fortify/cli/fod/oss_scan/cli/cmd/FoDOssScanDownloadLatestCommand.java | Adds --format option and appends the query parameter to the download request. |
| fcli-core/fcli-fod/src/main/java/com/fortify/cli/fod/oss_scan/cli/cmd/FoDOssScanDownloadCommand.java | Adds --format option and appends the query parameter to the download request. |
| fcli-core/fcli-fod/src/main/java/com/fortify/cli/fod/_common/util/FoDEnums.java | Adds SBOMFormat enum used by the new download options. |
| fcli-core/fcli-fod/src/main/java/com/fortify/cli/fod/_common/scan/helper/FoDScanDescriptor.java | Adds attributes and an attributesAsMap() convenience method. |
| fcli-core/fcli-fod/src/main/java/com/fortify/cli/fod/_common/rest/FoDUrls.java | Adds static scan SARIF import URL constant. |
| fcli-core/fcli-fod/src/main/java/com/fortify/cli/fod/_common/output/cli/mixin/FoDOutputHelperMixins.java | Adds ImportSarif output helper mixin/command name. |
You can also share your feedback on Copilot code review. Take the survey.
fcli-core/fcli-fod/src/main/java/com/fortify/cli/fod/_common/scan/helper/FoDScanDescriptor.java
Outdated
Show resolved
Hide resolved
...e/fcli-fod/src/main/java/com/fortify/cli/fod/oss_scan/cli/cmd/FoDOssScanDownloadCommand.java
Outdated
Show resolved
Hide resolved
...-fod/src/main/java/com/fortify/cli/fod/oss_scan/cli/cmd/FoDOssScanDownloadLatestCommand.java
Outdated
Show resolved
Hide resolved
...-fod/src/main/java/com/fortify/cli/fod/oss_scan/cli/cmd/FoDOssScanDownloadLatestCommand.java
Outdated
Show resolved
Hide resolved
...e/fcli-fod/src/main/java/com/fortify/cli/fod/oss_scan/cli/cmd/FoDOssScanDownloadCommand.java
Outdated
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removed Scan Attributes functionality until implementation is fixed.