mirror of
https://github.com/norandom/OpenUltraSAST.git
synced 2026-12-03 18:28:19 +00:00
fix(contributor-scan): compose leaves the reports directory to the user (3.2, part 2)
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).
This commit is contained in:
@@ -42,6 +42,7 @@ translation:
|
||||
|
||||
```bash
|
||||
docker compose build
|
||||
mkdir -p reports
|
||||
TARGET=/path/to/repo docker compose run --rm ousast scan /target
|
||||
```
|
||||
|
||||
@@ -51,6 +52,9 @@ entails, and its residual and suspicion questions go unasked. `network_mode` def
|
||||
(`OUSAST_NETWORK=bridge`, which `ousast-with-judge` does) only when the model layer should reach the model
|
||||
endpoint. Compose passes `DEEPSEEK_API_KEY` and `OPENROUTER_API_KEY` through from the environment.
|
||||
|
||||
Findings land in `reports/`, which must already exist: the image runs as an ordinary user, and a directory
|
||||
Docker has to create is root-owned.
|
||||
|
||||
**pyinfra (for a persistent host install).** Same engine, same pin, same checksum, but on the machine:
|
||||
|
||||
```bash
|
||||
|
||||
Reference in New Issue
Block a user