Skip to content

Add --dry-run flag to CLI (#1967)#2046

Open
YUVRAJ-SINGH-3178 wants to merge 2 commits into
utksh1:mainfrom
YUVRAJ-SINGH-3178:feature-1967-cli-dry-run
Open

Add --dry-run flag to CLI (#1967)#2046
YUVRAJ-SINGH-3178 wants to merge 2 commits into
utksh1:mainfrom
YUVRAJ-SINGH-3178:feature-1967-cli-dry-run

Conversation

@YUVRAJ-SINGH-3178

Copy link
Copy Markdown
Contributor

Hey! This PR adds a handy --dry-run flag 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:

  • Added the --dry-run argument to the secuscan scan parser in cli.py.
  • If the flag is passed, it uses the plugin_manager to build the command with all the interpolated inputs.
  • It also fully simulates the Docker sandbox environment by prepending the exact docker run prefix (with memory/cpu limits) that the executor would normally use.
  • Finally, it just prints the final resolved command to the terminal and cleanly exits with a 0 code.

It's great for debugging plugins. Let me know what you think!

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.

1 participant