rennf93/guard-core-php
Framework-agnostic core for Guard, the PHP authentication and authorization library. Provides reusable primitives for guards, identity checks, and access control, usable in standalone PHP apps or alongside Laravel and other frameworks.
detectionMaxScanSeconds (default 10.0, range 0.1–60.0) caps summed regex scan CPU time per request and records a weighted pattern_timeout threat when exhausted. This gives us a concrete performance envelope to test against and tune per environment. It also prevents padding a request to skip detection. Note the cap applies to engine request scans, not direct detect() calls.dynamicRuleInterval (default 300, minimum 60) gates dynamic rule fetches, and dynamic rules now apply over the base config: ip_blacklist becomes a timed ban through the ban manager, ip_whitelist unbans, country/cloud-provider/user-agent/rate-limit rules replace base values, failed applies keep the previously active version, expiry restores base, and duplicate patterns are not re-added. This supports on-call/security teams changing posture without a deploy.GuardEngine::applyResponseModifier() and customResponseModifier provide a sanctioned seam applied once, after security headers and before CORS, with exceptions leaving the response unmodified. This supports multi-tenant block pages, branded responses, compliance messaging, and adapter behavior without forking the package.excludedSemanticDetectionHeaders is opt-in and semantic-only; listed headers still get regex scanning. Useful for headers that legitimately carry rich content while retaining XSS/SQLi/CRLF coverage.processResponse emits response_time, request_count, and error_rate when an agent handler with sendMetric is attached and agentEnableMetrics is on. Passive-mode suspicious logs now retain Reason: <reason>, and cookie scanning is per name=value pair, which should cut false positives on ordinary authenticated traffic while still detecting XSS, SQLi, and CRLF inside a single cookie.trustedProxies unix token, spoof detection) and IP list precedence (global whitelist decides alone; blacklist only when no whitelist; route whitelist skips global lists; route blacklist only when route has no whitelist). This directly affects whether a ban or allowlist entry actually matches the client, which is a product-trust issue, not just a bug fix.detectionMaxScanSeconds gives you a tuning knob and a threat record when the budget is spent.enableAgent is now required for enableDynamicRules and enableEnrichment to validate, and dynamic rule initialization depends on an agent handler with getDynamicRules().enableAgent prerequisite. Configs that enabled dynamic rules or enrichment without the agent will no longer validate; this is a migration gate.sendMetric and agentEnableMetrics enabled.detectionMaxScanSeconds default 10.0 (tune per route; direct detect() calls are uncapped), enableAgent now required for enableDynamicRules and enableEnrichment to validate, dynamicRuleInterval default 300 with a floor of 60, and an applyResponseModifier seam applied once after security headers and before CORS. Client IP resolution and IP-list precedence now match the reference, so expect ban, rate-limit, and allowlist decisions to shift. Regression-test proxy chains, trustedProxies, CIDRs, IPv4-mapped IPv6, zoned addresses, and route/global whitelist-blacklist behavior. Metrics only flow with an agent handler exposing sendMetric and agentEnableMetrics on.”ip_blacklist is a timed ban through the ban manager, ip_whitelist unbans, and emergency mode halves the auto-ban threshold once. Passive-mode suspicious logs retain the reason, and cookie scanning is per name=value pair, which should reduce false positives on normal authenticated traffic while keeping XSS, SQLi, and CRLF detection inside a single cookie. A forwarded header from an untrusted peer raises spoofing_detected once with a redacted chain.”How can I help you explore Laravel packages today?