mirror of
https://github.com/CyberSecurityUP/NeuroSploit.git
synced 2026-12-05 10:34:31 +01:00
The console ran on debian-slim and reached tools by spawning a sibling Kali
container per command, through the mounted docker socket. Build the console
FROM the toolbox image instead: nmap, sqlmap, ffuf, nuclei, impacket, Ghidra
and the rest are on PATH in the same container the harness runs in. A run
set to sandbox "host" now executes tools in place; picking an image in the
UI still spawns an isolated sibling, so isolation stays available.
This makes build order load-bearing — the console image cannot resolve its
base until the toolbox image exists. install.sh builds kali-base first, then
neurosploit. Renamed the service from kali-worker to kali-base to say what it
is now: a base layer, not a worker pool.
Add .dockerignore. The build context was 19GB, 18GB of it neurosploit-rs/
target/, which the builder stage recompiles anyway; runs/ carried engagement
data into the context as well. agents_md/ is explicitly preserved.
Dropped NS_WORKER_IMAGE and NS_SANDBOX from the compose environment: neither
is read anywhere in the harness or the web server. The sandbox image comes
from the per-run --sandbox flag.
Also fixes install.sh printing a literal ${NS_PORT:-8787} in its closing
banner, and makes it wait for the console to answer before declaring success.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
59 lines
2.1 KiB
Docker
59 lines
2.1 KiB
Docker
# NeuroSploit — main application image
|
|
#
|
|
# The console, the harness and the toolbox share one Kali container. Running the
|
|
# web tier on the same image as the tools means an agent calls nmap or sqlmap
|
|
# directly instead of spawning a sibling container for every command, which is
|
|
# where most of the per-tool latency used to go. `--sandbox` still spawns an
|
|
# isolated container when an engagement wants tools kept off this host.
|
|
#
|
|
# Build order matters: this image derives from the toolbox image, so build that
|
|
# first. `./install.sh` does both in order.
|
|
#
|
|
# docker build -t neurosploit-kali:local -f Dockerfile.kali .
|
|
# docker build -t neurosploit:local -f Dockerfile .
|
|
|
|
# ── Rust build ──────────────────────────────────────────────────────────
|
|
FROM rust:1.83-bookworm AS rust-build
|
|
WORKDIR /src
|
|
COPY neurosploit-rs/ ./
|
|
RUN cargo build --release --bin neurosploit \
|
|
&& strip target/release/neurosploit \
|
|
&& cp target/release/neurosploit /out-neurosploit
|
|
|
|
# ── Runtime: the Kali toolbox image, plus the console ───────────────────
|
|
FROM neurosploit-kali:local
|
|
|
|
USER root
|
|
|
|
RUN set -eux; \
|
|
apt-get update; \
|
|
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
|
nodejs npm; \
|
|
apt-get clean; \
|
|
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=rust-build /out-neurosploit /usr/local/bin/neurosploit
|
|
COPY web/ /app/web/
|
|
COPY agents_md/ /app/agents_md/
|
|
COPY db/ /app/db/
|
|
|
|
RUN set -eux; \
|
|
cd /app/web; \
|
|
if [ -f package-lock.json ]; then npm ci --omit=dev; else npm install --omit=dev; fi; \
|
|
npm cache clean --force; \
|
|
mkdir -p /app/runs; \
|
|
chown -R 10001:10001 /app
|
|
|
|
USER 10001:10001
|
|
|
|
ENV NODE_ENV=production
|
|
|
|
EXPOSE 8787
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \
|
|
CMD node -e "require('http').get('http://127.0.0.1:8787/api/auth/status',r=>process.exit(r.statusCode===200?0:1)).on('error',()=>process.exit(1))"
|
|
|
|
CMD ["node", "/app/web/server.js"]
|