wobqqq/nova-aegis-csp
Add Content Security Policy management to Laravel Nova with Aegis. Configure CSP headers, generate nonces, define per-resource policies, and monitor violations from a clean Nova dashboard—keeping your admin panel secure without leaving the familiar Nova interface.
Architecture fit
Content-Security-Policy header via middleware and exposes a service class (CspService) plus an artisan disable command (TurnOffCsp).Integration feasibility
Technical risk
CspService::header() now accepts the scope selected by the middleware rather than the request object, and the disable command delegates to TurnOffCsp.CspService::header() is a public-method contract change even if "internal." Any app that subclasses CspService, calls header() directly (tests, custom middleware, health checks, or header assertions), or wraps the disable command is exposed. This is a semver-minor change carrying a latent breaking change — verify before bumping.Key questions
CspService, call header() directly, or assert on it in tests? If yes, this "no change for applications" release still requires a code review.TurnOffCsp) get invoked in any deploy script, runbook, or incident kill-switch procedure? Its internal call path just changed.Stack fit
Content-Security-Policy produce a last-writer-wins header that is hard to debug. Pick one owner.Migration path
header() call sites.Compatibility
"x.y.z") rather than ^x.y if we subclass or call package internals — the v1.2.0 signature change demonstrates that minor releases are not guaranteed behaviorally inert below the public API.report-uri vs report-to support still varies and affects our reporting pipeline choice.Sequencing
CspService::header() or the disable command (1 day).Maintenance
Support
Scaling
Failure modes
| Failure | Blast radius | Detection |
|---|---|---|
| Policy too strict (blocks inline script/style) | Broken UI for users; often missed by tests | Browser console, violation reports |
| Duplicate CSP header (edge + middleware) | Browsers apply intersection — most restrictive wins, causing unexplained blocks | Header diff in staging |
CspService::header() signature mismatch in extenders |
Fatal error on affected routes — loud, caught immediately | Staging smoke test |
| Disable command path broken post-refactor | Kill switch unavailable during incident — silent until needed | Explicit runbook exercise |
| Policy too permissive | No user-visible symptom; control provides false assurance | Manual policy review only |
The last two rows are the dangerous ones: they fail without a signal. Both are cheap to test for and expensive to discover in production.
Ramp-up
Recommendation: Adopt. v1.2.0 itself is a low-risk maintenance release and does not change the adoption decision, but it is a useful signal: the package is actively maintained (positive) and ships public-signature refactors as minor bumps (caution — pin exact versions if we touch internals). Proceed to the compatibility check in step 1 of sequencing before bumping; total incremental effort for this release is roughly one engineering day.
How can I help you explore Laravel packages today?