Import#

Import (top bar) is the Console with files. It imports data the way stormlibpp’s import tool does.

Two ways to use it#

Your own script over data files. Add data files (.csv, .json, .txt), tick the ones to use (new ones are ticked), write a script in the editor and press Run script. The script runs once for every 1000 rows of each ticked file, with those rows in $rows:

for $row in $rows {
    [ inet:fqdn=$row.0 +#imported ]
}

Scripts which come with their data. Add a folder or a .zip of .storm / .storml scripts and data files, then press Run all steps. Each script runs with its own data files, in order.

STIX bundles (experimental). A .json file which is a STIX 2.1 bundle, and no script claims, is a step of its own (marked stix): Run all steps ingests it into the target view with $lib.stix.import.ingest and StormLib++’s mapping of STIX objects to Synapse forms (domains, addresses, files, indicators, reports, threat actors, malware and more).

An import of a folder of scripts and data files

What is in $rows#

$rows is a list of rows (at most 1000 per run). A row is:

File

A row is

Example file

$rows

.csv

a list of strings, one per column

vertex.link,1.2.3.4

[["vertex.link", "1.2.3.4"]]

.txt

a line (trimmed); use it for JSON lines too

vertex.link

["vertex.link"]

.json list

[index, item]

[{"name": "a"}]

[[0, {"name": "a"}]]

.json object

[key, value]

{"acme": {"name": "a"}}

[["acme", {"name": "a"}]]

So a CSV column is $row.0, $row.1…; a JSON row is ($key, $item) in for ($key, $item) in $rows. data files have a header row skips the first line of CSV and TXT files. $rows is always set (an empty list when no data file is used), and lint knows it.

Scripts and their data files#

  • A .storm script runs as a whole. A data file next to it with the same name (or the name and _<number>) is its data: orgs.storm takes orgs.csv and orgs_2.json, and runs once per 1000 rows of each. A script without data files runs once.

  • A .storml script runs each line on its own (lines starting with // and blank lines are skipped), and takes no data files.

  • Order: like walking the folders: a folder’s files in alphabetical order, then its sub-folders in alphabetical order. Number the names (10_tags/, 20_orgs.storm) to set the order.

  • Click a script to read or change it in the editor (the change is for this import only; back to your script returns to yours). Other files (a README, say) are listed but not imported.

  • stop at the first error stops the import when a script fails.

Files stay in the page until it is closed or reloaded (your own script is kept). Run in works as in the Console: a kept fork is a good way to review an import before merging it.