Skip to content

Conversation

@attiasas
Copy link
Collaborator

@attiasas attiasas commented Dec 15, 2025

  • All tests have passed. If this feature is not already covered by the tests, new tests have been added.
  • The pull request is targeting the master branch.
  • The code has been validated to compile successfully by running go vet ./....
  • The code has been formatted properly using go fmt ./....

Depends on:

Note: There is still an issue parsing flags/arguments.
This PR only fixing that the inner docker scan cmd flags will be parsed as flags and not arguments.
For the scan to work you need to run: docker scan <img> [flags] (argements before flags)

return true
}

func getDockerFlags() []cli.Flag {
Copy link
Contributor

Choose a reason for hiding this comment

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

no test ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

added

// Avoiding flag duplication
for _, f := range converted {
if !flagNames.Exists(f.GetName()) {
flagList = append(flagList, f)
Copy link
Contributor

Choose a reason for hiding this comment

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

why not use flagNames in the whole method and then convert it to slice ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

if we do it, when converting to slice you will need to go over the 2 sources of flags to locate where it is.
flagNames used only so we can validate quick if a flag already exist. I can switch it to just check if the slice contains the value and remove flagNames from the func... IMO its ok like this

@github-actions
Copy link
Contributor

👍 Frogbot scanned this pull request and did not find any new security issues.


@attiasas attiasas requested a review from RemiBou December 30, 2025 07:53
@ehl-jf
Copy link
Contributor

ehl-jf commented Dec 31, 2025

@attiasas What about creating a new function like https://github.com/jfrog/jfrog-cli/blob/master/buildtools/cli.go#L1131 for example extractDockerScanOptionsFromArgs and adding additional options to securityCLI.DockerScan to provide the security's specific options ?

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.

3 participants