Bảo vệ blind relay khỏi lạm dụng

AeroNyx20 tháng 6, 20267 phút đọc54 lượt xem

Cách node AeroNyx chặn replay, vòng lặp, quá tải và peer lỗi mà không đọc ciphertext, đồng thời cung cấp bằng chứng vận hành bảo vệ riêng tư.

Blind Relay Abuse Guard là ranh giới an toàn của chuyển tiếp mã hóa phi tập trung AeroNyx. Nó giới hạn relay lạm dụng hoặc bất ổn mà không phân tích ciphertext, không tạo lịch sử route lâu dài và không biến operator thành người quan sát traffic.

Trạng thái và phạm vi

Guard được triển khai bằng Rust và kết quả tổng hợp xuất hiện trong node health metadata cùng Nodeboard. Vai trò là kiềm chế và cung cấp bằng chứng trung thực: opaque relay work được accepted, protected, degraded hay stale, không tiết lộ nội dung.

Kiểm soátTrạng thái
Blind payload forwardingĐã triển khai
Signed freshness and replay suppressionĐã triển khai
Previous-hop rate limiting and quarantineĐã triển khai
Privacy-safe runtime evidenceĐã triển khai
Nodeboard operator visibilityĐã triển khai
Plaintext or payload inspectionBị cấm
User, route, or social-graph analyticsBị cấm

Bất biến node mù

Relay có thể xác thực chữ ký routing metadata, áp dụng policy hữu hạn, chuyển opaque envelope và trả terminal-signed receipt. Relay không được kiểm tra hoặc suy ra payload, cũng không lộ metadata có thể dựng lại route, danh tính hay quan hệ xã hội.

  • message plaintext, packet payload, media content hoặc MemChain plaintext
  • DNS content, destination, domain, URL hoặc browsing history
  • route ID, complete path, endpoint URL hoặc client public IP
  • full public key, receiver identity, message ID hoặc social graph
  • private key, voucher secret, wallet-level traffic hoặc decryption material

Luồng tiếp nhận

Mỗi request qua kiểm tra hữu hạn trước khi dùng forwarding capacity. Thứ tự dưới đây mang tính khái niệm; quyết định chỉ dùng signed routing metadata và local aggregate state, không dùng nội dung giải mã.

text
verify signed previous_hop and envelope
apply in-flight backpressure
check timestamp freshness
check route replay cache
apply previous-hop rate/quarantine decision
validate TTL, loop safety, next-hop descriptor, and endpoint
forward opaque ciphertext or terminate into pending store

Bảo vệ replay và độ mới

Replay suppression là local, ngắn hạn và giới hạn dung lượng. Signed timestamp loại frame cũ hoặc quá xa trong tương lai. Bảng là runtime default hiện tại của main, không phải cam kết protocol vĩnh viễn; thay đổi phải cập nhật test và docs.

Hằng runtimeMặc định hiện tại
MAX_BLIND_RELAY_SEEN_ROUTES8192 route IDs
BLIND_RELAY_ROUTE_REPLAY_WINDOW_SECS600 seconds
BLIND_RELAY_PREVIOUS_HOP_RATE_LIMIT120 requests / 60 seconds
BLIND_RELAY_PREVIOUS_HOP_FAILURE_THRESHOLD12 scored failures / 300 seconds
BLIND_RELAY_PREVIOUS_HOP_QUARANTINE_SECS300 seconds
MAX_BLIND_RELAY_PREVIOUS_HOP_BUCKETS4096 buckets
BLIND_RELAY_MAX_ENVELOPE_AGE_SECS600 seconds
BLIND_RELAY_MAX_FUTURE_SKEW_SECS120 seconds
BLIND_RELAY_DELIVERY_RECEIPT_MAX_AGE_SECS120 seconds
MAX_BLIND_RELAY_FORWARD_ATTEMPTS3 attempts

Giới hạn tốc độ và cách ly hop trước

Rate limit theo signed previous-hop identity. Hơn 120 request trong 60 giây bắt đầu local quarantine 5 phút. Failure score riêng bắt đầu cùng cách ly sau 12 validation failure có tính tấn công trong 5 phút.

text
invalid_previous_hop | invalid_signature | self_loop | route_loop | ttl_exhausted

Chỉ adversarial validation reason tăng score. Transport timeout, ACK mất và duplicate route retry không phạt peer khỏe. Bucket store có giới hạn, idle state hết hạn nên không trở thành communication graph lâu dài.

Tính idempotent và retry

Route ID lặp trong replay window nhận idempotent success: ghi một aggregate replay drop nhưng không giao hoặc forward envelope lần hai. Next-hop failure tạm thời thử tối đa ba lần với bounded jitter; validation failure vĩnh viễn không retry.

text
duplicate route_id -> accepted=true, reason=duplicate_route, no second delivery
transient next-hop failure -> bounded retry with deterministic jitter
permanent validation failure -> no retry

Counter runtime tổng hợp

Rust cung cấp coarse cumulative counter và freshness timestamp ở hai path sau. Đây là node-scoped operational evidence, không phải message log, analytics tính phí hay bằng chứng về một conversation cụ thể.

