Commit Graph

310 Commits

Author SHA1 Message Date
David Osipov f754630172
fix: address all remaining Copilot review issues from PR-421
- .cargo/config.toml: strip all clippy::* lints from rustflags; they are
  unknown to rustc and produce spurious 'unknown lint' warnings on every
  cargo build/check/test invocation.  Only rustc-native lints (unsafe_code,
  trivial_casts, rust_2018_idioms, etc.) remain.  clippy lints must be
  enforced exclusively via the cargo clippy invocation in CI.

- crypto/hash.rs: replace unreachable!() in sha256_hmac with
  #[allow(clippy::expect_used)] + .expect().  unreachable!() triggers
  clippy::panic which is globally denied; the structural infallibility of
  HmacSha256::new_from_slice makes expect() correct here.

- protocol/obfuscation.rs: replace unreachable!() in generate_nonce with
  #[allow(clippy::panic)] + panic!() and add adversarial-RNG regression
  test that verifies the panic fires after MAX_NONCE_ATTEMPTS exhaustion.

- tls_front/fetcher.rs: fallback branch in build_client_config now calls
  ClientConfig::builder_with_provider(provider) instead of
  ClientConfig::builder(), preventing a silent crypto-backend switch from
  ring to the global default in the error path.

- transport/middle_proxy/secret.rs: (1) add max_len < PROXY_SECRET_MIN_LEN
  early guard at function entry so callers get an explicit validation error
  before any HTTP round-trip; (2) replace data.len() + chunk.len() with
  checked_add to prevent usize overflow bypassing the hard cap; (3) remove
  temp file on write failure; (4) add six streaming-cap regression tests
  covering cap rejection, overflow guard, and boundary acceptance.
2026-03-14 23:52:03 +04:00
David Osipov d7da0b3584
fix: log JoinErrors in reconnect_all; restore pub(crate) for EdgeConnectionsCacheEntry
- pool_config.rs: replace silent .is_some() drain with while-let that logs
  JoinError, making panics in reconnect tasks visible in production logs.
  Add tokio regression test verifying panicking tasks yield JoinError.
- runtime_edge.rs: revert EdgeConnectionsCacheEntry visibility from pub to
  pub(crate); the type is internal to the api module and must not be
  exported beyond crate scope.
- Copilot issues for dashed lint names, unreachable!/clippy::panic, and
  tokio::rename atomicity were confirmed false positives via empirical
  cargo clippy runs and POSIX semantics analysis.
2026-03-14 23:04:44 +04:00
David Osipov 3ec316fbcd
fix: enforce streaming cap before accumulation, unique tmp path, bounded reconnects, buffer zeroization, restrict type visibility
- secret.rs: swap resp.bytes() for resp.chunk() loop; reject each chunk before
  it is appended so hard_cap is never exceeded in memory (OOM/DoS fix).
  Replace fixed ".tmp" suffix with unique_temp_path() (timestamp + atomic
  counter) to prevent concurrent-writer collisions on the cache file.

- pool_config.rs: add MAX_CONCURRENT_RECONNECTS=32 and batch the reconnect_all
  task spawn loop to prevent a thundering-herd burst on large pools.

- buffer_pool.rs: call fill(0u8) before clear() in return_buffer() to
  overwrite the initialized region of every returned buffer (OWASP ASVS L2
  V8.3.6). Add unsafe backing-byte test to verify zeroization at the
  allocation level, not merely via the safe len==0 API.

- api/events.rs, api/runtime_stats.rs: restrict ApiEventStore and
  MinimalCacheEntry from pub to pub(crate) — both are consumed only within
  the api module tree and should not be part of the public API surface.
