Yireo CSP Inspector

yireo/magento2-csp-inspector

CLI tool that inspects and reports the Content-Security-Policy headers generated for a given Magento URL and policy, making CSP values easier to review than digging through the browser.

No errors foundPHPStan level 1Build passingTrusted vendorSemVer compliant

Supported Magento versions: 2.4.9

100 installs★ 4 starsLatest: v1.0.6Released 2026-06-01License: OSL-3.0

composer require yireo/magento2-csp-inspector

README

Reproduced from the package’s own README, under its own license, as of 2026-09-13. Links and images point back at the source repository.

CSP Inspector for Magento 2

Magento version PHP version License Latest Version

Simple CLI tool to inspect the current CSP headers of a specified Magento URL and report back the values - because it is too cumbersome to search for values in the browser.

Please note that this tool does NOT report issues with those CSP headers, it only inspects the currently generated HTTP headers. Use other tools like SanSec Watch or the M.Academy CSP Generator to fix your CSP headers.

Installation

composer require --dev yireo/magento2-csp-inspector
bin/magento module:enable Yireo_CspInspector

Usage

Report all policies and the mode of the homepage:

bin/magento csp:inspect

Report all policies and the mode of the cart-page:

bin/magento csp:inspect checkout/cart

Report all policy values for the policy script-src on the homepage:

bin/magento csp:inspect:policy script-src 

Current status

Static Tests Unit Tests Integration Tests Playwright DI Compilation

← All packages from yireo