text
system_stats.discovery_status.peer_store.runtime.blind_relay
system_stats.discovery_status.peer_store.peer_health_summary
Nhóm counterTrường
Tiếp nhận và kết quảreceived, terminal, forwarded, rejected
Xác thực và bảo vệinvalid_signature, envelope_too_large, ttl_exhausted, no_route, invalid_endpoint, loop_detected, replay_dropped, timestamp_rejected, rate_limited, quarantined, quarantine_started
Transport và retrybackpressure_dropped, forward_failed, retry_attempted, retry_succeeded, retry_exhausted
Bằng chứng tổng hợpprobe_attempted, probe_succeeded, probe_failed, two_hop_probe_attempted, two_hop_probe_succeeded, two_hop_probe_failed
Giao thực và độ mớiverified_client_onion_deliveries, last_verified_client_onion_delivery_at, last_accepted_at, last_event_at

Ngữ nghĩa chất lượng bằng chứng

Quality summary tách accepted opaque work, synthetic probe, synthetic two-hop proof và terminal-signed client receipt. real_relay_ready yêu cầu fresh authenticated client-originated receipt do expected terminal ký. Không trình bày synthetic evidence như App/user traffic.

statusÝ nghĩa
idleChưa có relay hoặc probe evidence.
observingCó evidence một phần nhưng readiness chưa thiết lập.
staleEvidence thành công trước không còn fresh.
readyCó fresh accepted work hoặc proof, không có active transport attention.
protectingCounter bảo vệ đang hoạt động và relay vẫn chạy.
degradedForwarding hoặc probe failure cần điều tra.
attentionBackpressure hoặc retry cạn cần xử lý ngay.

proof_scope tách client_message_delivery, relay_acceptance, message_delivery, control_plane, single_hop_control_plane, attempted, none. Historical totals tích lũy; readiness cần fresh evidence và tính active transport failures.

Sức khỏe peer bảo vệ riêng tư

peer_health_summary dùng node identifier rút gọn và coarse health bucket để cô lập failing/quarantined peer mà không lộ traffic relationship. Đây là control-plane diagnostic với privacy boundary rõ ràng.

Được phép:

  • node_id_prefix rút gọn
  • coarse health và descriptor state
  • gossip và route success freshness bucket
  • aggregate route success/failure counts
  • aggregate loop/replay/rate-limit/quarantine counts
  • thời gian quarantine còn lại và bounded reason bucket

Không được phép:

  • full node public keys
  • route IDs hoặc endpoint lists
  • encrypted blobs hoặc payload hashes
  • message IDs hoặc receiver identity
  • client IP, destinations hoặc DNS
  • social graph hoặc quan hệ giao tiếp

Quy trình operator

Mở Nodeboard, chọn node, xem Discovery và Security / Relay Protection. Chỉ diễn giải xu hướng cùng node health, reachability, queue pressure và signed proof freshness.

  1. Xác nhận freshness của descriptor và bootstrap recovery.
  2. So sánh accepted_total, accepted_percent và last accepted age trước khi tuyên bố ready.
  3. Phân biệt real_relay_ready với synthetic readiness; chỉ cái đầu chứng minh authenticated client-originated terminal receipt.
  4. Khi protecting, degraded hoặc attention, xem aggregate bucket và transport health mà không yêu cầu user-level log.

Bản đồ source

Dùng repository-relative path để đặc tả vẫn đúng khi chuyển host. Backend và Nodeboard ở repository riêng, chỉ dùng owner-scoped privacy-safe metadata.

LớpĐường dẫn repositoryVai trò
Rust relay APIcrates/aeronyx-server/src/api/chat_peer.rsXác thực envelope, áp dụng loop, replay, freshness, rate, quarantine, retry và terminal receipt.
Rust PeerStorecrates/aeronyx-server/src/services/peer_store.rsLưu bounded counters, peer health, readiness và proof classification.
Rust health APIcrates/aeronyx-server/src/api/vpn_health.rsXuất local privacy-safe health JSON.
Rust reportercrates/aeronyx-server/src/management/reporter.rsMang aggregate status trong heartbeat metadata.
Backend observabilityprivacy_network/api/vpn_observability.pyTrả owner-scoped metadata cho operator console.
Nodeboard typestypes/index.tsĐịnh nghĩa blind relay và peer health type.
Nodeboard detail và i18napp/dashboard/nodes/[id]/page.tsx and lib/i18n/index.tsHiển thị Security / Relay Protection với privacy-boundary copy đã dịch.

Nền tảng cho routing nhiều hop

Multi-hop cần replay resistance, loop containment, bounded retry, peer quarantine và evidence không bị nhầm với user traffic. Guard tạo nền cho layered encryption và route diversity mà không làm yếu blind-node invariant.

Quy tắc phát triển

Mỗi field mới là một privacy review. Metric phải trả lời độ tin cậy node mà không nhận dạng payload, sender, receiver, path, endpoint hoặc conversation.

  1. Giữ payload_b64 opaque trong mọi relay path.
  2. Chỉ thêm aggregate counter hoặc bounded reason bucket.
  3. Không join counter với route, endpoint, user, receiver hoặc message metadata.
  4. Không cộng synthetic probe vào encrypted message, packet và byte totals.
  5. Cập nhật Rust tests, Nodeboard types và mọi ngôn ngữ khi semantics đổi.

Khám phá node và giao relay mã hóa có thể xác minh