CDG / ENGINEERINGContactSign in ↗

Cybersecurity

Crustacian

Endpoint scanning and durable telemetry delivery, with collision-safe SQLite ingestion.

Research applicationoriginal systempublic

ORIGINAL CONTRIBUTIONS

What I built.

  • Built endpoint scan orchestration around ClamAV and durable NDJSON telemetry transport.
  • Implemented validated SQLite ingest, exact acknowledgment behavior, and transactional evidence collision checks.
  • Demonstrated backpressure, incomplete acknowledgments, and retry recovery with one stored event.

Crustacian / SYSTEM MAP

How this system connects.

Scanorchestration1Durable NDJSONspool2Ingestboundary3SQLite ingestledger4
  1. 01 / Scan orchestration: Wrap the independent ClamAV scanner and emit endpoint evidence.
  2. 02 / Durable NDJSON spool: Retain events until complete acknowledgment.
  3. 03 / Ingest boundary: Validate incoming endpoint batches and control request load.
  4. 04 / SQLite ingest ledger: Commit accepted events and identify replays.
Directed connections
  • 1 → 2: structured endpoint event (implemented)
  • 2 → 3: versioned batch over configured transport (implemented)
  • 3 → 4: validated transaction (implemented)
  • 3 → 2: whole-batch acknowledgment / retry guidance (implemented)

SYSTEMS DESIGN & OWNERSHIP

Engineering below the surface.

Reliability across a disconnected endpoint

The Rust endpoint produces structured evidence, writes it to a durable NDJSON spool and sends bounded batches. Queue removal depends on a complete acknowledgment; a transport error or partial acknowledgment leaves evidence available for retry.

The ingest response follows the database commit

The receiver validates batch shape, endpoint identity and event IDs before the SQLite transaction. Identical retries are harmless, while conflicting facts under the same identity reject the batch. This separates delivery retry from evidence replacement.

Failure recovery is demonstrated end to end

The deterministic replay uses the real spool, loopback HTTP transport and SQLite store. It injects a 503 and incomplete acknowledgment, then retries to exactly one stored event. ClamAV provides malware detection; the original work here is orchestration, transport and evidence handling.

EXPLORE THE ARCHITECTURE

Components. Contracts. Consequences.

Endpoint filesystem → local spool → loopback ingest behind a separately configured TLS proxy → SQLite. ClamAV is upstream software; no live endpoint connects to this portfolio.

01 / Scan orchestration

Wrap the independent ClamAV scanner and emit endpoint evidence.

Implementation

CLI invokes clamscan or clamdscan and writes structured scan telemetry.

Security & failure behavior

The portfolio uses synthetic fixtures. Real scan menus include response modes that are outside the demonstration. Missing scanner or nonexistent paths produce operational errors.

Tradeoff

ClamAV supplies detection; this project supplies orchestration and telemetry.

02 / Durable NDJSON spool

Retain events until complete acknowledgment.

Implementation

Delivery locks serialize shipment and atomic spool replacement; bounded retries persist scheduling state.

Security & failure behavior

Only a complete successful response authorizes removing the shipped prefix. Partial acknowledgment, transport errors and backpressure retain queued events.

Tradeoff

File-based queues are inspectable but require coordinated writers and storage budgets.

03 / Ingest boundary

Validate incoming endpoint batches and control request load.

Implementation

Loopback TCP HTTP service checks schemas, body budgets, endpoint identity tokens and in-flight limits.

Security & failure behavior

Shared or endpoint-scoped tokens are configurable; public TLS is delegated to a proxy. The native listener refuses non-loopback binds. Malformed batches or token mismatches are rejected; overload returns retry guidance.

Tradeoff

A small native HTTP implementation reduces dependencies but needs strict framing validation.

04 / SQLite ingest ledger

Commit accepted events and identify replays.

Implementation

Immediate transactions index endpoint_id and event_id; conflicting duplicate payloads fail.

Security & failure behavior

The ingest response follows committed persistence; immutable replay identity prevents silent evidence replacement. Database errors or conflicting event IDs fail the batch.

Tradeoff

Single-node persistence; distributed replication and production scale remain unverified.

Open full 2D architecture →

TECHNICAL CASE STUDY

Decisions behind the system.

Engineering problem

Retain endpoint scan evidence through retries and delivery failures without silently accepting contradictory facts.

Requirements & constraints

ClamAV orchestration, NDJSON transport, stable endpoint/event identity, durable ingestion, and non-destructive fixture verification.

Architecture & technologies

Rust endpoint scanner and spool; authenticated ingest service and SQLite event store. Dependency and platform behavior are scoped to local Linux verification.

Security & trust boundaries

Endpoint identities scope event IDs. Import collision validation protects evidence integrity; the portfolio never starts endpoint quarantine or exposes scan administration.

Original engineering

CharlesDerek initial history and MIT attribution; later commits include explicitly named Omniplexs Agent assistance. Third-party ClamAV is a dependency, not an independently authored antivirus engine.

Working implementation

Scanning orchestration, event transport and ingest persistence exist in source. This cycle exercises legacy migration with synthetic JSON fixtures.

Experiments & missing capabilities

Cross-platform execution, production throughput, and integrated Athernex investigation are not established by these tests.

Failure modes & concurrency

Conflicting identities within import input fail before database creation. Conflicts against persisted evidence roll back the whole transaction; semantic JSON retries remain harmless.

Testing & evidence

40 tests pass after adding the deterministic exporter: 26 library, 4 CLI, 9 ingest and 1 replay-repeatability test. Build, fmt and strict Clippy pass. Three import-integrity regressions fail against the previous implementation.

Observable improvement

Before: legacy import silently discarded conflicting facts and could retain unrelated writes. After: fail-closed collision detection, atomic rollback, and accurate replay counts. Local commit 326fd79.

Deployment model

Independent endpoint and ingest components. The portfolio presents the tested spool/HTTP/SQLite replay; no live endpoint service or privileged scanning interface is exposed.

Decisions & alternatives

Semantic JSON comparison avoids treating formatting as evidence changes. Last-write-wins would hide contradictory facts and was rejected.

Demonstration & limitations

The Endpoint delivery replay exercises actual durable append, loopback HTTP sender, validation, SQLite commit and acknowledgment compaction. A 503 and incomplete acknowledgment retain the event; replay stores exactly one row. It does not exercise the scanner, TLS, authentication, Athernex, or investigation UI.

ENGINEERING SCOPE

Clear boundaries.

Verified original scanning orchestration and telemetry implementation; ClamAV supplies the antivirus engine.

  • ClamAV remains the external antivirus engine.
  • Public replay does not execute a scanner, quarantine, TLS authentication, or production endpoint response.