Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions core/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,27 @@ def run_test(
cleanup_cmd_raw, input_args, test.get("input_arguments", {}), test["executor_type"]
) if cleanup_cmd_raw else None

# Integrity check: only allow commands derived from the selected embedded
# atomic template and its declared input arguments.
expected_command = substitute_variables_safe(
test["command"], input_args, test.get("input_arguments", {}), test["executor_type"]
)
if command != expected_command:
return {
"success": False,
"error": "Command integrity check failed for selected atomic test.",
}

if cleanup_cmd_raw:
expected_cleanup = substitute_variables_safe(
cleanup_cmd_raw, input_args, test.get("input_arguments", {}), test["executor_type"]
)
if cleanup_command != expected_cleanup:
return {
"success": False,
"error": "Cleanup command integrity check failed for selected atomic test.",
}

executed_at = datetime.utcnow().isoformat() + "Z"

# Execute
Expand Down
Loading