From a009d587372026813566c8e122844d87d0373ebc Mon Sep 17 00:00:00 2001 From: DariusIII Date: Mon, 21 Oct 2024 15:09:04 +0200 Subject: [PATCH] Remove csp package --- .env.example | 2 -- bootstrap/app.php | 1 - composer.json | 1 - composer.lock | 84 +---------------------------------------------- config/csp.php | 34 ------------------- 5 files changed, 1 insertion(+), 121 deletions(-) delete mode 100644 config/csp.php diff --git a/.env.example b/.env.example index ea2eef357..ec64fff47 100644 --- a/.env.example +++ b/.env.example @@ -184,5 +184,3 @@ PURGE_INACTIVE_USERS=false OTP_ENABLED=false FLARE_KEY= - -CSP_ENABLED=false # Content Security Policy diff --git a/bootstrap/app.php b/bootstrap/app.php index 8ffa85a5c..bce85c024 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -39,7 +39,6 @@ return Application::configure(basePath: dirname(__DIR__)) $middleware->web([ \Illuminate\Session\Middleware\AuthenticateSession::class, - \Spatie\Csp\AddCspHeaders::class, ]); $middleware->throttleApi('60,1'); diff --git a/composer.json b/composer.json index 55098ac23..9007e6700 100644 --- a/composer.json +++ b/composer.json @@ -99,7 +99,6 @@ "sentry/sentry-laravel": "^4.9", "smarty/smarty": "^4.3", "spatie/async": "^1.6", - "spatie/laravel-csp": "^2.10", "spatie/laravel-directory-cleanup": "^1.10", "spatie/laravel-fractal": "^6.2", "spatie/laravel-ignition": "^2.8", diff --git a/composer.lock b/composer.lock index 2388c0efd..70fbb8c71 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "d7e5cc0b1eccdea5a9ee63f2e045cccf", + "content-hash": "d4ae72aa568571454bad1aa5d5a37a96", "packages": [ { "name": "aharen/omdbapi", @@ -9685,88 +9685,6 @@ }, "time": "2024-05-16T08:48:33+00:00" }, - { - "name": "spatie/laravel-csp", - "version": "2.10.1", - "source": { - "type": "git", - "url": "https://github.com/spatie/laravel-csp.git", - "reference": "ea7d2859a2617954df869e816b0f740400184ae0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-csp/zipball/ea7d2859a2617954df869e816b0f740400184ae0", - "reference": "ea7d2859a2617954df869e816b0f740400184ae0", - "shasum": "" - }, - "require": { - "illuminate/http": "^9.0|^10.0|^11.0", - "illuminate/support": "^9.0|^10.0|^11.0", - "php": "^8.1", - "spatie/laravel-package-tools": "^1.11" - }, - "require-dev": { - "mockery/mockery": "^1.3.3", - "orchestra/testbench": "^7.0|^8.0|^9.0", - "pestphp/pest": "^1.23.0|^2.34.0", - "roave/security-advisories": "dev-master" - }, - "type": "library", - "extra": { - "laravel": { - "providers": [ - "Spatie\\Csp\\CspServiceProvider" - ] - } - }, - "autoload": { - "files": [ - "src/helpers.php" - ], - "psr-4": { - "Spatie\\Csp\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Thomas Verhelst", - "email": "tvke91@gmail.com", - "homepage": "https://spatie.be", - "role": "Developer" - }, - { - "name": "Freek Van der Herten", - "email": "freek@spatie.be", - "homepage": "https://spatie.be", - "role": "Developer" - } - ], - "description": "Add CSP headers to the responses of a Laravel app", - "homepage": "https://github.com/spatie/laravel-csp", - "keywords": [ - "content-security-policy", - "csp", - "headers", - "laravel", - "laravel-csp", - "security", - "spatie" - ], - "support": { - "source": "https://github.com/spatie/laravel-csp/tree/2.10.1" - }, - "funding": [ - { - "url": "https://spatie.be/open-source/support-us", - "type": "custom" - } - ], - "time": "2024-09-20T13:39:37+00:00" - }, { "name": "spatie/laravel-directory-cleanup", "version": "1.10.0", diff --git a/config/csp.php b/config/csp.php deleted file mode 100644 index dd589a269..000000000 --- a/config/csp.php +++ /dev/null @@ -1,34 +0,0 @@ - Spatie\Csp\Policies\Basic::class, - - /* - * This policy which will be put in report only mode. This is great for testing out - * a new policy or changes to existing csp policy without breaking anything. - */ - 'report_only_policy' => '', - - /* - * All violations against the policy will be reported to this url. - * A great service you could use for this is https://report-uri.com/ - * - * You can override this setting by calling `reportTo` on your policy. - */ - 'report_uri' => env('CSP_REPORT_URI', ''), - - /* - * Headers will only be added if this setting is set to true. - */ - 'enabled' => env('CSP_ENABLED', true), - - /* - * The class responsible for generating the nonces used in inline tags and headers. - */ - 'nonce_generator' => Spatie\Csp\Nonce\RandomString::class, -];