Scan your whole stack
From OX Research Newsroom
Are you using lvi-script-sandbox-utils?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v0.15.0
lvi-script-sandbox-utils was last scanned on 24 Nov 2026 at version 0.15.0. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 0.15.0 LATEST | 24 Nov 2026 | No rules fired |
| 0.14.0 | 30 Oct 2026 | No rules fired |
| 0.13.0 | 29 Oct 2026 | No rules fired |
| 0.12.0 | 29 Oct 2026 | Not shown |
| 0.11.0 | 28 Oct 2026 | Not shown |
Findings for v0.15.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 0.15.0; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
Convenience helpers for Python scripts that LogicVein Playbooks run in the
Script Sandbox container. They wrap the sandbox's file-and-stdout contract:
a Playbook hands your script its inputs in in.json, and your script returns
results by printing JSON to stdout.
Create a directory for the sandbox on the Docker host, and run the
container from it, so that its scripts/ and packages/ directories live
there:
mkdir -p lvi_script_sandbox/scripts lvi_script_sandbox/packages
cd lvi_script_sandbox
Creating scripts/ and packages/ yourself keeps them owned by you;
Docker would otherwise create them owned by root.
| On the host | In the sandbox | What goes there |
|---|---|---|
lvi_script_sandbox/scripts |
/shared (read-only) |
Files scripts read: playbooks, certificates, ... |
lvi_script_sandbox/packages |
/packages (on PYTHONPATH) |
Python packages scripts import |
Then start the sandbox with docker run:
docker run -d \
--name lvi-script-sandbox \
--read-only \
--tmpfs /tmp:size=1G \
--cap-add=SYS_ADMIN \
--security-opt no-new-privileges \
-p 2022:2022 \
-v "$PWD/scripts:/shared:ro" \
-v "$PWD/packages:/packages" \
harbor.logicvein.com/lvi/lvi-script-sandbox:latest
or with Docker Compose, using this lvi_script_sandbox/docker-compose.yaml
and docker compose up -d:
services:
lvi-script-sandbox:
image: harbor.logicvein.com/lvi/lvi-script-sandbox:latest
container_name: lvi-script-sandbox
restart: no
read_only: true
cap_add:
- SYS_ADMIN
security_opt:
- no-new-privileges:true
ports:
- "2022:2022"
tmpfs:
- /tmp:size=1G
volumes:
- ./scripts:/shared:ro
- ./packages:/packages
Port 2022 is the sandbox's SSH API (ssh -p 2022 root@<sandbox> ...), used
below to install packages and set the ThirdEye API key.
What the sandbox needs depends on how many scripts run at once (a Playbook run over a Device Search runs its Script nodes for many devices together) and on whether they run Ansible. Recommended for the Docker host:
| Use | vCPU | Memory | Disk |
|---|---|---|---|
| Python scripts only, or a lab | 1 | 3 GB | 10 GB |
| Ansible, up to about 8 runs at once | 2 | 4 GB | 20 GB |
| Ansible, up to about 16 runs at once | 4 | 8 GB | 20 GB |
These figures include the host's own OS and Docker. To size for a different load:
/tmp tmpfs is memory too: up to 1 GB as files are written
to it.packages/: about 120 MB for
ansible-core, ansible-pylibssh and the network collections, or about
500 MB for the full ansible package (see the
Ansible guide). Keep a few GB free
for image updates and Docker's logs.Measured with ansible-core 2.21 on Python 3.12: one network_cli run
peaked at about 130 MB and one CPU second, before connecting to a device.
Long playbooks, large command output and fact gathering need more, so watch
docker stats lvi-script-sandbox under a real load and adjust.
Install the package with the sandbox's pip, which installs into
/packages:
ssh -p 2022 root@<sandbox> pip install lvi-script-sandbox-utils
or from the host, into lvi_script_sandbox/packages:
pip install --target ./packages lvi-script-sandbox-utils
Pre-release versions are on TestPyPI:
pip install --target ./packages \
--index-url https://test.pypi.org/simple/ \
--extra-index-url https://pypi.org/simple/ \
lvi-script-sandbox-utils
The library has no third-party dependencies (standard library only), so
installing from the host is safe; packages with compiled parts should be
installed with the sandbox's pip, so they're built for its Python.
import lvi_script_sandbox_utils as lvi
text = lvi.get_result() # the previous node's output
lvi.log("checking", lvi.device.hostname) # debugging message
lvi.set_globals(
line_count=len(text.splitlines()),
**lvi.device.to_globals(["hostname", "model"]),
)
lvi.get_result() returns the previous node's result, such as a CLI
command's text. In a Playbook's first script node there is none, and it
returns "" (or get_result(default=...)).
lvi.device is the Playbook's device. Its properties use LogicVein's names:
hostname, ipAddress, model, osVersion, serialNumber, custom1
.. custom5, uuid, and so on (your editor can list them). It's built the
first time you use it, and is the same object every time.
None.endOfLife, endOfSale, softwareEndOfLife,
softwareEndOfSale) are YYYY-MM-DD dates, and lastBackup,
lastChange, lastDiscovery, lastTelemetry are YYYY-MM-DDTHH:MM:SSZ
timestamps, all in UTC.traits lists the device's capabilities (ssh, snmp, ncm, ...).lvi.device.to_dict() gives all properties as a dict.Variables set earlier in the Playbook, by a Set Variables node or as a Device Search node's replacement value, are globals:
lvi.get("message") # short for lvi.get_global("message")
lvi.get_global("hostname") # KeyError, listing what is set, if missing
lvi.get_global("site", default="")
lvi.get_globals() # all of them, as a dict
lvi.metadata.playbook # details of this run: playbook, executor,
lvi.metadata.execution_id # execution_id, job_id, node, started_at, ...
Call lvi.set_globals(...) once, at the end of the script, with
everything the Playbook should get back as global variables. Calling it (or
set_raw()) a second time raises RuntimeError, so build up results in a
dict and pass **results.
Playbook globals are strings. Numbers and booleans are fine, None is sent
as "", and a list, dict, device or metadata object is sent as its JSON
text, which a later script node can read back with
json.loads(lvi.get_global(name)). For a different format, convert it
yourself, e.g. traits=", ".join(lvi.device.traits).
To return device properties, use lvi.device.to_globals(), all of them, or
to_globals(["hostname", "model"]) for some. It names hostname and
network device_hostname and device_network, so they don't overwrite the
Playbook's own hostname and network globals.
lvi.set(...) is a shorter set_globals() that also takes variables,
sending each under its own name:
message = lvi.get("message")
replacement_message = lvi.get("replacement_message")
line_count = len(lvi.get_result().splitlines())
lvi.set(message, replacement_message, line_count, status="ok")
# same as lvi.set_globals(message=message, replacement_message=replacement_message,
# line_count=line_count, status="ok")
Pass only plain variables that way; for anything else, give it a name:
lvi.set(model=lvi.device.model). Use it as lvi.set: importing it
bare (from lvi_script_sandbox_utils import set) hides Python's own set()
in the script.
lvi.set_raw(text) returns text as the node's raw output instead.
When the script can't do its job, call lvi.fail("why") instead of
set_globals(). The Playbook marks the node failed with that message, and the
script stops there. Any log() messages are still returned.
An uncaught exception does the same automatically: the node fails with the
error, e.g. ValueError: invalid literal for int() ... (line 4 of script.py),
instead of a traceback on stderr, which would fail the run with no message.
Once the sandbox has an API key (ssh -p 2022 root@<sandbox> setkey <key>),
scripts can call the ThirdEye server's JSON-RPC API:
configs = lvi.call_api("Credentials.getAllCredentialConfigs", network="Default")
creds = lvi.get_credentials() # what LogicVein last logged in to lvi.device with
creds.username, creds.password, creds.enablePassword, creds.protocols
lvi.get_credentials("192.0.2.12", "Default") # another device
get_credentials() raises LookupError if LogicVein has never logged in to
the device. Printing or logging a Credentials object hides its passwords,
keys and community strings, and set_globals() refuses to send one. Any
script in the sandbox can read every device's credentials this way, so treat
the API key accordingly.
The server's TLS certificate is verified. If ThirdEye uses a self-signed
certificate, save it (PEM) as thirdeye-ca.pem in the scripts volume, which
the sandbox mounts at /shared, or set API_CA_FILE to its path. To run a
script outside a Playbook, set API_HOST and API_KEY yourself.
To skip certificate verification instead, call lvi.api_verify_tls(False)
before the first API call; it applies to every call after it in the script,
whatever API_VERIFY_TLS says:
lvi.api_verify_tls(False)
creds = lvi.get_credentials()
lvi.api_verify_tls(True) turns verification back on, and
lvi.api_verify_tls(None) goes back to the API_VERIFY_TLS environment
variable (false turns verification off; it's on by default).
Without verification, anyone who can intercept the connection to ThirdEye gets the API key and any credentials the script reads, so prefer trusting the certificate, and keep this to labs.
With Ansible installed in the sandbox, a script can run an Ansible playbook
against the device, logging in with its LogicVein credentials. Give it a
playbook file (looked for next to the script, then in scripts/ansible):
result = lvi.run_ansible("show_version.yml")
if not result.ok:
lvi.fail(result.message)
lvi.set_globals(**result.to_globals())
or the playbook itself, as YAML text:
result = lvi.run_ansible("""
- hosts: all
gather_facts: false
tasks:
- name: Show version
cisco.ios.ios_command:
commands: show version
""")
See Running Ansible from a LogicVein Playbook for setting up the sandbox, writing playbooks, and reading the results.
A script can't print while it runs in a Playbook: stdout carries the results the Playbook reads, and the Script Sandbox fails the run if the script writes anything to stderr. That includes Python warnings, which go to stderr too.
Use lvi.log(...) instead. It takes the same arguments as print(), keeps
the message, and set_globals() returns all of them, one per line, as the
script_log global, so they show up with the node's results. Messages are
lost if the script never reaches set_globals(), and set_raw() doesn't
return them.
lvi.log("parsed", len(lines), "lines")
lvi.set_globals(total="61 MB") # also sends script_log="parsed 12 lines"
To run a script outside a Playbook, save an in.json from a run and point
the package at it:
LVI_SANDBOX_INPUT=./samples/in.json python my_script.py
When LVI_SANDBOX_INPUT is set, lvi.log() also prints each message to the
terminal (stderr) as it happens.
lvi.load_input() returns the whole in.json as a dict, if you need
something the functions above don't cover. Treat it as read-only.
See CONTRIBUTING.md for development setup and PUBLISHING.md for how releases are published.
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.