Yireo_CspInspector

PHP 8.1 - 8.4
Magento 2.4.7 | 2.4.8
CSP Yes
PHPStan 1
Magento PHPCS 7
Latest Release 1.0.6

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

Support

For getting support, create an Issue under the following project URL:

https://github.com/yireo/Yireo_CspInspector

Module Dependencies

The following dependencies are declared in the module its `etc/module.xml` file:

Magento_Csp Magento_Store
Composer details
Magento module name
Yireo_CspInspector
Composer name
yireo/magento2-csp-inspector
Composer version
1.0.6
Default branch
master
Requirements
ext-pcre: *
guzzlehttp/guzzle: ^6.0|^7.0
magento/framework: ^102.0|^103.0
magento/module-csp: ^100.0
magento/module-store: ^101.1
symfony/console: ^5.0 | ^6.0 | ^7.0
php: >=8.2 <8.6
Releases
1.0.6 23 October 2026
1.0.5 23 October 2026
1.0.4 23 October 2026
1.0.3 23 October 2026
1.0.2 23 October 2026
1.0.1 23 October 2026
Changelog

[1.0.6] - 01 June 2026

Fixed

  • Make commands Symfony 7 compliant

[1.0.5] - 22 October 2025

Fixed

  • Copy generic CI/CD files
  • Add CHANGELOG
  • Fix wrong import of Console InputArgument, should be Symfony clas
  • Remove int return type from Symfony commands for Symfony 5 compat
  • Properly check for URL

Last modified: October 17, 2026