2017 © Pedro Peláez
 

library php-security-txt

A package for manipulating `security.txt` documents in PHP 7+, based on configuration settings.

image

austinheap/php-security-txt

A package for manipulating `security.txt` documents in PHP 7+, based on configuration settings.

  • Friday, January 26, 2018
  • by austinheap
  • Repository
  • 1 Watchers
  • 6 Stars
  • 163 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

PHP 7+ security.txt Package

php-security-txt banner from the documentation, (*1)

License Current Release Total Downloads Build Status Dependency Status Scrutinizer CI StyleCI Maintainability Test Coverage SensioLabs, (*2)

A package for manipulating security.txt documents in PHP 7+, based on configuration settings.

The purpose of this project is to create a set-it-and-forget-it package that can manipulate documents following the current security.txt spec. It is therefore highly opinionated but built for configuration., (*3)

security.txt is a draft "standard" which allows websites to define security policies. This "standard" sets clear guidelines for security researchers on how to report security issues, and allows bug bounty programs to define a scope. Security.txt is the equivalent of robots.txt, but for security issues., (*4)

There is documentation for php-security-txt online, the source of which is in the docs/ directory. The most logical place to start are the docs for the SecurityTxt class., (*5)

Table of Contents

Installation

Step 1: Composer

Via Composer command line:, (*6)

$ composer require austinheap/php-security-txt

Or add the package to your composer.json:, (*7)

{
    "require": {
        "austinheap/php-security-txt": "0.3.*"
    }
}

Step 2: Manipulate a security.txt document

To programatically create a security.txt document, you could do:, (*8)

require_once 'vendor/autoload.php';

$writer = new \AustinHeap\Security\Txt\Writer;

print $writer->setContact('me@austinheap.com')
             ->setEncryption('http://some.url/pgp.key')
             ->setDisclosure('full')
             ->setAcknowledgement('http://some.url/acks')
             ->getText();

Which should output:, (*9)

# Our security address
Contact: me@austinheap.com

# Our PGP key
Encryption: http://some.url/pgp.key

# Our disclosure policy
Disclosure: Full

# Our public acknowledgement
Acknowledgement: http://some.url/acks

#
# Generated by "php-security-txt" v0.3.2 (https://github.com/austinheap/php-security-txt/releases/tag/v0.3.2)
# in 0.041008 seconds on 2017-10-26 20:31:25.
#

Unit Tests

This package has aggressive unit tests built with PHPUnit., (*10)

There are code coverage reports for php-security-txt available online., (*11)

References

Credits

This is a fork of austinheap/laravel-security-txt, which was a fork of InfusionWeb/laravel-robots-route, which was a fork of ellisthedev/laravel-5-robots, which was a fork of jayhealey/Robots, which was based on earlier work., (*12)

License

The MIT License (MIT). Please see License File for more information., (*13)

The Versions

26/01 2018

dev-master

9999999-dev https://github.com/austinheap/php-security-txt

A package for manipulating `security.txt` documents in PHP 7+, based on configuration settings.

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

The Development Requires

security route security.txt

22/11 2017

v0.4.0

0.4.0.0 https://github.com/austinheap/php-security-txt

A package for manipulating `security.txt` documents in PHP 7+, based on configuration settings.

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

The Development Requires

security route security.txt

26/10 2017

v0.3.0

0.3.0.0 https://github.com/austinheap/php-security-txt

A package for manipulating `security.txt` documents in PHP 7+, based on configuration settings.

  Sources   Download

MIT

The Requires

  • php >=7.0.0

 

The Development Requires

security route security.txt