Skip to content

Making getstatus_scan function name more accurate #3

@agrandville

Description

@agrandville

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions