Install and upgrade#

NeuralUI is a Synapse service. It runs as its own cell next to a Cortex, connects to it with a service account, and serves the UI over HTTPS. Analysts log in with their Cortex accounts.

Requirements: a Synapse 2.x Cortex, 2.256.0 or later (NeuralUI 1.x is for Synapse 2 only). The service runs on Python 3.11, the version Synapse supports; the container image has it.

Try it on one machine#

The dev stack starts a Cortex and NeuralUI in one process, with demo data:

git clone https://github.com/gormaniac/neuralui && cd neuralui
make setup        # pip install -e '.[dev]' into the current Python 3.11
make demo         # then open https://localhost:4443/ (a self-signed certificate)

Log in as analyst / analyst, or root / root. It listens on 127.0.0.1 only, because those logins are known. Its data is in ./dev-data.

Install#

With pip#

pip install neuralui            # into a Python 3.11 environment
python -m neuralui /path/to/svcdir

Each release’s wheel is also attached to its GitHub release.

Connect it to a Cortex#

For production, follow Deployment: both telepath connections (NeuralUI to the Cortex, and the Cortex to NeuralUI for service.add) use ssl:// with mutual TLS, and NeuralUI refuses to start with a plain tcp:// address that leaves the machine. In short:

  1. Make a CA, a server certificate for each side, and client certificates: neuralui for NeuralUI and cortex for the Cortex. Put them in each cell’s certs/ directory.

  2. Have the Cortex listen with TLS and create the service account. It must be an admin (not root): the telepath APIs for checking passwords and API keys are admin-only, as for Optic. It logs in with its certificate and needs no password:

    storm> $user = $lib.auth.users.add(neuralui) $user.setAdmin($lib.true)
    
  3. Write the service directory’s cell.yaml:

    cortex: ssl://cortex.internal:27492/?hostname=cortex.internal&certname=neuralui   # or an aha:// url
    dmon:listen: ssl://0.0.0.0:27495/?hostname=neuralui.internal&ca=nuica
    https:port: 4443
    neuralui:origin: https://neuralui.example.com
    

    Every setting can also be an environment variable (SYN_NEURALUI_CORTEX, …). All of NeuralUI’s own settings are in Settings.

  4. Register the service with the Cortex, so its Storm package (saved queries, scrape sessions, the built-in right-click actions) loads. Create a plain user cortex on NeuralUI for it first:

    python -m synapse.tools.service.moduser --svcurl cell:///path/to/svcdir --add cortex
    
    storm> service.add neuralui ssl://neuralui.internal:27495/?hostname=neuralui.internal&certname=cortex
    
  5. Put NeuralUI on its own host name behind HTTPS (a reverse proxy is fine: see Deployment for neuralui:proxy:trusted).

Permissions for analysts#

NeuralUI uses the Cortex’s own permissions: what an analyst may do in NeuralUI is what they may do in the Cortex. For example:

  • querying and editing: node, or narrower rules such as node.add.inet:fqdn and node.tag.add.rep;

  • saved queries: node.add.it:exec:query, node.prop.set.it:exec:query, node.del.it:exec:query, node.tag.add.meta.neuralui.query and node.add.it:query;

  • notes and scrape sessions: node.add.meta:note, node.prop.set.meta:note, node.del.meta:note, node.edge.add.about (notes), node.edge.add.refs (scrape sessions), and node.add.meta:note:type:taxonomy the first time a note type is used;

  • new tag properties from the tag dialog: model.tagprop.add;

  • files: axon.upload and axon.get;

  • scripts and imports in a fork: view.add and view.fork;

  • the Admin and Automation pages: the Cortex’s own auth.*, pkg.*, cron.*, trigger.*, storm.macro.* and dmon.*.

Upgrade#

  • Container: pull the new image and restart. The service directory carries over, and the service migrates its store on start.

  • pip: pip install --upgrade neuralui, then restart the service.

  • The neuralui Storm package in the Cortex is updated by the service when it reconnects; nothing to do in the Cortex.

  • Open browsers show a “NeuralUI has been updated” banner and reload with their tabs kept.

  • Back up the service directory first. Downgrading is not supported once a newer release has migrated the store: an older NeuralUI refuses a store from a newer one.

Each release’s changes, including anything to do when upgrading, are in the changelog. What stays the same across 1.x releases is in Stability.