Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
fc85c69
feat: add native Go port at go-native/ressrf/ alongside the wazero bi…
gonzaloserrano May 26, 2026
b54c92d
refactor(go-native): wire diff-fuzz oracle to the wazero binding's WASM
gonzaloserrano May 26, 2026
c897dbb
docs: document the native + wazero Go bindings side by side
gonzaloserrano May 26, 2026
e0392b2
ci: cover the native Go port — test, lint, drift check, fuzz, diffuzz
gonzaloserrano May 26, 2026
f47b562
fix(go-wasm,deps): bump golang.org/x/crypto to v0.52.0
gonzaloserrano May 26, 2026
7674b04
fix(deps): bump astral-tokio-tar to v0.6.2 (RUSTSEC-2026-0145)
gonzaloserrano May 26, 2026
4df7d46
review: address PR #29 feedback
gonzaloserrano May 27, 2026
f63627e
docs: show the native Go port in the architecture diagram
gonzaloserrano May 27, 2026
3d77a52
refactor(go-wasm): isolate testing import behind ressrftest subpackage
gonzaloserrano May 27, 2026
45398b6
docs: update both READMEs to call ressrftest.DisableForTests
gonzaloserrano May 27, 2026
9e175cc
refactor(go-native/engine): finish Http→HTTP rename on PlaintextHttpD…
gonzaloserrano May 27, 2026
43cf22c
docs(go-native): fix package doc to describe the native engine
gonzaloserrano May 27, 2026
cfc92f8
fix(sshx): strip enclosing brackets on bracketed IPv6 without port
gonzaloserrano May 27, 2026
ac23f86
fix(diffuzz): fail loudly when WASM oracle is missing in CI
gonzaloserrano May 27, 2026
204e6b4
test(ressrftest): assert DisableForTests Cleanup actually re-enables
gonzaloserrano May 27, 2026
b067228
docs(go-native): drop ressrf-vs-pr25.html
gonzaloserrano May 27, 2026
77ec1c4
docs(gen-data): correct -out flag help text to name the actual base
gonzaloserrano May 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,23 @@ updates:
prefix: chore
include: scope
groups:
go-deps:
go-wasm-deps:
patterns:
- "*"
cooldown:
default-days: 7

- package-ecosystem: gomod
directory: /go-native/ressrf
target-branch: main
schedule:
interval: weekly
open-pull-requests-limit: 5
commit-message:
prefix: chore
include: scope
groups:
go-native-deps:
patterns:
- "*"
cooldown:
Expand Down
18 changes: 14 additions & 4 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@ on:
- "Cargo.lock"
- "go/ressrf/go.mod"
- "go/ressrf/go.sum"
- "go-native/ressrf/go.mod"
- "go-native/ressrf/go.sum"
pull_request:
branches: [main]
paths:
- "Cargo.toml"
- "Cargo.lock"
- "go/ressrf/go.mod"
- "go/ressrf/go.sum"
- "go-native/ressrf/go.mod"
- "go-native/ressrf/go.sum"
schedule:
- cron: "0 6 * * *" # Daily at 06:00 UTC

Expand All @@ -40,20 +44,26 @@ jobs:
- run: cargo audit

govulncheck:
name: govulncheck
name: govulncheck (${{ matrix.module }})
runs-on: ubuntu-latest
permissions:
contents: read # checkout
strategy:
fail-fast: false
matrix:
# Both Go modules need an independent scan: they share the
# workspace but each has its own go.mod / go.sum.
module: [go/ressrf, go-native/ressrf]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.0.2
with:
go-version-file: go/ressrf/go.mod
cache-dependency-path: go/ressrf/go.sum
go-version-file: ${{ matrix.module }}/go.mod
cache-dependency-path: ${{ matrix.module }}/go.sum
- name: Install govulncheck
run: go install golang.org/x/vuln/cmd/govulncheck@latest
- name: Run govulncheck
working-directory: go/ressrf
working-directory: ${{ matrix.module }}
run: govulncheck ./...
66 changes: 66 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -291,3 +291,69 @@ jobs:
docker pull wiremock/wiremock:3.9.1
- name: Run Tier 2 e2e tests
run: cargo test --features e2e -p ressrf-tcp --test ssrf_e2e --locked

