calculate sleep time in computed field #193
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
relates to #192
sleep_timeas@computed_fieldand@cached_propertyto the SleepCommandoutput in attackmate.json:
´´´yaml
commands:
type: sleep
seconds: 2
type: sleep
seconds: 10
min_sec: 3
random: true
type: sleep
seconds: 10
min_sec: 3
random: true
´´´
attackmate.json
{"start-datetime": "2026-01-21T12:56:04.045414", "type": "sleep", "cmd": "sleep", "parameters": {"only_if": null, "error_if": null, "error_if_not": null, "loop_if": null, "loop_if_not": null, "loop_count": "3", "exit_on_error": true, "save": null, "background": false, "kill_on_exit": true, "metadata": null, "min_sec": "0", "seconds": "2", "random": false, "sleep_time": 2}}
{"start-datetime": "2026-01-21T12:56:06.047318", "type": "sleep", "cmd": "sleep", "parameters": {"only_if": null, "error_if": null, "error_if_not": null, "loop_if": null, "loop_if_not": null, "loop_count": "3", "exit_on_error": true, "save": null, "background": false, "kill_on_exit": true, "metadata": null, "min_sec": "3", "seconds": "10", "random": true, "sleep_time": 10}}
{"start-datetime": "2026-01-21T12:56:16.058689", "type": "sleep", "cmd": "sleep", "parameters": {"only_if": null, "error_if": null, "error_if_not": null, "loop_if": null, "loop_if_not": null, "loop_count": "3", "exit_on_error": true, "save": null, "background": false, "kill_on_exit": true, "metadata": null, "min_sec": "3", "seconds": "10", "random": true, "sleep_time": 3}}
attackmate.log:
2026-01-21 12:56:04 INFO - Sleeping 2 seconds
2026-01-21 12:56:06 INFO - Sleeping 10 seconds
2026-01-21 12:56:16 INFO - Sleeping 3 seconds