Skip to content

feat: Add --force-delete option to sc-dast scan delete#960

Open
gilseara wants to merge 2 commits intofortify:dev/v3.xfrom
gilseara:feature/sc-dast-force-delete
Open

feat: Add --force-delete option to sc-dast scan delete#960
gilseara wants to merge 2 commits intofortify:dev/v3.xfrom
gilseara:feature/sc-dast-force-delete

Conversation

@gilseara
Copy link
Copy Markdown
Contributor

@gilseara gilseara commented Apr 1, 2026

The goal is to match the functionality offered on the GUI for deleting scans that are problematic (i.e. FailedToPause, etc...), see ForceDelete option below:

image

Summary

  • Adds --force-delete / -f option to fcli sc-dast scan delete command
  • When specified, appends forceDelete=true query parameter to the scan-action API call (/api/v2/scans/<id>?forceDelete=true)
  • Adds a protected updateRequest() hook in AbstractSCDastScanActionCommand so subclasses can customize HTTP requests

Test plan

  • Run fcli sc-dast scan delete <id> without --force-delete — should behave as before
  • Run fcli sc-dast scan delete <id> --force-delete — should include ?forceDelete=true in the API call
  • Run fcli sc-dast scan delete <id> -f — same as above using short flag
  • Verify other scan action commands (pause, resume, complete, etc.) are unaffected

gilseara added 2 commits April 1, 2026 15:57
Add --force-delete / -f option that appends forceDelete=true query
parameter to the scan-action API call, enabling forced deletion of
SC DAST scans via /api/v2/scans/<id>?forceDelete=true.
The kong.unirest.core package is not available in the sc-dast module's
classpath. Replace the updateRequest hook with a getQueryParameters
method that returns a Map, avoiding the dependency issue.
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