Skip to content

feat: Support Sourceanalyzer tool registration and performing local scans via command and fcli action#935

Open
SangameshV wants to merge 1 commit intodev/v3.xfrom
feat/v3.x/sourceanalyzer-local-scan
Open

feat: Support Sourceanalyzer tool registration and performing local scans via command and fcli action#935
SangameshV wants to merge 1 commit intodev/v3.xfrom
feat/v3.x/sourceanalyzer-local-scan

Conversation

@SangameshV
Copy link
Contributor

  • Added full Source Analyzer tool workflow:

    • fcli tool sourceanalyzer register
    • fcli tool sourceanalyzer list
    • fcli tool sourceanalyzer get
    • fcli tool sourceanalyzer run
    • fcli tool sourceanalyzer update-rule-packs (runs fortifyupdate to refresh rulepacks)
  • Introduced SSC action to drive local SCA and SSC integration:

    • Performs local Source Analyzer translation and scan using a build ID, producing an FPR
    • Optionally uploads the generated FPR to a specified SSC application version
    • Supports CI-friendly options for extra SCA arguments and SSC behavior

@SangameshV SangameshV self-assigned this Mar 3, 2026
var optDefinition = ToolDefinitionsHelper.tryGetToolDefinitionRootDescriptor(toolName);

//TODO - Check the need of definitions for other tools as well, and if this is the best way to handle this (e.g. should we check for the presence of definitions in the list command instead?)
if (tool == Tool.SOURCE_ANALYZER && optDefinition.isEmpty()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't want hardcoded tool names in generic base classes. Instead, either:

  • Introduce an overridable method like requireToolDefinitions that returns true by default, and override this method in ToolSourceAnalyzer* commands to return false
  • Introduce this method in IToolHelper, such that base classes can call for example getTool().requiresToolDefinitions()

I think I like the latter better, as then we have centralized configuration as to whether tool definitions are required, and any abstract base class can check for this info. For example, if we ever update any other base classes with optional tool definitions behavior, we only need to update the base class, not the individual command classes.

Not completely sure whether require(s)ToolDefinitions is the best method name to describe the intended behavior; better names are welcome.

Same comment applies to other generic classes like AbstractToolRunCommand, ToolInstallationsResolver, ToolRegistrationHelper, ...

* @author Sangamesh Vijaykumar
*/
@Command(name = "update-rule-packs")
public class ToolSourceAnalyzerUpdateRulePacksCommand extends AbstractToolRunCommand {
Copy link
Contributor

@rsenden rsenden Mar 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we extend from AbstractToolRunCommand, I assume we have the standard functionality for passing FortifyUpdate options? Please confirm.

Also, I think update-rules is a shorter and still descriptive command name.

@@ -0,0 +1,119 @@
# yaml-language-server: $schema=https://fortify.github.io/fcli/schemas/action/fcli-action-schema-dev-2.x.json

author: Fortify
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's skip adding this action for now, I need to think more about how to best fit this into fcli for all possible scenarios (FoD/SSC, local translation, local scan, ...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants