Repository navigation
Releases: Guard-Core/nethttp-guard
Releases · Guard-Core/nethttp-guard
Release list
v1.4.0
v1.4.0 (2026-10-09)
The websocket guard and the adapter lifecycle surface (guard-core-go v4.3.2 floor)
Added
- The websocket handshake guard (#25):
GuardWebSocket(engine, r)runs the engine's websocket handshake checks over the upgrade request (identity resolution, the fail-secure unknown-address close, the ban probe, theis_ip_allowedverdict, the ws rate limit, and the penetration detection pass sharing the HTTP pipeline's suspicious counts). A nil result allows the upgrade; a non-nil reason closes it. A nil engine fails closed with the security-check-failed reason.WebSocketHTTPStatusmaps a close reason onto the HTTP status an upgrade rejection carries (503 try-again-later, 403 policy violation). The ws request shim mirrors the reference_WebSocketGuardRequest: method WEBSOCKET, empty body, repeated headers joined with a comma, fresh request state. - The adapter lifecycle surface (#26): the fastapi-guard middleware lifecycle ops (the FEATURE_MATRIX_GO adapter row's PARTIAL/MISSING entries) as explicit functions over the engine handle (the same seam as
GuardWebSocketandAddStatusRoute):MarkInitialized(a warmed engine makesInitializea no-op),GetInitializationStatus(the payloadAddStatusRouteserves),Reset(the rate limiter's windows, redis and in-memory),AgentStats(enabled/degraded merged with the wired handler's stats), andRefreshCloudIPRanges(the redis-backed refresh at the configured TTL, the referencecloud_handler.refresh_async, or the in-memory refresh; no blocked providers is the reference's no-op early return).
Changed
- Raised the engine floor to
github.com/rennf93/guard-core-go/v4 v4.3.2, the adapter-parity release. The v4.3.2 engine carries the ReDoS static-safety trio with the pattern_safety corpus going registry-free (94/94, 0 divergences), the sus-patterns runtime registry with thepattern_detectedenvelope and real dynamic-rules application, thecustom_response_modifierresponse pass (Engine.ModifyResponseexposes it to this adapter for pass-through composition), the websocket guard surfaceGuardWebSocketdrives with suspicious counts shared with the HTTP pipeline, the fifteen SecurityConfig knobs with the performance-monitor wiring (redis tuning,body_read_timeoutunder a slot budget,log_country_check_level,agent_strict+on_error, the pattern-validation cache path, the per-request scan budgets), and the lifecycle/state surface the functions above call (manager exports,GeoIPManager.IsInitialized, the cross-instance middleware state registry, the engine side ofMarkInitialized/AgentStats). The floor also bringsredis/go-redis/v9v9.23.0 transitively, clearing the stdlib-adjacent x/sys exposure (the engine's x/sys v0.48.0); govulncheck stays clean. Everything else flows through the unchanged middleware surface. - Post-transfer metadata sweep (e87d9c8): repo URLs, docs links, and ecosystem references point at the Guard-Core org, and the upstream-drift suite checks out
Guard-Core/guard-core-go@master. Module paths, Go imports, and the CHANGELOG history line are deliberately unchanged.
v1.3.1
v1.3.1 (2026-10-07)
guard-core-go v4.3.1 floor (route-id ownership, the trusted-proxy XFF chain walk, agent enrichment)
Changed
- Raised the engine floor to
github.com/rennf93/guard-core-go/v4 v4.3.1, the family-parity release. The v4.3.1 engine carries the route-id ownership contract from @HardMax71's report (guard-core #140, reference fix #141/#142): every decorated endpoint owns its route id and the engine'sGetEndpointIDprefers the request'sGuardRouteID(then the runtimeguard_endpoint_idextra, thenMETHOD:redacted-path), so behavioral usage/return counters key per route instead of collapsing ontoMETHOD:path; adapters that attach route ids to requests get per-route behavioral buckets with no adapter code. The floor also brings the trusted-proxy XFF chain walk (client identity resolves throughX-Forwarded-Forbehind configured trusted proxies, depth-selected from the right with the right-to-left walk fallback, instead of keying bans, rate limits, geo rules and behavioral counters on the proxy IP), the agent enrichment tier (EnableEnrichment/AgentProjectID/OtelServiceName/OtelResourceAttributes), the composite/OTel/Logfire agent handlers with theAgentHandlerFuncadaptation seam, structured JSON logging (LogFormat/LogFile), and the cost-parity detection loop (literal prefilter, rune-API scans, fail-closed cost ceilings). Everything flows through the unchanged middleware surface.
Added
- The reference status route (#23, landed on master after the v1.3.0 tag without a changelog entry):
AddStatusRoute(mux, engine, path)registers a GET handler serving the engine's initialization snapshot JSON (cloud_providers ready/last_refreshed/entries per provider, geo_ip null or the configured resolver's status, redis enabled plus a live O(1) probe with the failure string) atDefaultStatusPath(/_guard/status) by default, never mutating engine state - the fastapi-guardadd_status_route+HandlerInitializer.get_initialization_statusparity.
v1.3.0
guard-core-go v4.3.0 floor (the corpus-parity engine)
Changed
- Raised the engine floor to
github.com/rennf93/guard-core-go/v4 v4.3.0, the corpus-parity release. The v4.3.0 engine is validated against the full conformance corpus: the pattern_safety, events and redis_interop suite kinds now run against the real engine alongside detect and pipeline (fail-closed baselines), the spec 12 observable event stream is ported (security event bus, metrics collector, dynamic-rules agent pipeline, the emission fidelity wave that closes the events surface to reference parity at 32 of 38 cases), plus the detection performance monitor, the security-headers Redis cache with the cross-worker sync contract, and the manager-level geo country verdict (GeoIPManager.CheckCountryAccess). Everything flows to the adapter through the unchanged middleware surface: agent integrations receive the new event stream via the existing handler hooks, and the engine-level changes require no adapter code. The module'sgodirective follows the engine to 1.26.0 (the engine's toolchain floor), and the CI matrix (ci.yml and release.yml), the example-app smoke images and the Makefile's GO_IMAGE move to go 1.26 with it, mirroring the engine's own go 1.26 floor wave (guard-core-go #36). - Dependency bumps: the codeql-action suite to 4.38.2 (#17) and golang.org/x/text v0.41.0 to v0.42.0 via the engine module graph.
Added
- A hard 100% coverage gate wired into CI (#20): the adapter surface is fully covered (
coverage_test.godrives the shim and middleware paths the pipeline exercises), and the gate (check_coverage.sh) fails closed on a missing or empty profile and refuses anything under 100% total. - staticcheck joins the CI gates (#19) with the findings fixed ahead of the gate.
- The upstream-drift suite runs on go 1.26 (#18) to match engine master's toolchain floor, and the live-smoke workflow fronts the advanced app with an nginx edge so the smoke asserts through the real deployment shape (#19).
- The guard-core process baseline (#19): hygiene files (SECURITY, CONTRIBUTING, Code of Conduct, funding, issue and PR templates), dependabot, the labeler and scheduled lint.
v1.2.0
v1.2.0 (2026-09-27)
guard-core-go v4.2.0 floor (the parity engine)
Changed
- Raised the engine floor to
github.com/rennf93/guard-core-go/v4 v4.2.0, replacing the master pseudo-version pin with the real parity tag. The v4.2.0 engine is the parity release validated against the shared conformance corpus (spec 4.1.0, 219 cases; pipeline gate 35 passed, 0 failed, 0 xfail, 0 config divergences) and carries everything the pseudo-version pin already exercised plus the full feature surface: behavior rules (global_behavior_rules, per-route BehaviorRules, Engine.ProcessResponse return rules), the IPInfo geo lifecycle with OnGeoEvent (country_blocked, geo_lookup_failed, decorator_violation), per-route detection exclusions and enable_suspicious_detection, Retry-After from the tripped rate-limit tier window, the corrected CORS response surface (Allow-Methods/Headers, 3600 Max-Age, wildcard plus credentials downgraded at policy resolution), and the reference-shape passive on_block hook payloads (empty trigger_info, null status_code, inline ip_security/deny dispatch). The intermediate master pin (v4.0.5-0.20260927055209) existed only to pick up the 4.1.0 passive on_block contract ahead of the tag; v4.2.0 supersedes it.
v1.1.0
Security headers on pass-through responses
Added
- Security headers on every pass-through response. The adapter applies the engine's
ResponseHeaders()set in one loop before the handler writes, so clean responses carry the same default header set as blocked ones (mirroring the engine'sprocess_response). DisablingSecurityHeadersrestores the header-free pass, and config overrides plus custom headers flow through the adapter untouched.
v1.0.1
guard-core-go v4.1.0 floor bump
Changed
- Raised the engine floor to
github.com/rennf93/guard-core-go/v4 v4.1.0. The engine now attaches its default security headers to blocked responses, and the adapter translates that header set verbatim alongside the verdict status and body. The floor also carries the engine's per-route IP allow/block lists,exempt_ips, geo country blocking, and CORS support. - The suite now requires the engine's security headers on blocked responses. The
TestMiddlewareBlocksBannedIPExactlylockstep window (headers optional while the adapter floor lagged the engine) is closed: a blocked response must carry exactly the engine's default security header set, verbatim, with nothing added and nothing stripped.
v1.0.0
First stable release (v1.0.0)
Added
- The first stable release of nethttp-guard, the net/http middleware adapter for the guard-core-go engine. It translates
*http.Requestinto the guardcore request surface, runs the engine, and translates verdicts to exact HTTP responses. Works with the stdlib mux, chi, httprouter, gorilla, and anything speakingfunc(http.Handler) http.Handler. - 17/17 security checks parity with guard-core 4.0.4, covering suspicious activity detection, penetration attempts, IP bans and allow lists, cloud provider detection, rate limiting, HTTPS enforcement, required headers, referrer policy, user agent filtering, and route-level configuration, with binary-noise gates on the detection engine.
- Fail-closed behavior on engine malfunctions: any engine error answers 500 instead of letting the request through. Detection covers at most the first
MaxBodyBytesof the body (default 262144, tunable vianethttp.WithMaxBodyBytes); payloads beyond the bound are not scanned, and the full body still reaches your handler untouched. - Route-level configuration via
engine.Routes.Registerplusnethttp.WithRouteID(ctx, id)on the request context, and a swappable fail-closed logger vianethttp.WithLogger(l). - Documentation site (MkDocs: index and usage/configuration pages), simple and advanced example apps, and a dockerized live smoke workflow over the example apps.
Changed
- Migrated to the guard-core-go
/v4module path. The dependency is nowgithub.com/rennf93/guard-core-go/v4 v4.0.4and every import usesgithub.com/rennf93/guard-core-go/v4/guardcore. The previousgithub.com/rennf93/guard-core-go v0.1.0pre-release is retired. - Release engineering harmonized with guard-core-go: a dockerized
Makefile(install, test, lint, clean, bump-version) and a stdlib-only.github/scripts/bump_version.pythat scaffolds this changelog; the git tag is the version. - Upstream drift guard, demo container publishing, and community workflows from the parity polish: a daily test run of the adapter suite against guard-core-go@master, a container-release workflow for the demo image, docs publishing to GitHub Pages, plus labeling, staleness, and greetings workflows.