Skip to content
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

Making getstatus_scan function name more accurate #3

Open
agrandville opened this issue Jun 18, 2020 · 0 comments
Open

Making getstatus_scan function name more accurate #3

agrandville opened this issue Jun 18, 2020 · 0 comments

Comments

@agrandville
Copy link
Contributor

Getting functions are idempotents functions, such functions can be called several times and the result should be the same because they does not modify resources.
In class PatrowlEngine, calling getstatus_scan function will overwrite scan.status to FINISHED if all threads are ended.
It would be usefull to use this state to let engine forward errors to the manager console (eg: process missing, bad parameters,...)

ID Severity Message Type Timestamp
6753 ERROR [EngineTasks/startscan_task/86a1aa2e-c087-4c20-bfb4-7e4df73c59ab] CheckStatus - response_status_code=200, response_status=ERROR, response_details=scan#208 options parsing failed ('unknown option', 'check_protocols'). Task failed. ERROR 2020/06/18-09:14:26
6749 INFO [EngineTasks/startscan_task/86a1aa2e-c087-4c20-bfb4-7e4df73c59ab] Engine 'TESTSSL01_ENGINE' has been selected. INFO 2020/06/18-09:14:26
6748 INFO [EngineTasks/startscan_task/86a1aa2e-c087-4c20-bfb4-7e4df73c59ab] Starting task... INFO 2020/06/18-09:14:26

to avoid compatibility issue with current version, the only accepted return values are SCANNING or FINISHED, I proposed to just add a third state 'ERROR' and to add support for this state in PatrowlManager. Reason will be 'undefined' in this version.

A new branch, with a rewrite getstatus_scan who returns new stream like this one:

{
  "finished_at": 1592464466470,
  "reason": "scan#208 options parsing failed ('unknown option', 'check_protocols')",
  "status": "ERROR"
}

a new method updatestatus_scan who return same response and update scan status.

agrandville referenced this issue in agrandville/PatrowlEnginesUtils Jun 18, 2020
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

No branches or pull requests

1 participant