script/gitea-requests, and the gitea refusals it confirms named in SPEC.md (closes #30)
check / check (push) Canceled after 0s

script/gitea-requests runs gitea 1.27.3 behind the image at its
defaults, sends through it the requests that reading gitea's source
found the Core Rule Set refuses, with a short sample of ordinary use,
and prints each request with the rule ids that matched it. make
gitea-requests runs it; make check does not.

Every case still holds, and each fix would let through what SPEC.md
says stays refused, so the notes specific to gitea now name them with
how each refusal plays out: file names in query parameters that read as
Java, script, PowerShell or SQL, such paths, and an image push that
reuses a layer of an image named like a command.

Model: opus-5-5
This commit is contained in:
2026-10-20 11:11:14 +00:00
parent 47aac0235d
commit 07d4c5b22f
4 changed files with 414 additions and 6 deletions
+21
View File
@@ -2374,6 +2374,27 @@ so that they run in minimal containers.
the same volume still refuses the banned client; then removes the containers,
the volume and both images. It needs network access, for nixpkgs' binary
cache, and `script/check` does not run it; `make example-app` does.
- `script/gitea-requests`: builds the image and runs gitea 1.27.3 behind it,
with every setting of `smallwebwaf` at its default but `SWWAF_UPSTREAM_URL`,
which names gitea's container. Of the requests that three of the notes
specific to gitea in [`SPEC.md`](SPEC.md) say are refused, it sends through
it: for each file the note on a file name in a query parameter names, the
API's list of its commits; for `Runtime.java` alone, the commit graph of that
file, the hidden lines of its diff and the API's call for the contents of
files that names it; the sign-in page gitea sends a visitor to on the way to
the edit page of `document.write.js`; the pages of `java.lang.String.md`,
`META-INF/services/org.apache.commons.logging.LogFactory`, `process.env.d.ts`
and `.../notes.txt`; and one container image push that reuses a layer. It does
not send the raw file, history, blame or edit page of those four files, the
pages of the directories `META-INF/services` and `...`, or the push again. It
also sends a short sample of gitea's ordinary use: signing in, pages of files
and commits, a diff, the API, a push, clone and fetch over HTTP, and two
container image pushes. It prints a line for each request `smallwebwaf`
logged, with what it did with it and the ids of the Core Rule Set's rules that
matched it, then removes the containers, the network and the images it made,
but gitea's own image. It needs network access, and a docker daemon that
pushes to a registry on `localhost` over plain HTTP, as docker does by
default; `script/check` does not run it, and `make gitea-requests` does.
## TODO