feat(ip-enrich): consume dunite-ipenrich for advisory ASN/VPN lookup (BUNYIP-475) #493
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/BUNYIP-475-consume-ipenrich"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes BUNYIP-475 (BUNYIP-437 follow-up): mokosh becomes the second product consuming the shared
dunite-ipenrichcrate, so the same offline IP2Proxy ASN/VPN signal is available here without a second implementation that would drift. This satisfies the BUNYIP-437 "consumable by at least two products without duplicating ingestion" criterion in full (bunyip was the first consumer).Manifest
Adds
dunite-ipenrichpinned atae62c27(the dunite rev that introduced it). It is a leaf crate (owns its error, depends only onip2location), so it is pinned independently of the olderdunite-stripe-corerev; theCargo.lockchange is just the new crate (9 lines, no unrelated churn).Wiring (mirrors the geoip service)
IP2PROXY_DB_PATH->ip2proxy_db_path, an offline IP2Proxy PX.BIN.main.rsbuilds an optionalIpEnrichService; unset or a failed load leaves itNoneand the feature reports nothing (never fatal). Threaded positionally throughcreate_api_routerexactly likegeoip.ip_enrichmodule exposes an admin-gatedGET /api/v1/ip-enrichment?ip=<addr>(RequireAdmin) that returns ASN, owning organization, ISP, classified network category and VPN/proxy likelihood labels, a one-bitis_anonymizing, and an always-trueadvisorymarker.None-tolerant: no dataset / private / unknown address all returnnull; only a malformed IP is a 400.Advisory, never a verdict
The signal describes an address for an admin reviewing an IP (e.g. an actor IP in the audit log), never an automatic abuse verdict. mokosh has no automated IP abuse decision to hook, so the lookup is the honest surface; a VPN must not auto-classify a request, per BUNYIP-437.
Tests / verification
is_anonymizing, always-advisory; a data-centre address is not flagged anonymizing).rust-builder-glibc:v1.0.1-rust1.94-trixieimage:cargo fmt --check,cargo clippy --all-targets -- -D warnings(compiles the integration harness, which receives the newNonearg),cargo test --lib,cargo test --docall pass. No.sqlxregen (mokosh uses runtime queries only).🤖 Generated with Claude Code
https://claude.ai/code/session_018TXaT3P192nDsZzbzHETb9