Add --dry-run flag to CLI (#1967)#2046
Conversation
utksh1
left a comment
There was a problem hiding this comment.
Please rebase this CLI dry-run branch and add focused tests showing it prints the resolved command, never executes the scanner, preserves validation/safe-mode behavior, and returns a useful error for invalid inputs.
utksh1
left a comment
There was a problem hiding this comment.
Please add focused CLI tests for --dry-run: it must print the resolved command, return nonzero for an unknown plugin or invalid command, avoid task creation/execution, and reflect Docker wrapping when enabled. Rebase on main afterward.
utksh1
left a comment
There was a problem hiding this comment.
Please add focused CLI tests for --dry-run: it must print the resolved command, return nonzero for an unknown plugin or invalid command, avoid task creation/execution, and reflect Docker wrapping when enabled. Rebase on main afterward.
utksh1
left a comment
There was a problem hiding this comment.
Please rebase this CLI dry-run branch and add focused tests showing it prints the resolved command, never executes the scanner, preserves validation/safe-mode behavior, and returns a useful error for invalid inputs.
8d4d8cd to
a9afc64
Compare
|
I've completed the
|
Hey! This PR adds a handy
--dry-runflag to the CLI as requested in #1967.It makes it super easy to preview exactly what command a plugin is going to run under the hood, without actually firing off a scan or saving a task to the database.
Here's how it works:
--dry-runargument to thesecuscan scanparser incli.py.plugin_managerto build the command with all the interpolated inputs.docker runprefix (with memory/cpu limits) that theexecutorwould normally use.It's great for debugging plugins. Let me know what you think!