Skip to content
This repository was archived by the owner on Apr 7, 2021. It is now read-only.

Commit d2967ac

Browse files
committed
initial commit
0 parents  commit d2967ac

File tree

204 files changed

+38526
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

204 files changed

+38526
-0
lines changed

.codeclimate.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
languages:
2+
Ruby: false
3+
JavaScript: false
4+
Python: false
5+
PHP: true
6+
exclude_paths:
7+
- tests/*
8+
- vendor/*
9+
- docs/*

.gitattributes

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Path-based git attributes
2+
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
3+
4+
# Ignore all test and documentation with "export-ignore".
5+
/.gitattributes export-ignore
6+
/.gitignore export-ignore
7+
/.travis.yml export-ignore
8+
/phpunit.xml.dist export-ignore
9+
/.scrutinizer.yml export-ignore
10+
/tests export-ignore

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
build
2+
composer.phar
3+
composer.lock
4+
vendor
5+
test.php

.styleci.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
preset: psr2
2+
3+
risky: false
4+
5+
finder:
6+
exclude:
7+
- "build"
8+
- "docs"
9+
- "tests"

.travis.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
language: php
2+
3+
php:
4+
- 7.2
5+
- 7.1
6+
- 7.0
7+
8+
before_script:
9+
- pecl install uopz
10+
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
11+
- chmod +x ./cc-test-reporter
12+
- ./cc-test-reporter before-build
13+
- composer self-update
14+
- composer install --prefer-source --no-interaction
15+
16+
script:
17+
- vendor/bin/phpunit --coverage-clover build/logs/clover.xml
18+
19+
after_script:
20+
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
21+
22+
after_success:
23+
- vendor/bin/test-reporter

CONTRIBUTING.md

+92
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Contributing
2+
3+
When contributing to this repository, please first discuss the change you wish to make via issue,
4+
email, or any other method with the owners of this repository before making a change.
5+
6+
Please note we have a code of conduct, please follow it in all your interactions with the project.
7+
8+
## Pull Request Process
9+
10+
1. Ensure any install or build dependencies are removed before the end of the layer when doing a
11+
build.
12+
2. Update the README.md with details of changes to the interface, this includes new environment
13+
variables, exposed ports, useful file locations and container parameters.
14+
3. Increase the version numbers in any examples files and the README.md to the new version that this
15+
Pull Request would represent. The versioning scheme we use is [SemVer](http://semver.org/).
16+
4. You may merge the Pull Request in once you have the sign-off of two other developers, or if you
17+
do not have permission to do that, you may request the second reviewer to merge it for you.
18+
19+
## Code of Conduct
20+
21+
### Our Pledge
22+
23+
In the interest of fostering an open and welcoming environment, we as
24+
contributors and maintainers pledge to making participation in our project and
25+
our community a harassment-free experience for everyone, regardless of age, body
26+
size, disability, ethnicity, gender identity and expression, level of experience,
27+
nationality, personal appearance, race, religion, or sexual identity and
28+
orientation.
29+
30+
### Our Standards
31+
32+
Examples of behavior that contributes to creating a positive environment
33+
include:
34+
35+
* Using welcoming and inclusive language
36+
* Being respectful of differing viewpoints and experiences
37+
* Gracefully accepting constructive criticism
38+
* Focusing on what is best for the community
39+
* Showing empathy towards other community members
40+
41+
Examples of unacceptable behavior by participants include:
42+
43+
* The use of sexualized language or imagery and unwelcome sexual attention or
44+
advances
45+
* Trolling, insulting/derogatory comments, and personal or political attacks
46+
* Public or private harassment
47+
* Publishing others' private information, such as a physical or electronic
48+
address, without explicit permission
49+
* Other conduct which could reasonably be considered inappropriate in a
50+
professional setting
51+
52+
### Our Responsibilities
53+
54+
Project maintainers are responsible for clarifying the standards of acceptable
55+
behavior and are expected to take appropriate and fair corrective action in
56+
response to any instances of unacceptable behavior.
57+
58+
Project maintainers have the right and responsibility to remove, edit, or
59+
reject comments, commits, code, wiki edits, issues, and other contributions
60+
that are not aligned to this Code of Conduct, or to ban temporarily or
61+
permanently any contributor for other behaviors that they deem inappropriate,
62+
threatening, offensive, or harmful.
63+
64+
### Scope
65+
66+
This Code of Conduct applies both within project spaces and in public spaces
67+
when an individual is representing the project or its community. Examples of
68+
representing a project or community include using an official project e-mail
69+
address, posting via an official social media account, or acting as an appointed
70+
representative at an online or offline event. Representation of a project may be
71+
further defined and clarified by project maintainers.
72+
73+
### Enforcement
74+
75+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
76+
reported by contacting the project team at [INSERT EMAIL ADDRESS]. All
77+
complaints will be reviewed and investigated and will result in a response that
78+
is deemed necessary and appropriate to the circumstances. The project team is
79+
obligated to maintain confidentiality with regard to the reporter of an incident.
80+
Further details of specific enforcement policies may be posted separately.
81+
82+
Project maintainers who do not follow or enforce the Code of Conduct in good
83+
faith may face temporary or permanent repercussions as determined by other
84+
members of the project's leadership.
85+
86+
### Attribution
87+
88+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
89+
available at [http://contributor-covenant.org/version/1/4][version]
90+
91+
[homepage]: http://contributor-covenant.org
92+
[version]: http://contributor-covenant.org/version/1/4/

LICENSE.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# The MIT License (MIT)
2+
3+
Copyright (c) 2016 Infusionsoft
4+
5+
> Permission is hereby granted, free of charge, to any person obtaining a copy
6+
> of this software and associated documentation files (the "Software"), to deal
7+
> in the Software without restriction, including without limitation the rights
8+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
> copies of the Software, and to permit persons to whom the Software is
10+
> furnished to do so, subject to the following conditions:
11+
>
12+
> The above copyright notice and this permission notice shall be included in
13+
> all copies or substantial portions of the Software.
14+
>
15+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
> THE SOFTWARE.

README.md

+107
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# PHP 7+ `security.txt` Package
2+
3+
![php-security-txt banner from the documentation](docs/img/banner-1544x500.png?raw=true)
4+
5+
[![Current Release](https://img.shields.io/github/release/austinheap/php-security-txt.svg)](https://github.com/austinheap/php-security-txt/releases)
6+
[![Total Downloads](https://img.shields.io/packagist/dt/austinheap/php-security-txt.svg)](https://packagist.org/packages/austinheap/php-security-txt)
7+
[![Build Status](https://travis-ci.org/austinheap/php-security-txt.svg?branch=master)](https://travis-ci.org/austinheap/php-security-txt)
8+
[![Dependency Status](https://gemnasium.com/badges/github.com/austinheap/php-security-txt.svg)](https://gemnasium.com/github.com/austinheap/php-security-txt)
9+
[![Scrutinizer CI](https://scrutinizer-ci.com/g/austinheap/php-security-txt/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/austinheap/php-security-txt/)
10+
[![StyleCI](https://styleci.io/repos/108443771/shield?branch=master)](https://styleci.io/repos/108443771)
11+
[![Maintainability](https://api.codeclimate.com/v1/badges/9bf8799e6e3a0209c318/maintainability)](https://codeclimate.com/github/austinheap/php-security-txt/maintainability)
12+
[![Test Coverage](https://api.codeclimate.com/v1/badges/9bf8799e6e3a0209c318/test_coverage)](https://codeclimate.com/github/austinheap/php-security-txt/test_coverage)
13+
[![SensioLabs](https://insight.sensiolabs.com/projects/1edfb22e-593b-43b1-88cd-98965541a2cc/mini.png)](https://insight.sensiolabs.com/projects/1edfb22e-593b-43b1-88cd-98965541a2cc)
14+
15+
## A package for manipulating `security.txt` documents in PHP 7+, based on configuration settings.
16+
17+
The purpose of this project is to create a set-it-and-forget-it package that can
18+
manipulate documents following the current [`security.txt`](https://securitytxt.org/)
19+
spec. It is therefore highly opinionated but built for configuration.
20+
21+
[`security.txt`](https://github.com/securitytxt) is a [draft](https://tools.ietf.org/html/draft-foudil-securitytxt-00)
22+
"standard" which allows websites to define security policies. This "standard"
23+
sets clear guidelines for security researchers on how to report security issues,
24+
and allows bug bounty programs to define a scope. Security.txt is the equivalent
25+
of `robots.txt`, but for security issues.
26+
27+
There is [documentation for `php-security-txt` online](https://austinheap.github.io/php-security-txt/),
28+
the source of which is in the [`docs/`](https://github.com/austinheap/php-security-txt/tree/master/docs)
29+
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).
30+
31+
## Installation
32+
33+
### Step 1: Composer
34+
35+
Via Composer command line:
36+
37+
```bash
38+
$ composer require austinheap/php-security-txt
39+
```
40+
41+
Or add the package to your `composer.json`:
42+
43+
```json
44+
{
45+
"require": {
46+
"austinheap/php-security-txt": "0.3.*"
47+
}
48+
}
49+
```
50+
51+
### Step 2: Manipulate a `security.txt` document
52+
53+
To programatically create a `security.txt` document, you could do:
54+
55+
```php
56+
require_once 'vendor/autoload.php';
57+
58+
$writer = new \AustinHeap\Security\Txt\Writer;
59+
60+
print $writer->setContact('me@austinheap.com')
61+
->setEncryption('http://some.url/pgp.key')
62+
->setDisclosure('full')
63+
->setAcknowledgement('http://some.url/acks')
64+
->getText();
65+
```
66+
67+
Which should output:
68+
69+
```
70+
# Our security address
71+
Contact: me@austinheap.com
72+
73+
# Our PGP key
74+
Encryption: http://some.url/pgp.key
75+
76+
# Our disclosure policy
77+
Disclosure: Full
78+
79+
# Our public acknowledgement
80+
Acknowledgement: http://some.url/acks
81+
82+
#
83+
# Generated by "php-security-txt" v0.3.2 (https://github.com/austinheap/php-security-txt/releases/tag/v0.3.2)
84+
# in 0.041008 seconds on 2017-10-26 20:31:25.
85+
#
86+
```
87+
88+
## References
89+
90+
- [A Method for Web Security Policies (draft-foudil-securitytxt-00)](https://tools.ietf.org/html/draft-foudil-securitytxt-00)
91+
- [laravel-security-txt](https://github.com/austinheap/laravel-security-txt)
92+
93+
## Credits
94+
95+
This is a fork of [austinheap/laravel-security-txt](https://github.com/austinheap/laravel-security-txt),
96+
which was a fork of [InfusionWeb/laravel-robots-route](https://github.com/InfusionWeb/laravel-robots-route),
97+
which was a fork of [ellisthedev/laravel-5-robots](https://github.com/ellisthedev/laravel-5-robots),
98+
which was a fork of [jayhealey/Robots](https://github.com/jayhealey/Robots),
99+
which was based on earlier work.
100+
101+
- [ellisio/laravel-5-robots Contributors](https://github.com/ellisio/laravel-5-robots/graphs/contributors)
102+
- [InfusionWeb/laravel-robots-route Contributors](https://github.com/InfusionWeb/laravel-robots-route/contributors)
103+
- [austinheap/laravel-security-txt Contributors](https://github.com/austinheap/laravel-security-txt/graphs/contributors)
104+
105+
## License
106+
107+
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

composer.json

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name": "austinheap/php-security-txt",
3+
"description": "A package for manipulating `security.txt` documents in PHP 7+, based on configuration settings.",
4+
"keywords": [
5+
"security.txt",
6+
"security",
7+
"route"
8+
],
9+
"homepage": "https://github.com/austinheap/php-security-txt",
10+
"license": "MIT",
11+
"authors": [
12+
{
13+
"name": "Austin Heap",
14+
"email": "me@austinheap.com",
15+
"homepage": "https://github.com/austinheap",
16+
"role": "Developer"
17+
}
18+
],
19+
"require": {
20+
"php": ">=7.0.0"
21+
},
22+
"require-dev": {
23+
"codeclimate/php-test-reporter": "dev-master",
24+
"phpunit/phpunit": "~6.0"
25+
},
26+
"autoload": {
27+
"psr-4": {
28+
"AustinHeap\\Security\\Txt\\": "src"
29+
}
30+
},
31+
"minimum-stability": "stable"
32+
}

docs/checkstyle.xml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0"?>
2+
<checkstyle version="1.3.0">
3+
<file name="Directives/Encryption.php"/>
4+
<file name="Writer.php"/>
5+
<file name="Directives/Acknowledgement.php"/>
6+
<file name="SecurityTxt.php"/>
7+
<file name="Directives/Disclosure.php"/>
8+
<file name="Directives/Contact.php"/>
9+
<file name="Reader.php"/>
10+
<file name="SecurityTxtInterface.php">
11+
<error line="23" severity="error" message="Argument $test_case is missing from the Docblock of execute" source="phpDocumentor.file.PPC:ERR-50015"/>
12+
<error line="23" severity="error" message="No summary for method execute()" source="phpDocumentor.file.PPC:ERR-50008"/>
13+
<error line="24" severity="error" message="Argument $test_case is missing from the Docblock of reset" source="phpDocumentor.file.PPC:ERR-50015"/>
14+
<error line="24" severity="error" message="No summary for method reset()" source="phpDocumentor.file.PPC:ERR-50008"/>
15+
</file>
16+
</checkstyle>

0 commit comments

Comments
 (0)