Repository navigation
Fix simulation results shown as 'Simulation Failed' in web app - #1453
Open
sparcstation wants to merge 1 commit into
Open
sparcstation wants to merge 1 commit into
sparcstation wants to merge 1 commit into
Conversation
The simulate API returns execution_output as
{status, summary, results, by_host} (since da6bde0), but the detail page
still iterated it as {host: [{technique, output}]}. Iterating the summary
object threw 'not iterable', so successful simulations were shown as
'Simulation Failed'.
Render per-host results from by_host with pass/fail, return code and
stdout/stderr, plus an overall summary. Escape atomic output before
inserting it into the page. Update the SimulateResponse type to match the
API and add a Playwright regression test.
Author
|
Verified manually: with this change, re-running T1197 from the web app against an Azure |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Running an Atomic Red Team simulation from the web app shows "Simulation Failed — t is not iterable" even though the simulation succeeds (API returns 200,
execution_status: success).Since da6bde0 the simulate API returns
execution_outputas{status, summary, results, by_host}(built by_extract_atomic_simulation_output), butapp/src/pages/attack-ranges/[id].astrostill iterated it as the old{host: [{technique, output}]}shape. Iterating thesummaryobject throws, and the catch block reports it as a failed simulation.Changes
by_host(falling back to top-levelresults): per-atomic pass/fail, return code, stdout/stderr (and error on failure), plus an overallx/y succeededline.SimulateResponseinapp/src/utils/api.tsto match the API (execution_status,execution_summary,execution_output).app/tests/e2e/simulate.spec.tsPlaywright regression test using the real response shape.Testing
npm run buildsucceeds; Playwright suite: 6/6 passed (inmcr.microsoft.com/playwright:v1.58.2-noble).developwith "Simulation Failed" and passes with this change.splunk_ad_azurerange (API log:status=success total=1 succeeded=1, UI: "Simulation Failed").