mirror of
https://github.com/norandom/OpenUltraSAST.git
synced 2026-10-16 19:59:26 +00:00
source ops/shell/ousast.sh # bash / zsh
. ops\shell\ousast.ps1 # powershell
ousast scan .
ousast scan src/api
The container becomes an implementation detail. The engine is a JVM and ~2 GB
of Joern, and a contributor evaluating this tool should not have to install
either to try it -- what they get is a command.
Path rewriting is what makes it feel local: arguments under the working
directory are mapped to their mounted equivalents, so `src/api` means what the
user expects. Anything outside the mount is passed through unchanged WITH A
WARNING rather than silently rewritten into a path the container cannot see --
a wrong path that looks like it worked is worse than one that complains.
A native install wins when it is present. Someone who installed Joern
deliberately should not be quietly routed through a container, so the wrapper
uses a local joern-parse and venv when both exist; OUSAST_PREFER_NATIVE=0
forces the container. Verified end to end from an unrelated directory.
The image builds itself on first use and says why it is pausing. A first run
that prints a wall of build output and then works is worse than one that
explains itself.
Defaults stay conservative: the working directory mounts READ-ONLY, findings go
to ./.ousast as the only writable mount, and the network is off unless
`ousast-with-judge` asks for it.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01T7XD7x5KonMdmGRkp63EQG
34 lines
1.5 KiB
YAML
34 lines
1.5 KiB
YAML
# OpenUltraSAST as a contributor runs it: nothing installed on the host but Docker.
|
|
#
|
|
# docker compose build
|
|
# TARGET=/path/to/repo docker compose run --rm ousast scan /target
|
|
#
|
|
# The target is mounted READ-ONLY. A tool that reads your source to tell you about it has no business being
|
|
# able to write to it, and a contributor evaluating an unfamiliar analyser should not have to take that on
|
|
# trust.
|
|
|
|
services:
|
|
ousast:
|
|
build:
|
|
context: .
|
|
args:
|
|
JOERN_VERSION: ${JOERN_VERSION:-v4.0.623}
|
|
image: openultrasast:${OUSAST_VERSION:-dev}
|
|
volumes:
|
|
- ${TARGET:-.}:/target:ro # the repository under analysis, read-only
|
|
- ${OUSAST_REPORTS:-./reports}:/reports # where findings land, the one writable mount
|
|
working_dir: /work
|
|
tmpfs:
|
|
# CPG construction is scratch-heavy and none of it should outlive the run or touch the host.
|
|
- /work:size=${WORK_SIZE:-4g}
|
|
environment:
|
|
# The LLM endpoint is optional: without it the model layer still entails, and the suspicion band simply
|
|
# goes unasked. Passed through rather than baked in, so no key is ever in an image layer.
|
|
DEEPSEEK_API_KEY: ${DEEPSEEK_API_KEY:-}
|
|
OPENROUTER_API_KEY: ${OPENROUTER_API_KEY:-}
|
|
TMPDIR: /work
|
|
# A CPG build is memory-hungry, and two Joern JVMs at once is what triggered an out-of-memory kill on a
|
|
# 7.7 GB machine during this project's measurements.
|
|
mem_limit: ${OUSAST_MEM_LIMIT:-6g}
|
|
network_mode: ${OUSAST_NETWORK:-none} # `bridge` only when the LLM judge is wanted
|