Skip to content

Services Scan Support#772

Open
orto17 wants to merge 9 commits into
jfrog:devfrom
orto17:missconfiguration-service
Open

Services Scan Support#772
orto17 wants to merge 9 commits into
jfrog:devfrom
orto17:missconfiguration-service

Conversation

@orto17

@orto17 orto17 commented Jun 1, 2026

Copy link
Copy Markdown
Contributor
  • The pull request is targeting the dev branch.
  • The code has been validated to compile successfully by running go vet ./....
  • The code has been formatted properly using go fmt ./....
  • All static analysis checks passed.
  • All tests have passed. If this feature is not already covered by the tests, new tests have been added.
  • Updated the Contributing page / ReadMe page / CI Workflow files if needed.
  • All changes are detailed at the description. if not already covered at JFrog Documentation, new documentation have been added.

depends on:

image image

@orto17 orto17 changed the base branch from main to dev June 1, 2026 12:24

@attiasas attiasas left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice Job! see my comments.

  • looks like in general the implementation should be adjusted to be aligned with other sub-scans flow
  • IMO, if we decided that Secrets and Services are different and display diff, it should not have combined Exposure logic in the code as well...
  • You are missing integration tests at audit_test.go (or git_test.go) for project that has at least one Services Scan issue detected
  • Make sure you are aligned with dev branch changes

Comment thread cli/docs/flags.go
Watches: components.NewStringFlag(Watches, "Comma-separated list of Xray watches to determine violations. Supported violations are CVEs, operational risk, and Licenses. Incompatible with --project and --repo-path."),
RepoPath: components.NewStringFlag(RepoPath, "Artifactory repository path, to enable Xray to determine violations accordingly. The command accepts this option only if the --project and --watches options are not provided. If none of the three options are provided, the command will show all known vulnerabilities."),
Snippet: components.NewBoolFlag(Snippet, "Set to true if you'd like to enables snippet-level detection to identify copied code from third-party components and surface related license violations.", components.SetHiddenBoolFlag()),
Services: components.NewBoolFlag(Services, "Set to true to enable services detection.", components.SetHiddenBoolFlag()),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do we want this to be similar to --sbom/--license/--snippet flags? or grouped with --secrets/--sca/--iac... kind of flags?.

right now seems similar to the first group but PR shows like the other type...

make sure description is approbed by tech writer, see similar flags for template

Comment thread cli/utils.go
Comment on lines +165 to +167
func validateServicesDetection(c *components.Context) (bool, error) {
return isServicesDetectionEnabled(c), nil
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

do we need this func? don't see the point here

Comment thread cli/scancommands.go
if err != nil {
return "", "", nil, nil, err
}
includeServicesDetection, err := validateServicesDetection(c)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

should be adjusted/set with getSubScansToPreform

Comment thread cli/gitcommands.go
if err != nil {
return err
}
includeServicesDetection, err := validateServicesDetection(c)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

should be adjusted/set with getSubScansToPreform

Comment thread cli/utils.go
Comment on lines +158 to +163
func isServicesDetectionEnabled(c *components.Context) bool {
if !c.IsFlagSet(flags.Services) {
return false
}
return c.GetBoolFlagValue(flags.Services)
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is a flag for the scanner that produced issues, should be set/fetch value in getSubScansToPreform

Location
Finding string `json:"finding,omitempty"`
Fingerprint string `json:"fingerprint,omitempty"`
Outcomes string `json:"outcomes,omitempty"`

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

make sure about this attribute...

// Properties for secret validation
secretValidationPropertyTemplate = "jfrog:secret-validation:status:" + results.LocationIdTemplate
secretValidationMetadataPropertyTemplate = "jfrog:secret-validation:metadata:" + results.LocationIdTemplate
servicesOutcomesPropertyTemplate = "jfrog:services:outcomes:" + results.LocationIdTemplate

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

why do we need this? outcome has locations?... please validate

Comment on lines +213 to +215
if len(runs) == 0 {
return
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
if len(runs) == 0 {
return
}

not needed

Comment on lines +22 to +28
type ServicesScanManager struct {
scanner *jas.JasScanner

resultsToCompareFileName string
configFileName string
resultsFileName string
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Adjust the file to have 2 ways to run (similar to the other scanners)

  • Deprecated with apps config module
  • New with scantarget (and config profile)

see sastscanner.go for more details:

func (sastScanManager *SastScanManager) runSastScan(params SastScanParams) (vulnerabilitiesResults []*sarif.Run, violationsResults []*sarif.Run, err error) {
	if params.Target.DeprecatedAppsConfigModule == nil {
		return sastScanManager.scanner.Run(sastScanManager, params.Target)
	}
	return sastScanManager.scanner.DeprecatedRun(sastScanManager, *params.Target.DeprecatedAppsConfigModule, params.Target.GetCentralConfigExclusions(utils.SastScan))
}

Comment on lines +57 to +61
log.Debug("Diff mode - Services results to compare provided")
manager.resultsToCompareFileName = filepath.Join(scannerTempDir, "target.sarif")
if err = jas.SaveScanResultsToCompareAsReport(manager.resultsToCompareFileName, resultsToCompare...); err != nil {
return
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Make sure Diff logic is implemented in the AM (so Frogbot Scan PR can show only added issues for services).

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