test-go-native:
# Native Go port at go-native/ressrf/. No WASM runtime, no Rust
# toolchain; depends on neither the build-wasm step nor the wazero
# binding.
name: Test Go native (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
permissions:
contents: read # checkout
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.0.2
with:
go-version-file: go-native/ressrf/go.mod
cache-dependency-path: go-native/ressrf/go.sum
- name: Test
working-directory: go-native/ressrf
run: go test -count=1 -race ./...
- name: Vet
working-directory: go-native/ressrf
run: go vet ./...

lint-go-native:
name: Lint Go native
runs-on: ubuntu-latest
permissions:
contents: read # checkout
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.0.2
with:
go-version-file: go-native/ressrf/go.mod
cache-dependency-path: go-native/ressrf/go.sum
- uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
with:
version: latest
working-directory: go-native/ressrf

generated-up-to-date:
# Drift check: if a contributor edits crates/ressrf-core/config/*.json
# without re-running `go generate ./...` from the native Go module,
# the baked-in tables under go-native/ressrf/internal/engine/ go
# stale. `make check-generated` regenerates and fails on diff.
name: Generated Go files up to date
runs-on: ubuntu-latest
permissions:
contents: read # checkout
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.0.2
with:
go-version-file: go-native/ressrf/go.mod
cache-dependency-path: go-native/ressrf/go.sum
- name: Check generated files
working-directory: go-native/ressrf
run: make check-generated
77 changes: 77 additions & 0 deletions .github/workflows/diffuzz.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Diff-Fuzz (Go native vs WASM oracle)

# Differential-fuzz harness: the native Go port at go-native/ressrf/
# against the Rust ressrf-core compiled to WASM (the same artifact the
# wazero binding embeds at go/ressrf/core.wasm). Catches parser drift
# the conformance vectors cannot see.
#
# Triggered on:
# - changes to either side of the parser comparison: native engine,
# wazero binding's WASM artifact, Rust core, or wasm-ABI crate
# - weekly Monday 04:00 UTC (one hour after the cargo-fuzz job)
# - manual workflow_dispatch
#
# Divergence findings fail the job: a fresh parser divergence
# blocks the merge that introduced it.

on:
schedule:
- cron: "0 4 * * 1"
workflow_dispatch:
pull_request:
paths:
- "go-native/ressrf/policy.go"
- "go-native/ressrf/errors.go"
- "go-native/ressrf/deny_reasons.go"
- "go-native/ressrf/internal/engine/**"
- "go-native/ressrf/internal/diff/**"
- "go-native/ressrf/go.mod"
- "go/ressrf/core.wasm"
- "crates/ressrf-core/**"
- "crates/ressrf-wasm/**"

permissions: {}

concurrency:
group: diffuzz-${{ github.ref }}
cancel-in-progress: true

jobs:
diffuzz:
name: Native Go vs WASM oracle
runs-on: ubuntu-latest
permissions:
contents: read
env:
# Fail the job loudly if the WASM oracle is missing rather than
# silently passing with every subtest SKIPped. See diff_fuzz_test.go.
RESSRF_REQUIRE_WASM: "1"
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.0.2
with:
go-version-file: go-native/ressrf/go.mod
cache-dependency-path: go-native/ressrf/go.sum

# Oracle is the in-tree go/ressrf/core.wasm artifact — no
# /tmp/ressrf clone, no cargo step, no Rust toolchain install.
- name: Replay persisted divergence corpus
working-directory: go-native/ressrf
run: make fuzz-rust-regress

- name: Live fuzz against the WASM oracle
working-directory: go-native/ressrf
env:
FUZZ_RUST_DURATION: "5m"
run: make fuzz-rust

- name: Upload divergence corpus
if: failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: diffuzz-divergences
path: go-native/ressrf/internal/diff/testdata/fuzz/FuzzPolicyDiff/
retention-days: 30
55 changes: 55 additions & 0 deletions .github/workflows/fuzz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,58 @@ jobs:
name: fuzz-crashes-${{ matrix.target }}
path: fuzz/artifacts/${{ matrix.target }}/
retention-days: 30

fuzz-go-native:
# Native Go port fuzz targets — package-local engine primitives.
# Independent of the Rust cargo-fuzz job above; both jobs share
# the weekly Monday 03:00 trigger.
name: Fuzz Go native (${{ matrix.target }})
runs-on: ubuntu-latest
permissions:
contents: read # checkout
strategy:
fail-fast: false
matrix:
target:
- FuzzParseCIDR
- FuzzParseCIDRLoose
- FuzzIsAmbiguousIP
- FuzzValidateURL
- FuzzPolicy
- FuzzURLRulesEvaluate
- FuzzGlobMatchHost
- FuzzGlobMatchPath
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.0.2
with:
go-version-file: go-native/ressrf/go.mod
cache-dependency-path: go-native/ressrf/go.sum

- name: Restore corpus cache
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/.cache/go-build/fuzz/github.com/timescale/ressrf/go-native/ressrf/internal/engine/${{ matrix.target }}
key: go-fuzz-corpus-${{ matrix.target }}-${{ github.sha }}
restore-keys: |
go-fuzz-corpus-${{ matrix.target }}-

- name: Run fuzzer
working-directory: go-native/ressrf
env:
FUZZ_TARGET: ${{ matrix.target }}
FUZZ_DURATION: ${{ github.event.inputs.duration || '60' }}s
# Delegates to the Makefile so local `make fuzz FUZZ_TARGET=... FUZZ_DURATION=...`
# and CI run identical commands.
run: make fuzz

- name: Upload crash artifacts
if: failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: go-fuzz-crashes-${{ matrix.target }}
path: go-native/ressrf/internal/engine/testdata/fuzz/${{ matrix.target }}/
retention-days: 30
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading