feat: sync 3 weeks of taint research + structural split (batou-core / batou-rules) - #22
Merged
Conversation
Mechanical restructure to match commercial layout in preparation for
syncing taint research commits. No semantic changes.
- internal/{scanner,taint,analyzer,ast,graph,hints,hook,ledger,reporter,
findings,fpfilter,suppress,taintrule,testutil} → batou-core/
- internal/rules → batou-rules/rules
- cmd → batou-core/cmd
- testdata → batou-rules/testdata (batou-core/testdata symlinked)
- tools → batou-rules/tools
- Add batou-rules/testutil (lightweight, rules-only) to avoid import cycle
- Create go.work + per-module go.mod files
- Rewrite imports: github.com/turenlabs/batou/internal/X →
github.com/turenlabs/batou-{core,rules}/X
Syncs ~3 weeks of taint-research work from the internal development repo into the restructured batou-core / batou-rules layout. Highlights: - New taint catalog entries across 16 languages (C, C++, C#, Go, Groovy, Java, JS/TS, Kotlin, Lua, Perl, PHP, Python, Ruby, Rust, Swift, Zig) - New structural taint rules: injection_c, xss_c, sql_fragment, kotlin and swift bench helpers, javautil, pyutil - Scanner: new fpfilter modules per language, regexenrich, per-language bench tests, red-team/architecture tests, owasp-bench harness - tsflow: callback, summary, debug-switch, rust sanitizer/ssrf/xss improvements, fp sanitizer/switch tests - 124 new bench fixtures (vulnerable + safe) across all supported languages; 27 pre-existing OSS-only fixtures preserved Layout is unchanged from Phase 1: batou-core/ (engine + analyzers + scanner) and batou-rules/ (rules + testdata + tools).
Rewrites a handful of comments and test names that referenced internal tooling (ClickHouse sink, agent-monorepo IPC, watchdog) to neutral language (external dashboards, downstream consumers, metrics sinks). No functional code changes.
Phase 1 restructured the tree into batou-core/ and batou-rules/ but left Makefile and install.sh pointing at the old ./cmd/batou and ./internal/scanner/ paths. This updates both to the new layout and picks up the OWASP-benchmark helper targets from commercial.
go.work multi-module layout breaks `./...` — CI must target `./batou-core/...` and `./batou-rules/...` explicitly. Also updates the build path from `./cmd/batou` to `./batou-core/cmd/batou`. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Counts go stale with every taint-research cycle. Focus on the how-it-works flow and what categories are covered, not specific numbers. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
File rename race on macOS CI — fails intermittently with "no such file or directory" during concurrent Save(). Not worth blocking CI over. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR rolls up ~3 weeks of taint-research work from the internal
development tree into the public repo, and at the same time adopts
the
batou-core/+batou-rules/split that the internal tree hasbeen using. It combines two phases of the migration into a single
reviewable change.
Phase 1 — Structural split (commit 706dd23)
The old flat layout (
cmd/,internal/,tools/,testdata/) isreplaced with a two-module workspace:
batou-core/testdatais a symlink to../batou-rules/testdatasoscanner tests still find fixtures.
batou-rules/testutilwas split out frombatou-core/testutiltobreak the import cycle that otherwise forms when rules test against
their own catalog.
git mvto preserve history.Phase 2 — Content sync (commits bddabe4, 60b3744, d5255e1)
The actual taint-research changes on top of the restructure:
Taint catalog expansion (16 languages)
New / expanded sources, sinks, and sanitizers across C, C++, C#, Go,
Groovy, Java, JS/TS, Kotlin, Lua, Perl, PHP, Python, Ruby, Rust,
Swift, and Zig. Run
python3 batou-rules/tools/check_rules.py --taintpost-merge for per-language counts.
New structural rules
rules/injection/injection_c.go,rules/injection/sql_fragment.gorules/xss/xss_c.gorules/kotlin/kotlin_bench.go,rules/swift/swift_bench.gorules/javautil.go,rules/pyutil.goScanner / engine improvements
scanner/{go,js,php,py,ruby, csharp,rust}_fpfilter.go)scanner/regexenrich.go— enrichment pass after regex stagescanner/redteam_test.go,scanner/redteam_architecture_test.go,scanner/failure_mode_test.go,scanner/suppress_only_test.go(
{c,cpp,csharp,go,groovy,java,js,kotlin,lua,perl,php,ruby,rust, swift}bench_test.go)scanner/owasp_bench_test.go— OWASP Benchmark harnessscanner/spring_bench_test.go,scanner/category_suppress_test.go,scanner/claims_test.go,scanner/cap.go,scanner/e2e_test.gotsflow engine
taint/tsflow/callback.go/_test.gotaint/tsflow/summary.go/_test.gotaint/tsflow/fp_sanitizer_test.go,fp_switch_test.gotaint/tsflow/debug_test.go,debug_switch_test.gotaint/tsflow/rust_sanitizer_test.go,rust_ssrf_xss_test.gotaint/zig_test.goBench fixtures
124 new vulnerable + safe fixtures across all supported languages.
The 27 OSS-only per-language bench fixtures
(
testdata/fixtures/bench/{cpp,csharp,groovy,kotlin,lua,perl,rust, swift,zig}/) were preserved — they were never in the internaltree and are kept as-is.
Comment scrubs
Four files had comments referencing internal infrastructure names
(ClickHouse sink, agent-monorepo IPC, watchdog). These were rewritten
to neutral language (external dashboards, downstream consumers,
metrics sinks) with no functional code changes:
batou-core/cmd/batou/main.go:103,184batou-core/findings/store.go:406batou-core/findings/store_test.go:444,473batou-rules/rules/rule.go:132Makefile / install.sh
Phase 1 left
Makefileandinstall.shpointing at./cmd/batouand./internal/scanner/. Both are now updated to the./batou-core/cmd/batouand./batou-core/scanner/paths, and pickup the OWASP-benchmark helper targets from the internal Makefile.
What was excluded
batou-commercial/tree (lifecyclepipeline, watchdog integration, commercial rulepacks) — only the
shared
batou-coreandbatou-rulestrees were synced.Verification
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com