NetScaler LLM Triage
Full Recipe¶
Shared by: Nathan St. Amour
This recipe detects an exploit chain against NetScaler appliances with standing queries, and calls language models from the same Cypher queries where the input is free text or the output is for a person. llm.prompt reads helpdesk tickets and a vendor advisory into the graph and writes a brief for each incident. llm.decide scores each sign-in username and chooses whether an incident pages the on-call responder. The graph queries still do the detection.
NetScaler LLM Triage Recipe
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 | |
The recipe needs Quine 2.2.1 or later, the first release that includes the LLM procedures.
The LLM procedures are a preview feature
The API and behavior of llm.prompt, llm.decide, and the quine.llm configuration may change in future versions.
This recipe makes paid calls to two model services
You need an account and an API key for each service: Amazon Bedrock, for a Claude model, and TypeSafe, for the hosted Jev decision model. A full run in which no call is retried makes 199 llm.decide calls and 13 llm.prompt calls.
Scenario¶
In the sample data, an attacker sends crafted SAML sign-in requests to NetScaler gateway appliances. On a vulnerable appliance, a request crashes nsaaad, the authentication process, and VPN and single sign-on stop until the process restarts. On two appliances the attacker then writes files, and each of those appliances opens an outbound connection to the attacker's callback host. Users who are locked out file helpdesk tickets. Later in the day, the vendor publishes a security advisory that names the callback host and the dropped files.
This is the recipe behind the thatDot post LLM Procedures in Quine. It follows an earlier thatDot post that detects this attack with graph queries alone. The detections here are the same graph queries. The model calls are at the edges of the graph, where the input is free text or the output is for a person:
| Work | Done by |
|---|---|
| Attribute each crash to the addresses that signed in before it, promote repeat offenders to attacker infrastructure, alert on repeated crashes, detect the kill chain, and assemble an incident | Standing queries |
| Score how much each sign-in username looks like an attack payload | llm.decide, in an ingest query. The score is evidence for an analyst, and no detection reads it. |
| Read each helpdesk ticket: the service it concerns, the symptom, and whether it reports an outage | llm.prompt, in an ingest query |
| Read the vendor advisory and extract its indicators of compromise (IOCs) | llm.prompt, in an ingest query |
| Choose whether an incident pages the on-call responder or becomes a ticket | llm.decide, in a standing query output |
| Write a brief for each incident from the evidence the graph collected | llm.prompt, in a standing query output |
The sample data is synthetic
CVE-2026-88779 is a real vulnerability. The advisory in the sample data is fictional demo data, and so are the users, hosts, and events. Every IP address is in a range reserved for documentation.
Sample Data¶
The sample data and the model configuration file are in one zip file. Download netscaler-llm-triage.zip and unpack it in the directory where you run Quine:
curl -O https://quine-recipe-public.s3.us-west-2.amazonaws.com/netscaler-llm-triage.zip
unzip netscaler-llm-triage.zip
The zip file unpacks to quine.conf and a data directory. The recipe reads the data files by relative path, so run Quine from the directory that holds data, with the recipe file next to it.
| File | Records | Contents |
|---|---|---|
data/auth.ndjson |
197 | SAML sign-in log |
data/http.ndjson |
81 | HTTP access log |
data/sysevents.ndjson |
32 | Process crashes, process restarts, and file writes |
data/egress.ndjson |
52 | Firewall log of outbound connections from the appliances |
data/helpdesk.ndjson |
10 | Helpdesk tickets, as free text |
data/advisory.ndjson |
1 | The vendor advisory, as free text |
data/live.ndjson |
0 | Empty. You append the advisory to this file while the recipe runs. |
The events cover one day, 2026-10-29, on five appliances. Two attacker addresses compromise ns-gw-01 and ns-gw-03, and one of them also probes ns-aaa-01, which does not crash.
How it Works¶
Ingest Streams Build the Graph¶
Six ingest streams read the files. Each stream gives a node its id with idFrom, so an address or an appliance that appears in several logs is one node in the graph.
| Ingest stream | Reads | Writes | Model call |
|---|---|---|---|
saml-auth |
data/auth.ndjson |
(IP)-[:SENT]->(AuthEvent)-[:TO]->(Appliance) |
llm.decide, once per record |
http-access |
data/http.ndjson |
(IP)-[:REQUESTED]->(HttpRequest)-[:TO]->(Appliance) |
None |
system-events |
data/sysevents.ndjson |
(SysEvent)-[:ON]->(Appliance) |
None |
firewall-egress |
data/egress.ndjson |
(Appliance)-[:CONNECTED_TO]->(Outbound)-[:DEST]->(IP) |
None |
helpdesk |
data/helpdesk.ndjson |
Ticket nodes, and (Ticket)-[:REPORTS]->(Service) for outage reports |
llm.prompt, once per ticket |
live |
data/live.ndjson |
The Advisory node, and an IOC label on each address the advisory names |
llm.prompt, once per advisory |
The saml-auth stream asks the decision model one yes-no question about each username:
- name: saml-auth
source:
type: File
path: data/auth.ndjson
format:
type: JsonL
parallelism: 8
query: |
MATCH (ip), (auth), (app)
WHERE id(ip) = idFrom('ip', $that.src_ip)
AND id(auth) = idFrom('auth', $that.event_id)
AND id(app) = idFrom('appliance', $that.appliance)
CALL llm.decide(
{username: $that.username},
{payload: {type: "yes-no",
instructions: "Is this authentication username a machine-generated or injection-style string rather than a name a person would sign in with?"}}
) YIELD answers
SET ip.ip = $that.src_ip, ip: IP,
auth.username = $that.username,
auth.endpoint = $that.endpoint,
auth.ts = $that.ts,
auth.epoch = $that.epoch,
auth.suspicionScore = answers.payload.probability,
auth.payloadShaped = answers.payload.probability >= 0.8,
auth: AuthEvent,
app.host = $that.appliance, app: Appliance
CREATE (ip)-[:SENT]->(auth)-[:TO]->(app)
The answer to a yes-no question is the probability of yes. The query stores it as suspicionScore and sets payloadShaped when it is at least 0.8. The query sets the threshold, and no standing query reads either property.
The helpdesk stream sends each ticket's text to the completion model with a schema of three fields:
- name: helpdesk
source:
type: File
path: data/helpdesk.ndjson
format:
type: JsonL
query: |
MATCH (t) WHERE id(t) = idFrom('ticket', $that.ticketId)
CALL llm.prompt(
'You are reading one helpdesk ticket, provided in the data block. Decide which service it concerns: "vpn" for remote access or VPN connectivity, "sso" for single sign-on or login portals, or "other". Summarize the symptom in at most eight words. Decide whether the ticket plausibly reports an outage or failure of remote access or sign-on (outageReport). Base everything only on the ticket text.',
{ticket: $that.text},
{schema: {
type: 'object', additionalProperties: false,
required: ['service', 'symptom', 'outageReport'],
properties: {
service: {type: 'string', maxLength: 10},
symptom: {type: 'string', maxLength: 80},
outageReport: {type: 'boolean'}
}
}}
) YIELD response
SET t.ticketId = $that.ticketId, t.user = $that.user,
t.ts = $that.ts, t.epoch = $that.epoch, t.text = $that.text,
t.service = response.service, t.symptom = response.symptom,
t.outageReport = response.outageReport,
t.extracted = response IS NOT NULL,
t: Ticket
WITH t, response
WHERE response IS NOT NULL AND response.outageReport = true AND response.service IN ['vpn', 'sso']
MATCH (svc) WHERE id(svc) = idFrom('service', response.service)
SET svc.name = response.service, svc: Service
CREATE (t)-[:REPORTS]->(svc)
// A ticket can arrive after the incident's brief already fired. This side writes the
// same CORROBORATED_BY edge for that order; Quine edges are a set, so a ticket the
// brief already linked is not duplicated.
WITH t, svc
MATCH (svc)<-[:AFFECTS]-(inc:Incident)
WHERE abs(t.epoch - inc.epoch) <= 2700000
CREATE (inc)-[:CORROBORATED_BY]->(t)
The model returns JSON that conforms to the schema, and the rest of the query decides what to write:
- Every ticket: the extracted fields become properties on the
Ticketnode, next to the raw text. When the answer does not conform to the schema,responseisnull, andextractedisfalseon that ticket. - An outage report about
vpnorsso: the ticket gets aREPORTSedge to thatServicenode. - An outage report that arrives after its incident exists: the last clause links the ticket to an incident whose time is within 45 minutes of it.
The system-events stream sets maxPerSecond: 2, so that the standing queries finish attributing one crash before the next crash arrives.
Standing Queries Detect the Attack¶
Six standing queries run in a chain. Each one after the first matches on something an earlier one wrote.
| Standing query | Matches | Its output writes |
|---|---|---|
crash-watch |
Each crash of nsaaad |
A PRECEDED_CRASH edge from each address that signed in to the appliance in the 60 seconds before the crash. An AttackerInfra label on an address that preceded at least 2 crashes with at least 2 requests. An Alert node on the third crash of one appliance inside 15 minutes. |
auth-mirror |
Each sign-in event | The same attribution and promotion, started from the sign-in. Whichever log arrives last completes the edge. |
attacker-pivot |
Each AttackerInfra address |
An assessment on every appliance the address contacted: compromised, or probed, no crash: verify build. |
kill-chain |
A file write on an appliance that has an attributed crash | An Alert node and an Incident node, when the write came after the first attributed crash and the appliance then connected to a destination that has the IOC label or that no healthy appliance has contacted. |
incident-brief |
Each Incident node |
The severity from llm.decide and the brief from llm.prompt, as properties on the incident. |
page-on-call |
Each incident whose severity is page |
Nothing. It prints the brief to standard output. |
The first five send their results to a Drop destination, because the Cypher query in each output does the work by writing to the graph.
The kill-chain pattern matches on the AttackerInfra label and the PRECEDED_CRASH edge, which the earlier standing queries write:
- name: kill-chain
pattern:
type: Cypher
query: >
MATCH (ip:AttackerInfra)-[:PRECEDED_CRASH]->(c:SysEvent)-[:ON]->(app:Appliance)<-[:ON]-(fw:SysEvent)
WHERE fw.event_type = 'file_write'
RETURN DISTINCT id(fw) AS id
The pattern therefore completes only after attribution and promotion have, whatever order the raw logs arrive in.
The Models Choose the Severity and Write the Brief¶
The kill-chain output sets the Incident label last, after the incident's edges exist. The incident-brief output then collects what the graph holds about the incident into one map, evidence. Both model calls receive that map and nothing else. This is the end of that output's query, from the point where it builds the map:
WITH inc, app,
{appliance: app.host, attackers: attackers,
attributedCrashes: attributedCrashes, crashTimes: crashTimes,
droppedFiles: droppedFiles, egressTo: egressTo,
egressIsKnownIoc: iocContacts > 0,
userOutageReportsInWindow: userReports} AS evidence
CALL llm.decide(
evidence,
{severity: {type: "choice", options: ["page", "ticket"],
instructions: "Given this evidence about one authentication gateway appliance, should the on-call responder be paged immediately (page), or is a tracked ticket during business hours enough (ticket)?"}}
) YIELD answers
CALL llm.prompt(
'You are writing an incident brief for a security responder. The data block holds evidence a streaming graph assembled about one appliance: the attacker addresses, how many service crashes were attributed to them and when, the files dropped afterward, the outbound callback destination, and how many users reported outages in the window. State only facts present in the evidence; never invent counts, times, addresses, or causes. The timeline entries must be chronological and one sentence each. Give at most eight timeline entries and at most five recommended actions.',
evidence,
{schema: {
type: 'object', additionalProperties: false,
required: ['title', 'summary', 'timeline', 'recommendedActions'],
properties: {
title: {type: 'string', maxLength: 90},
summary: {type: 'string', maxLength: 600},
timeline: {type: 'array', maxItems: 8, items: {type: 'string', maxLength: 160}},
recommendedActions: {type: 'array', maxItems: 5, items: {type: 'string', maxLength: 120}}
}
}}
) YIELD response
SET inc.severity = answers.severity.choice,
inc.severityConfidence = answers.severity.confidence,
inc.title = response.title,
inc.summary = response.summary,
inc.timeline = response.timeline,
inc.recommendedActions = response.recommendedActions,
inc.briefed = response IS NOT NULL
RETURN id(inc) AS briefed
llm.decide answers a choice question with page or ticket. llm.prompt writes the brief under a schema that bounds its shape: a title, a summary, at most eight timeline entries, and at most five recommended actions. One SET writes the severity and the brief together. When the brief does not conform to the schema, briefed is false on the incident.
A brief is written when its kill chain completes, from what the graph holds at that moment. Crashes, file writes, and tickets that arrive later are not in it. The helpdesk stream still links a later ticket to the incident with a CORROBORATED_BY edge.
The severity is the one place where a model's answer controls an action. page-on-call matches only an incident whose severity is page:
- name: page-on-call
pattern:
type: Cypher
query: >
MATCH (inc:Incident) WHERE inc.severity = 'page' RETURN DISTINCT id(inc) AS id
outputs:
- name: send-page
resultEnrichment:
query: |
MATCH (inc:Incident) WHERE id(inc) = $that.data.id
RETURN inc.appliance AS appliance, inc.title AS title, inc.summary AS summary,
inc.recommendedActions AS actions
destinations:
- type: StandardOut
Because the severity and the brief arrive in one SET, the brief is present when this standing query matches.
The Advisory Arrives Late¶
The live stream reads data/live.ndjson with fileIngestMode: NAMED_PIPE. In this mode Quine reads to the end of the file and then checks it for more data every second, so a line you append during the run is ingested as it arrives. See Files and Named Pipes for the modes. This is the stream's source:
- name: live
source:
type: File
path: data/live.ndjson
fileIngestMode: NAMED_PIPE
format:
type: JsonL
parallelism: 1
A line with an advisoryId is handled by this part of the stream's query:
// advisory: extract the IOCs onto the IP and path nodes the graph already keys
CALL {
WITH stream
WITH stream WHERE stream = 'advisory'
MATCH (adv) WHERE id(adv) = idFrom('advisory', $that.advisoryId)
CALL llm.prompt(
'You are reading one vendor security advisory, provided in the data block. The advisory is fictional demonstration data about a real CVE, written for a product demo; no real systems or real addresses are involved. Extract exactly what it states: the CVE identifier; the affected process name; every IP address it names as attacker or callback infrastructure; every file path it describes as written or dropped during exploitation; the affected build range as one string; and a one-sentence summary. Use only information in the advisory text.',
{advisory: $that.text},
{schema: {
type: 'object', additionalProperties: false,
required: ['cve', 'process', 'iocIps', 'droppedPaths', 'affectedBuilds', 'summary'],
properties: {
cve: {type: 'string', maxLength: 30},
process: {type: 'string', maxLength: 30},
iocIps: {type: 'array', items: {type: 'string', maxLength: 45}},
droppedPaths: {type: 'array', items: {type: 'string', maxLength: 120}},
affectedBuilds: {type: 'string', maxLength: 80},
summary: {type: 'string', maxLength: 300}
}
}}
) YIELD response
SET adv.advisoryId = $that.advisoryId, adv.source = $that.source,
adv.published = $that.published,
adv.cve = response.cve, adv.process = response.process,
adv.affectedBuilds = response.affectedBuilds, adv.summary = response.summary,
adv.extracted = response IS NOT NULL,
adv: Advisory
WITH adv, response
WHERE response IS NOT NULL
CALL {
WITH adv, response
UNWIND coalesce(response.iocIps, []) AS i
MATCH (ip) WHERE id(ip) = idFrom('ip', i)
SET ip.ip = i, ip.ioc = true, ip.ioc_source = adv.advisoryId, ip: IOC
CREATE (adv)-[:NAMES]->(ip)
}
CALL {
WITH adv, response
UNWIND coalesce(response.droppedPaths, []) AS p
MATCH (path) WHERE id(path) = idFrom('path', p)
SET path.path = p, path: IOCPath
CREATE (adv)-[:NAMES_PATH]->(path)
}
}
The query writes the extracted fields onto an Advisory node. For each address in iocIps, it sets the IOC label on the node with the id idFrom('ip', ...) and adds a NAMES edge from the advisory. The firewall-egress stream gives every destination address the same id, so the label lands on the node that the compromised appliances already connect to.
Configuring the Models¶
The recipe names no model. Each call uses the default profile for its kind, which quine.conf sets under quine.llm: bedrock-claude for llm.prompt and hosted-jev for llm.decide. This is quine.conf:
quine.llm {
# Which profile each procedure uses when a call does not name one.
default-profiles {
completion = "bedrock-claude"
decision = "hosted-jev"
}
profiles {
# Claude on Amazon Bedrock through the Anthropic-compatible endpoint. No Bedrock-specific
# code is involved: the endpoint speaks the anthropic-messages wire format, so a base-url
# and an API key are the whole integration. The model id must be the cross-region
# inference profile id (the `us.` prefix); the bare id is rejected by Bedrock.
bedrock-claude {
api { type = anthropic-messages }
base-url = "https://bedrock-runtime.us-west-2.amazonaws.com/anthropic"
model = "us.anthropic.claude-sonnet-5"
api-key = ${?QUINE_LLM_BEDROCK_KEY}
max-tokens = 4096
max-concurrent-requests = 8
request-timeout = 60s
}
# The hosted Jev decision model. Bedrock serves no decision model, so llm.decide stays
# on TypeSafe's hosted endpoint. The key comes from the environment, never this file.
hosted-jev {
api { type = jev-systemone }
base-url = "https://api.typesafe.ai"
model = "jev-latest"
api-key = ${?QUINE_LLM_JEV_KEY}
max-concurrent-requests = 8
request-timeout = 30s
}
}
}
The zip file holds this file. You can also download it on its own:
To set up the two model services:
- In Amazon Bedrock, get access to a Claude model and create an Amazon Bedrock API key.
-
Check
base-urlandmodelinquine.conf. As shipped, they name theus-west-2region and the inference profile idus.anthropic.claude-sonnet-5. To use another region or model, change them.modelmust be an inference profile id, which has a prefix such asus., because Bedrock rejects the bare model id. This command lists the ids your account can use:aws bedrock list-inference-profiles --region us-west-2 -
Get an API key from TypeSafe for the hosted Jev model.
-
Set both keys in the environment of the shell that starts Quine:
export QUINE_LLM_BEDROCK_KEY=<your Bedrock API key> export QUINE_LLM_JEV_KEY=<your TypeSafe API key>
quine.conf reads the keys from the environment, so no key is stored in the file. Configuring Profiles describes every profile setting.
A rejected key stops the stream that made the call
When a model endpoint rejects a key or a model id, the ingest stream or standing query output that made the call stops. In Ingests and Standing Queries describes how each kind of error is handled.
Running the Recipe¶
Start Quine with the configuration file and the recipe:
java -Dconfig.file=quine.conf -jar quine-2.2.2.jar -r netscaler-llm-triage.yaml
Quine starts the standing queries and the ingest streams:
Graph is ready
Using 16 node appearances
Using 5 quick queries
Using 5 sample queries
Running Standing Query crash-watch
Running Standing Query auth-mirror
Running Standing Query attacker-pivot
Running Standing Query kill-chain
2026-11-25 13:14:02,785 WARN [NotFromActor] [graph-service-pekko.actor.default-dispatcher-14] com.thatdot.quine.app.model.outputs2.query.CypherQuery - Could not verify that the provided Cypher query is idempotent. If timeouts or external system errors occur, query execution may be retried and duplicate data may be created. To avoid this set shouldRetry = false in the Standing Query output
Running Standing Query incident-brief
Running Standing Query page-on-call
2026-11-25 13:14:03,031 WARN [NotFromActor] [graph-service-pekko.quine.graph-shard-dispatcher-16] com.thatdot.quine.app.model.ingest2.source.QuineValueIngestQuery$ - Could not verify that the provided ingest query is idempotent. If timeouts occur, query execution may be retried and duplicate data may be created.
Ingest Stream saml-auth: Could not verify that the provided ingest query is idempotent. If timeouts occur, query execution may be retried and duplicate data may be created.
Running Ingest Stream saml-auth
Running Ingest Stream http-access
Running Ingest Stream system-events
Running Ingest Stream firewall-egress
2026-11-25 13:14:03,190 WARN [NotFromActor] [graph-service-pekko.quine.graph-shard-dispatcher-16] com.thatdot.quine.app.model.ingest2.source.QuineValueIngestQuery$ - Could not verify that the provided ingest query is idempotent. If timeouts occur, query execution may be retried and duplicate data may be created.
Ingest Stream helpdesk: Could not verify that the provided ingest query is idempotent. If timeouts occur, query execution may be retried and duplicate data may be created.
Running Ingest Stream helpdesk
2026-11-25 13:14:03,295 WARN [NotFromActor] [graph-service-pekko.quine.graph-shard-dispatcher-17] com.thatdot.quine.app.model.ingest2.source.QuineValueIngestQuery$ - Could not verify that the provided ingest query is idempotent. If timeouts occur, query execution may be retried and duplicate data may be created.
Ingest Stream live: Could not verify that the provided ingest query is idempotent. If timeouts occur, query execution may be retried and duplicate data may be created.
Running Ingest Stream live
The timestamps and thread names in the warning lines differ on your machine. The warnings are expected. llm.prompt and llm.decide are not idempotent, so Quine cannot verify that a query that calls them is safe to run again.
The console prints the result of the recipe's status query during the run. When the four log files and the tickets are ingested, it shows 6 alerts, 2 attacker addresses, and 2 incidents:
---[ Status Query result 1 ]------------
alerts | 6
attackerIps | 2
incidents | 2
------------+---------------------------
These counts do not depend on the models' answers. The detections that produce them read the logs, and none of them reads the username score, the ticket fields, the severity, or the brief. kill-chain also accepts the IOC label that the advisory adds, which does not change these counts. The counts are 6, 2, and 2 when every model call succeeds. The 6 alerts are two repeated-crash alerts, one for each compromised appliance, and four kill-chain alerts, one for each of the two files dropped on each of those appliances.
When the decision model chooses page for an incident, page-on-call prints that incident's brief as one line of JSON. This is the line for ns-gw-01:
{"appliance":"ns-gw-01","title":"Suspected Compromise of ns-gw-01 Linked to 198.51.100.77","summary":"Streaming graph evidence shows attacker IP 198.51.100.77 attributed to 2 service crashes on appliance ns-gw-01, followed by a dropped file and outbound traffic to 203.0.113.66 (not a known IOC). 2 user outage reports were recorded in the window.","actions":["Isolate ns-gw-01 from the network pending further investigation.","Block inbound/outbound traffic to and from 198.51.100.77 at the perimeter.","Forensically examine the file /var/tmp/v for malicious content or persistence mechanisms.","Monitor and consider blocking outbound connections to 203.0.113.66 pending reputation review.","Correlate the 2 user outage reports with the crash times to confirm impact scope."]}
This is the line for ns-gw-03:
{"appliance":"ns-gw-03","title":"Two Crashes Attributed to 198.51.100.143 on ns-gw-03 Followed by File Drop and Egress","summary":"The streaming graph attributes two service crashes on appliance ns-gw-03 to attacker address 198.51.100.143. Shortly after the second crash, a file was dropped at /var/tmp/v by user nobody. Outbound traffic was observed to 203.0.113.66, which is not flagged as a known IOC. Three users reported outages during the observed window.","actions":["Isolate ns-gw-03 from the network pending further investigation.","Block or monitor traffic to and from 198.51.100.143.","Inspect and preserve the file /var/tmp/v for forensic analysis.","Review outbound connections to 203.0.113.66 for further context, noting it is not currently a known IOC.","Correlate the three user-reported outages with the crash and file-drop timestamps."]}
The model writes the title, the summary, and the actions, so their wording differs between runs. The number of outage reports a brief states can also differ, because it counts the tickets that were in the graph when the brief was written. When the decision model chooses ticket for an incident, no line is printed for it, and the incident and its brief are still in the graph.
Deliver the Advisory¶
After the status query result shows 2 incidents, append the advisory to the live file from a second terminal, in the same directory:
cat data/advisory.ndjson >> data/live.ndjson
The live stream reads the new line and calls llm.prompt to extract the advisory's IOCs. Nothing is printed to the console. To see the result, open http://localhost:8080, click Exploration UI in the left navigation, and run this query:
MATCH (inc:Incident)-[:EGRESS_TO]->(dst)<-[:NAMES]-(adv) RETURN inc, dst, adv
The screenshots on this page come from a different run than the console output above, so the incident titles and the recommended actions in them differ from the JSON lines. Both incidents and the advisory point at the same node, the callback host 203.0.113.66:
The incidents existed before the advisory arrived. The kill-chain detection had already flagged the callback host, because no healthy appliance had contacted it. The advisory adds the IOC label and its source to that node afterward.
Empty data/live.ndjson before you run the recipe again
The advisory stays in data/live.ndjson after the run. If the file still holds it at the next start, the live stream reads the advisory at once, before the incidents exist.
Summary¶
The standing queries detect the attack and assemble each incident, and the models work only on what the graph hands them: ten tickets, one advisory, two sets of incident evidence, and one username at a time.
After the advisory is delivered, this query returns the ns-gw-01 incident with its appliance, the attacker address, the attributed crashes, the corroborating tickets, the callback host, and the advisory:
MATCH (inc:Incident)-[:ON]->(app:Appliance) WHERE app.host = 'ns-gw-01' MATCH (inc)-[:ATTRIBUTED_TO]->(attacker)-[:PRECEDED_CRASH]->(crash:SysEvent)-[:ON]->(app) MATCH (inc)-[:CORROBORATED_BY]->(ticket:Ticket) MATCH (inc)-[:EGRESS_TO]->(ioc)<-[:NAMES]-(adv:Advisory) RETURN DISTINCT inc, app, attacker, crash, ticket, ioc, adv
In the screenshot, the nodes are arranged by hand. The lower half is the detection, with the attacker address, five crashes of nsaaad, and the compromised appliance. The upper half comes from the model calls, with the tickets the model read as outage reports and the advisory whose IOC the model extracted. The incident's label in the graph is the title the model wrote for it, so yours will differ.
The model's output is stored as properties on the Incident node. To see them, right-click the node and select View properties. In the screenshot, the panel is open on the ns-gw-01 incident in the result of a shorter query, which returns the incident, its appliance, and the attacker address:
The recipe includes sample queries as starting points. Click in the empty query bar to list them:
| Sample query | Returns |
|---|---|
| Promoted attacker infrastructure | The addresses with the AttackerInfra label |
| Incidents and their appliances | Each incident and the appliance it is on |
| Every assessed appliance, compromised or probed | Each attacker address and the appliances it targeted |
| The callback host and everyone who reached it | The appliances that connected to 203.0.113.66 |
| Attack subgraph around one appliance | The attacker address, the crashes, and the appliance for ns-gw-01 |
Right-click a node to run one of the recipe's quick queries:
| Quick Query | Node Type | Description |
|---|---|---|
| Adjacent Nodes | All | Display the nodes that are adjacent to this node |
| Refresh | All | Refresh the content stored in a node |
| Local Properties | All | Display the properties stored by the node |
| System Events | Appliance | Load the system events recorded on this appliance |
| Full Evidence | Incident | Load every node joined to this incident |
The recipe prints each page to standard output. To send it to a person or a pipeline, change the destination of page-on-call to one of the other output destinations, such as Slack, an HTTP endpoint, SNS, Kafka, or Kinesis.


