2017 © Pedro Peláez
 

library laravel4-header-csp

Provides support for enforcing Content Security Policy with headers in Laravel 4 responses.

image

paramonovav/laravel4-header-csp

Provides support for enforcing Content Security Policy with headers in Laravel 4 responses.

  • Thursday, December 24, 2015
  • by paramonovav
  • Repository
  • 1 Watchers
  • 3 Stars
  • 21 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Response header Content Security Policy for Laravel 4

Latest Stable Version Total Downloads Latest Unstable Version License, (*1)

Provides support for enforcing Content Security Policy and XSS Protection with headers in Laravel 4 responses., (*2)

Note: Based on Content Security Policy, Improving Web Security with the Content Security Policy, HTTP headers., (*3)

Key Features

  1. Add rules for Content Security Policy (content-security-policy, x-content-security-policy, x-webkit-csp)
  2. Save reports of policy failures to storage/logs/content-security-policy-report folder if needed
  3. Add additional header like: x-xss-protection, x-frame-options, x-content-type-options

Installation

Require this package with composer:, (*4)

composer require paramonovav/laravel4-header-csp

After updating composer, add the ServiceProvider to the providers array in app/config/app.php, (*5)

'Paramonovav\Laravel4HeaderCsp\Laravel4HeaderCspServiceProvider',

You need to publish the config from this package., (*6)

php artisan config:publish paramonovav/laravel4-header-csp

Usage

Apply content security policy to routes

The following will apply all default profiles to the login route., (*7)

Route::get('login', array('after'=>'response.secure'), function()
{
    return 'Hello, on login page !';
}));

The following will apply all default profiles and a specific google profile to the login route., (*8)

Route::get('login', array('after'=>'response.secure:google'), function()
{
    return 'Hello, on login page !';
}));

You can include any number of specific profiles. The following will apply default, google, flickr, and my_custom profiles to the login route., (*9)

Route::get('login', array('after'=>'response.secure:google-flickr-my_custom'), function()
{
    return 'Hello, on login page !';
}));

The Versions

24/12 2015

dev-master

9999999-dev https://github.com/paramonovav/laravel4-header-csp

Provides support for enforcing Content Security Policy with headers in Laravel 4 responses.

  Sources   Download

MIT

The Requires

 

laravel laravel 4 response csp header content security policy xss protection

07/08 2015

1.0.0

1.0.0.0 https://github.com/paramonovav/laravel4-header-csp

Provides support for enforcing Content Security Policy with headers in Laravel 4 responses.

  Sources   Download

MIT

The Requires

 

laravel laravel 4 response csp header content security policy xss protection