Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/BePsvPT/secure-headers
PHP Secure Headers
https://github.com/BePsvPT/secure-headers
clear-site-data content-security-policy csp expect-ct feature-policy hsts laravel laravel-package php referrer-policy secure-headers
Last synced: 3 months ago
JSON representation
PHP Secure Headers
- Host: GitHub
- URL: https://github.com/BePsvPT/secure-headers
- Owner: bepsvpt
- License: mit
- Created: 2015-12-01T08:28:40.000Z (about 9 years ago)
- Default Branch: main
- Last Pushed: 2024-03-28T09:10:05.000Z (10 months ago)
- Last Synced: 2024-05-23T05:35:02.953Z (8 months ago)
- Topics: clear-site-data, content-security-policy, csp, expect-ct, feature-policy, hsts, laravel, laravel-package, php, referrer-policy, secure-headers
- Language: PHP
- Homepage:
- Size: 547 KB
- Stars: 491
- Watchers: 19
- Forks: 45
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-php - Secure Headers - A package that adds security related headers to HTTP response. (Table of Contents / Security)
- awesome-laravel - Secure Headers - Add security related headers to HTTP response (Popular Packages)
README
# Secure Headers
[![Financial Contributors on Open Collective](https://opencollective.com/secure-headers/all/badge.svg?label=financial+contributors)](https://opencollective.com/secure-headers)
[![Actions Status](https://github.com/bepsvpt/secure-headers/workflows/Laravel/badge.svg)](https://github.com/bepsvpt/secure-headers/actions)
[![Latest Stable Version](https://poser.pugx.org/bepsvpt/secure-headers/v/stable)](https://packagist.org/packages/bepsvpt/secure-headers)
[![Total Downloads](https://poser.pugx.org/bepsvpt/secure-headers/downloads)](https://packagist.org/packages/bepsvpt/secure-headers)
[![License](https://poser.pugx.org/bepsvpt/secure-headers/license)](https://packagist.org/packages/bepsvpt/secure-headers)Add security related headers to HTTP response. The package includes Service Providers for easy [Laravel](https://laravel.com) integration.
- [Version](#version)
- [Installation](#installation)
- [Usage(non laravel project)](#usagenon-laravel-project)
- [Document and Notice](#document-and-notice)
- [Changelog](#changelog)
- [Upgrade](#upgrade)
- [License](#license)## Version
8.0.0
### Supported Laravel Version
5.1 ~ 11.x
## Installation
### Non Laravel Project
Install using composer
```sh
composer require bepsvpt/secure-headers
```Copy config file to your project directory
```sh
cp vendor/bepsvpt/secure-headers/config/secure-headers.php path/to/your/project/directory
```Set up config file
Done!
### Laravel Project
Install using composer
```sh
composer require bepsvpt/secure-headers
```Add service provider in `config/app.php` ( laravel version < 5.5 )
```php
Bepsvpt\SecureHeaders\SecureHeadersServiceProvider::class,
```Publish config file
```sh
php artisan vendor:publish --provider="Bepsvpt\SecureHeaders\SecureHeadersServiceProvider"
```Add global middleware in `app/Http/Kernel.php`
```php
\Bepsvpt\SecureHeaders\SecureHeadersMiddleware::class,
```Set up config file `config/secure-headers.php`
Done!
### Lumen Project
Install using composer
```sh
composer require bepsvpt/secure-headers
```Add service provider in `bootstrap/app.php`
```php
$app->register(Bepsvpt\SecureHeaders\SecureHeadersServiceProvider::class);
```Copy config file to project directory
```sh
mkdir config
cp vendor/bepsvpt/secure-headers/config/secure-headers.php config/secure-headers.php
```Add global middleware in `bootstrap/app.php`
```php
$app->middleware([
\Bepsvpt\SecureHeaders\SecureHeadersMiddleware::class,
]);
```Set up config file `config/secure-headers.php`
Done!
## Usage(Non Laravel Project)
**Do not forget to import namespace.**
```php
headers();// Send headers to HTTP response
$secureHeaders->send();
```## Document and Notice
Please see [DOCS](DOCS.md) for details.
## Changelog
Please see [CHANGELOG](CHANGELOG.md) for details.
## Upgrade
Please see [UPGRADE](UPGRADE.md) for details.
## License
Secure Headers is licensed under [The MIT License (MIT)](LICENSE).