2026-03-14 22:45:01 +04:00
David Osipov 9f6c5aafd4
Reapply security hardening on top of upstream/main
Rebase the security hardening stack onto upstream/main after telemt/flow was
merged upstream. This keeps the transport, TLS fronting, middle-proxy, CI
policy, and regression-test changes in a clean PR branch without including
private .David_docs material.
2026-03-14 22:10:57 +04:00
Alexey 4677b43c6e
TLS-F New Methods 2026-03-14 20:38:24 +03:00
Alexey 8b0b47145d
New Hot-Reload method 2026-03-14 18:54:05 +03:00
Alexey 780fafa604
Src-IP in ME Routing + more strict bind_addresses 2026-03-14 02:20:51 +03:00
Alexey a15f74a6f9
Configured middle_proxy_nat_ip for ME Gate on strartup 2026-03-13 16:52:24 +03:00
David Osipov 40dc6a39c1
fix(socket): validate ack_timeout_secs and check setsockopt rc 2026-03-11 21:10:58 +04:00
David Osipov 8b5cbb7b4b
Add Rust coding conventions and self-explanatory commenting guidelines; update dependencies and version in Cargo files; enhance OpenBSD support in installation and documentation; improve TCP socket configuration and testing 2026-03-11 20:49:51 +04:00
Alexey be24b47300
Per-upstream Runtime Selftest 2026-03-10 01:25:28 +03:00
Alexey 8cd719da3f
Bnd-block in API fixes 2026-03-10 01:16:21 +03:00
Alexey 959d385015
ReRoute state in API 2026-03-10 00:59:25 +03:00
Alexey a383f3f1a3
API Defaults 2026-03-10 00:27:36 +03:00
Alexey b315e84136
Update users.rs 2026-03-10 00:09:11 +03:00
Alexey 1d8de09a32
Update users.rs 2026-03-10 00:06:43 +03:00
Alexey 796279343e
API User Deletion fixes 2026-03-10 00:04:38 +03:00
Alexey 161af51558
User Management in API 2026-03-10 00:02:39 +03:00
Alexey 100ef0fa28
Correct IP:port/public-host:public-port in API 2026-03-09 23:37:29 +03:00
Alexey b950987229
ME Selftest 2026-03-09 20:35:31 +03:00
Alexey 97926b05e8
Update admission.rs 2026-03-09 13:44:27 +03:00
Alexey 4c94f73546
Maestro - Refactored Main Format 2026-03-09 11:05:46 +03:00
Alexey d0f253b49b
PROXY Real IP in logs 2026-03-09 01:55:07 +03:00
Alexey ef2ed3daa0
ME/DC Reroute + ME Upper-limit tuning 2026-03-09 00:53:47 +03:00
Alexey 633af93b19
DC to Client fine tuning 2026-03-08 04:51:46 +03:00
Alexey c28b82a618
Update defaults.rs 2026-03-08 03:45:01 +03:00
Alexey fca0e3f619
ME Writer Pick in Metrics+API 2026-03-08 03:06:45 +03:00
Alexey 9401c46727
ME Writer Pick 2026-03-08 03:05:47 +03:00
Alexey 6b3697ee87
ME Active-by-Endpoint 2026-03-08 03:04:27 +03:00
Alexey c08160600e
Update pool_writer.rs 2026-03-08 03:03:41 +03:00
Alexey cd5c60ce1e
Update reader.rs 2026-03-08 03:03:35 +03:00
Alexey d2baa8e721
CPU/RAM improvements + removing hot-path obstacles 2026-03-07 19:33:48 +03:00
Alexey 5f77f83b48
ME Adaptive Floor Upper-Limit 2026-03-07 17:27:56 +03:00
Alexey 5ac0ef1ffd
Init in API 2026-03-07 16:18:09 +03:00
Alexey e1f3efb619
API from main 2026-03-07 15:37:49 +03:00
Alexey 258191ab87
Routed DC + Strict ME Writers
Co-Authored-By: brekotis <93345790+brekotis@users.noreply.github.com>
2026-03-07 13:40:57 +03:00
Alexey 27e6dec018
ME Strict Writers
Co-Authored-By: brekotis <93345790+brekotis@users.noreply.github.com>
2026-03-07 13:32:02 +03:00
Alexey 93f58524d1
No busy-poll in ME
Co-Authored-By: brekotis <93345790+brekotis@users.noreply.github.com>
2026-03-07 03:25:26 +03:00
Alexey 0ff2e95e49
Event-driven Drafts
Co-Authored-By: brekotis <93345790+brekotis@users.noreply.github.com>
2026-03-07 03:22:01 +03:00
Alexey ce9698d39b
ME Adaptive Floor Planner
Co-Authored-By: brekotis <93345790+brekotis@users.noreply.github.com>
2026-03-07 02:50:11 +03:00
Alexey 02fe89f7d0
DC Endpoints on default
Co-Authored-By: brekotis <93345790+brekotis@users.noreply.github.com>
2026-03-06 20:00:32 +03:00
Alexey 24df865503
Session by Target-DC-ID
Co-Authored-By: brekotis <93345790+brekotis@users.noreply.github.com>
2026-03-06 19:59:23 +03:00
Alexey e9f8c79498
ME Pool w/ Strict-Index 2026-03-06 19:58:57 +03:00
Alexey 4221230969
API Events + API as module 2026-03-06 18:55:20 +03:00
Alexey d87196c105
HTTP Utils for API 2026-03-06 18:55:04 +03:00
Alexey da89415961
Runtime API on Edge 2026-03-06 18:54:37 +03:00
Alexey 2d98ebf3c3
Runtime w/ Minimal Overhead 2026-03-06 18:54:26 +03:00
Alexey fb5e9947bd
Runtime Watch 2026-03-06 18:54:12 +03:00
Alexey 2ea85c00d3
Runtime API Defaults 2026-03-06 18:54:00 +03:00
Alexey 2a3b6b917f
Update direct_relay.rs
Co-Authored-By: brekotis <93345790+brekotis@users.noreply.github.com>
2026-03-06 18:53:28 +03:00