mirror of
https://github.com/norandom/OpenUltraSAST.git
synced 2026-12-03 10:18:18 +00:00
On a fresh checkout the documented command, `TARGET=/path/to/repo docker compose run
--rm ousast scan /target`, died before scanning. The `/reports` mount was in the short
syntax, so Docker created a missing `./reports` as root, and the image runs as uid 1000.
On 2026-11-26, from a copy of the compose file at 8daca3d, Docker created the directory
owned by 0:0 and the scan stopped after one second with exit 1 and `PermissionError:
[Errno 13] Permission denied: '/reports/runs'`.
The mount is now in the long syntax with `create_host_path: false`, so nothing is
created. Without the directory the daemon refuses the container ("bind source path does
not exist") and leaves nothing behind. After `mkdir -p reports` the same command
completes with exit 0 and writes the run directory owned by the user (quick mode on four
C files: file_targets=4, findings=4). The documented command in the compose header, in
`README.md` and in `ops/README.md` creates the directory first. Both shell wrappers
already did.
Tests: the new `tests/test_task_images.py::test_compose_leaves_the_reports_directory_to_the_user`
fails on the short syntax (1 failed, 16 deselected) and passes after; with
`tests/test_search_image.py`, 18 passed. The eight test files that read `README.md` pass
(183 tests). ruff format, ruff check, mypy, the three gates and compileall pass, and the
gates print what they printed before the change. An independent reviewer approved the
change in one round.
Left as it was, an open item for the maintainer: the `/target` mount is still in the
short syntax, so a `TARGET` that does not exist is created as an empty root-owned
directory and the scan ends with exit 0 and no findings (measured on 2026-11-26).
46 lines
2.3 KiB
YAML
46 lines
2.3 KiB
YAML
# OpenUltraSAST as a contributor runs it: nothing installed on the host but Docker.
|
|
#
|
|
# docker compose build
|
|
# mkdir -p reports
|
|
# 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
|
|
# Where findings land, the one writable mount. Long syntax on purpose: the short syntax lets Docker create a
|
|
# missing source, as root, and the image runs as uid 1000. Create the directory first; the wrapper does.
|
|
- type: bind
|
|
source: ${OUSAST_REPORTS:-./reports}
|
|
target: /reports
|
|
bind:
|
|
create_host_path: false
|
|
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
|