Files
Open_Ultra_SAST/docker-compose.yml
T
Marius Ciepluch 89d08e01d3 fix(contributor-scan): build the image from the pinned base and keep runs on the writable mount (3.2, part 1)
`docker compose build` has failed since 1b9d1ca (2026-10-05): the Dockerfile requires the task
base's tag and digest and deliberately has no floating fallback, but the compose file passed
neither argument. Compose now defaults both from plane/task-base.digest, the pin CI builds
from, and a test fails when the two drift apart or an argument goes missing.

The service also sets OPENULTRASAST_RUNS_DIR=/reports/runs, so a scan's run directory lands on
the one writable mount (Req 6.3) whatever the default location is.

Built and verified once, with no scan (2026-11-24, 11:02Z to 11:10Z): `docker compose build`
exit 0 in 8m03s, the Joern zip passing its sha512 check, and inside the image the CLI usage,
native PHP 8.4.26, lib/io.joern.joern-cli-4.0.625.jar, the installed package, and the pinned
base's 12 layers and 24 history entries as the image's prefix. That image held HEAD's source
and was removed from the build machine by a Docker prune at 12:56Z.

Task 3.2 stays open: the image must be rebuilt after task 3.1 lands, and part 2 (a real scan
through the image and the shell wrapper, parity with a native run) is not done. Known for part
2: on a fresh checkout Docker creates ./reports root-owned and the image runs as uid 1000, so
the first run cannot write its output.
2026-11-24 14:04:33 +01:00

39 lines
2.0 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.625}
# The base is pinned by digest, the same pin CI builds from (plane/task-base.digest): a bare tag can move.
TASK_BASE_TAG: ${TASK_BASE_TAG:-base-b696c08}
TASK_BASE_DIGEST: ${TASK_BASE_DIGEST:-sha256:0f374138fcb49fef41609d323cc80b6c2324b1e798d3a2aee5c8038b8c7ac3aa}
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:-}
# A scan's run directory would otherwise land in the container's home and be lost when the container exits.
OPENULTRASAST_RUNS_DIR: /reports/runs
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