Sanitize PCAP & CI/CD · cicd_parser_suite.frasm · 22 framesFrameAssembly v3.2.2

Replace Mystery Binary .pcap Fixtures in Git & CI/CD With .frasm

Every DPI, eBPF/XDP, service-mesh, or SIEM repository has a cursed tests/fixtures/ folder stuffed with binary .pcap blobs nobody can review in a pull request or update without breaking TCP sequence numbers.

Protocols in capture: tcphttp2grpcpostgresmqtt
Raw .md
Problem

The Catch

Binary .pcap files are miserable in Git: git diff just prints Binary files differ, security scanners flag unknown binary blobs, and changing a gRPC method name or SQL query string requires recapturing live microservices in Docker.

Checking in .frasm text files (text/vnd.frameassembly) gives pull-request reviewers line-by-line diffs while the rootless frameassembly CLI or Rust frameassembly crate compiles byte-identical .pcap / .pcapng fixtures in under 1 millisecond during CI.

Setup & Topology

Microservice & Telemetry Parser CI Suite (gRPC + PostgreSQL v3.0 + MQTT QoS 1)

App Gateway (10.90.1.10) <-> gRPC Mesh (:50051), PostgreSQL (:5432) & MQTT Broker (:1883)

Twenty-two deterministic frames exercise three complex binary/framed Layer 7 dissectors in a single CI fixture: (1) TCP 50051 handshake + http2 settings + grpc /ledger.Payments/Authorize (grpcstatus 0 OK followed by grpcstatus 14 UNAVAILABLE); (2) TCP 5432 handshake + postgres startup -> authok -> query -> errorresponse; and (3) TCP 1883 handshake + mqtt connect -> connack -> qos 1 retained publish -> puback.

Adapt It for Your Network

  1. Commit .frasm specs alongside your Suricata rules, Zeek scripts, eBPF parsers, or Wireshark Lua dissectors in Git.
  2. Compile to .pcap or nanosecond .pcapng inside CI via the frameassembly CLI or cargo add --dev frameassembly.
  3. When an existing binary fixture needs updating, run frameassembly reverse legacy.pcap fixture.frasm once and delete the opaque blob.

.frasm -> .pcap

Preview frames inline or open in Playground ->

Compiles 22 multi-service frames (HTTP/2 + gRPC status trailers, PostgreSQL v3.0 wire frames, and OASIS MQTT QoS 1) with deterministic timestamps.

cicd_parser_suite.frasm
Open in Playground
host app_gw { ip 10.90.1.10 }
host backend_sv { ip 10.90.2.50 }
flow grpc_mesh_fixture(c, s) {
// 1. HTTP/2 + gRPC call succeeding (0) and failing over (14 UNAVAILABLE) on TCP 50051
c -> s tcp syn srcport 55051 dstport 50051 win 65535 mss 1460 wait 1ms
c <- s tcp syn ack win 65535 mss 1460 wait 1ms
c -> s tcp ack wait 1ms
c -> s http2 settings wait 1ms
c -> s grpc service "ledger.Payments" method "Authorize" wait 2ms
c <- s grpc grpcstatus 0 wait 2ms
c -> s grpc service "ledger.Payments" method "Settle" wait 2ms
c <- s grpc grpcstatus 14 wait 3ms
}
flow postgres_and_mqtt_fixtures(c, s) {
// 2. PostgreSQL v3.0 Startup -> AuthOk -> SQL Query -> ErrorResponse on TCP 5432
c -> s tcp syn srcport 55432 dstport 5432 win 65535 mss 1460 wait 1ms
c <- s tcp syn ack win 65535 mss 1460 wait 1ms
c -> s tcp ack wait 1ms
c -> s postgres startup user "ci_runner" db "ledger" wait 1ms
c <- s postgres authok wait 1ms
c -> s postgres query sql "SELECT tx_id, amount_cents FROM transfers LIMIT 5;" wait 2ms
c <- s postgres errorresponse wait 3ms
// 3. OASIS MQTT v3.1.1 Connect -> ConnAck -> QoS 1 Publish -> PubAck on TCP 1883
c -> s tcp syn srcport 51883 dstport 1883 win 65535 mss 1460 wait 1ms
c <- s tcp syn ack win 65535 mss 1460 wait 1ms
c -> s tcp ack wait 1ms
c -> s mqtt connect clientid "ci-sensor-01" keepalive 30 wait 1ms
c <- s mqtt connack returncode 0 wait 1ms
c -> s mqtt publish topic "ci/line1/watts" qos 1 retain pktid 10 payload "{\"w\":412.5}" wait 1ms
c <- s mqtt puback pktid 10 wait 1ms
}
compile {
grpc_mesh_fixture(app_gw, backend_sv)
postgres_and_mqtt_fixtures(app_gw, backend_sv)
}
Local CLI Build, Inspect & Replay Commands
# 1. Compile deterministic .pcapng in CI/CD (under 1ms, zero root privileges)
frameassembly cicd_parser_suite.frasm cicd_parser_suite.pcapng

# 2. Assert decoded gRPC, PostgreSQL, and MQTT fields in automated tshark / Zeek checks
tshark -r cicd_parser_suite.pcapng -Y "grpc || pgsql || mqtt"

# 3. Or convert legacy binary Git fixtures into reviewable .frasm source once
frameassembly reverse legacy_fixture.pcap readable_fixture.frasm
Browser Tab -> Local Terminal & VS Code

Keep cicd_parser_suite.frasm in Git and build .pcap in under 1ms

Single rootless binary + VS Code extension with live squiggles, quick-fixes, and side-by-side packet ladders ready for Wireshark.

Grab CLI + VS Code ->

Related Examples

All 81 Protocols ->