-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for aborting scans to the API #176
Conversation
Hi @chrisgacsal, thanks for the thoughts here. I think we're going along the same lines, I hadn't written much about the abort case in https://cisco-eti.atlassian.net/wiki/spaces/PA/pages/8192001/Persistent+Scan+Orchestrator but my expectation is that it would behave exactly as documented for the timeout scenario, except the trigger would be the user.
With that in mind I don't think we need a separate ABORTED state for the TargetScan. If we want the metadata for why the TargetScan failed, we could perhaps follow the same design as we had for Scan's with a state and reason. So TargetScan would have reasons like:
If the TargetScan gets canceled because the parent Scan has timed out or was aborted, then the TargetScan reason could be Aborted, but if the individual TargetScan times out then it would be TimedOut. Or we could have an extra reason "ParentTimedOut" then it would be really informative. |
@sambetts-cisco I have requested access to Confluent, so I'll get back to you after I had a chance to review the document from above. |
@sambetts-cisco I have updated the PR according to what we discussed last week. |
9a90d7e
to
aabc864
Compare
* allow marking Scan state as `Aborted` indicating that the Scan needs to be cancelled and cleaned up. Orchestrator is responsible for watching Scans which requested to be aborted and setting the `stateReason` to `Aborted`. State transition: Pending > Discovered > InProgress > Done > Failed > Aborted > Failed > Aborted > Failed * allow marking `state` of a TargetScan to `ABORTED` to allow the `cli` to detect and act upon cancellation events (e.g. stopping scanners, reporting partial results, etc).
Description
This change is the first step towards implementing the functionality to allow cancelling ongoing scans:
allow marking Scan state as
Aborting
indicating that the Scan needs to be cancelled and cleaned up. Orchestrator is responsible for watching Scans which requested to be aborted and setting thestateReason
toAborted
.State transition:
state
of a TargetScan toABORTED
to allow thecli
to detect and act upon cancellation events (e.g. stopping scanners, reporting partial results, etc).Type of Change
[ ] Bug Fix
[x] New Feature
[ ] Breaking Change
[ ] Refactor
[ ] Documentation
[ ] Other (please describe)
Checklist