PHPackages                             austinheap/php-security-txt - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. austinheap/php-security-txt

AbandonedArchivedLibrary[Security](/categories/security)

austinheap/php-security-txt
===========================

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

v0.4.0(8y ago)102111MITPHPPHP &gt;=7.0.0

Since Nov 22Pushed 8y ago1 watchersCompare

[ Source](https://github.com/austinheap/php-security-txt)[ Packagist](https://packagist.org/packages/austinheap/php-security-txt)[ Docs](https://github.com/austinheap/php-security-txt)[ RSS](/packages/austinheap-php-security-txt/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (1)

PHP 7+ `security.txt` Package
=============================

[](#php-7-securitytxt-package)

[![php-security-txt banner from the documentation](docs/img/banner-1544x500.png?raw=true)](docs/img/banner-1544x500.png?raw=true)

[![License](https://camo.githubusercontent.com/06568ee2702854af05dc94d27f1dc6a85e7654f2cbf6399d5607e6fec64bd9dc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f61757374696e686561702f7068702d73656375726974792d7478742e737667)](https://github.com/austinheap/php-security-txt/blob/master/LICENSE.md)[![Current Release](https://camo.githubusercontent.com/0ffe89f76166bcf8d9349ed2aa873f52ea5ee335f8b7f0a7b999214d9ba299e6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f61757374696e686561702f7068702d73656375726974792d7478742e737667)](https://github.com/austinheap/php-security-txt/releases)[![Total Downloads](https://camo.githubusercontent.com/37e13311b8147d2cb54d07b20f5289276063303d419e5a95f6abc3c329360ebf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f61757374696e686561702f7068702d73656375726974792d7478742e737667)](https://packagist.org/packages/austinheap/php-security-txt)[![Build Status](https://camo.githubusercontent.com/0f0f82c7488e0327f8ba1da848edad1b612d9b0403262bd5c224fb0af4235784/68747470733a2f2f7472617669732d63692e6f72672f61757374696e686561702f7068702d73656375726974792d7478742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/austinheap/php-security-txt)[![Dependency Status](https://camo.githubusercontent.com/18d008c89f337c03625df5c6861698f1cc9d2dd11d03a85fe5473bcaf6aeae72/68747470733a2f2f67656d6e617369756d2e636f6d2f6261646765732f6769746875622e636f6d2f61757374696e686561702f7068702d73656375726974792d7478742e737667)](https://gemnasium.com/github.com/austinheap/php-security-txt)[![Scrutinizer CI](https://camo.githubusercontent.com/cd6bb4344489abb257a9e232be18eea8d4541aff7ea4df9c82109eab419d7cd6/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f61757374696e686561702f7068702d73656375726974792d7478742f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/austinheap/php-security-txt/)[![StyleCI](https://camo.githubusercontent.com/907f634b53490226ce382a259e6268ed7d2514e717ad98eb84d39174479e8be8/68747470733a2f2f7374796c6563692e696f2f7265706f732f3130383434333737312f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/108443771)[![Maintainability](https://camo.githubusercontent.com/fb14b70f57e54845a8fa70a7e4608fa29690a2d204aa502b8efd08319b6a2cdf/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f39626638373939653665336130323039633331382f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/austinheap/php-security-txt/maintainability)[![Test Coverage](https://camo.githubusercontent.com/baa0ef862082d7e7b375355cc96753d4041d96453ae0048e006b4e45897e1818/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f39626638373939653665336130323039633331382f746573745f636f766572616765)](https://codeclimate.com/github/austinheap/php-security-txt/test_coverage)[![SensioLabs](https://camo.githubusercontent.com/7b25bd1929a597f9f3ec2dfc0e9c0b40338a998e3cd1d6d1b729e04c6804cc6a/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f31656466623232652d353933622d343362312d383863642d3938393635353431613263632f6d696e692e706e67)](https://insight.sensiolabs.com/projects/1edfb22e-593b-43b1-88cd-98965541a2cc)

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

[](#a-package-for-manipulating-securitytxt-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`](https://securitytxt.org/)spec. It is therefore highly opinionated but built for configuration.

[`security.txt`](https://github.com/securitytxt) is a [draft](https://tools.ietf.org/html/draft-foudil-securitytxt-00)"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.

There is [documentation for `php-security-txt` online](https://austinheap.github.io/php-security-txt/), the source of which is in the [`docs/`](https://github.com/austinheap/php-security-txt/tree/master/docs)directory. The most logical place to start are the [docs for the `SecurityTxt` class](https://austinheap.github.io/php-security-txt/classes/AustinHeap.Security.Txt.SecurityTxt.html).

Table of Contents
-----------------

[](#table-of-contents)

- [Summary](#a-package-for-manipulating-securitytxt-documents-in-php-7-based-on-configuration-settings)
- [Installation](#installation)
    - [Step 1: Composer](#step-1-composer)
    - [Step 2: Manipulate a `security.txt` document](#step-2-manipulate-a-securitytxt-document)
- [Unit Tests](#unit-tests)
- [References](#references)
- [Credits](#credits)
- [License](#license)

Installation
------------

[](#installation)

### Step 1: Composer

[](#step-1-composer)

Via Composer command line:

```
$ composer require austinheap/php-security-txt
```

Or add the package to your `composer.json`:

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

### Step 2: Manipulate a `security.txt` document

[](#step-2-manipulate-a-securitytxt-document)

To programatically create a `security.txt` document, you could do:

```
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:

```
# 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
----------

[](#unit-tests)

This package has aggressive unit tests built with PHPUnit.

There are [code coverage reports for `php-security-txt`](https://austinheap.github.io/php-security-txt/coverage/)available online.

References
----------

[](#references)

- [A Method for Web Security Policies (draft-foudil-securitytxt-00)](https://tools.ietf.org/html/draft-foudil-securitytxt-00)
- [laravel-security-txt](https://github.com/austinheap/laravel-security-txt)
- [securitytext.org](https://securitytext.org/)

Credits
-------

[](#credits)

This is a fork of [austinheap/laravel-security-txt](https://github.com/austinheap/laravel-security-txt), which was a fork of [InfusionWeb/laravel-robots-route](https://github.com/InfusionWeb/laravel-robots-route), which was a fork of [ellisthedev/laravel-5-robots](https://github.com/ellisthedev/laravel-5-robots), which was a fork of [jayhealey/Robots](https://github.com/jayhealey/Robots), which was based on earlier work.

- [ellisio/laravel-5-robots Contributors](https://github.com/ellisio/laravel-5-robots/graphs/contributors)
- [InfusionWeb/laravel-robots-route Contributors](https://github.com/InfusionWeb/laravel-robots-route/contributors)
- [austinheap/laravel-security-txt Contributors](https://github.com/austinheap/laravel-security-txt/graphs/contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3136d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/80980?v=4)[Austin Heap](/maintainers/austinheap)[@austinheap](https://github.com/austinheap)

---

Top Contributors

[![austinheap](https://avatars.githubusercontent.com/u/80980?v=4)](https://github.com/austinheap "austinheap (11 commits)")

---

Tags

composercomposer-packagephpphp7php70php71php72securitysecurity-txtsecurityroutesecurity.txt

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/austinheap-php-security-txt/health.svg)

```
[![Health](https://phpackages.com/badges/austinheap-php-security-txt/health.svg)](https://phpackages.com/packages/austinheap-php-security-txt)
```

###  Alternatives

[phpseclib/phpseclib

PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.

5.6k455.2M1.5k](/packages/phpseclib-phpseclib)[defuse/php-encryption

Secure PHP Encryption Library

3.9k170.7M239](/packages/defuse-php-encryption)[mews/purifier

Laravel 5/6/7/8/9/10 HtmlPurifier Package

2.0k18.0M134](/packages/mews-purifier)[robrichards/xmlseclibs

A PHP library for XML Security

41582.2M138](/packages/robrichards-xmlseclibs)[voku/anti-xss

anti xss-library

70917.6M90](/packages/voku-anti-xss)[spatie/laravel-csp

Add CSP headers to the responses of a Laravel app

86110.6M23](/packages/spatie-laravel-csp)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
