diff options
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 126 |
1 files changed, 11 insertions, 115 deletions
| @@ -1,125 +1,21 @@ | |||
| 1 | <h1 align="center"> | 1 |  |
| 2 | <br> | 2 |  |
| 3 | <a href="https://snuffleupagus.readthedocs.io/"> | 3 |  |
| 4 | <img src="https://github.com/jvoisin/snuffleupagus/raw/master/doc/source/_static/sp.png" alt="Snuffleupagus' logo" width="200"></a> | ||
| 5 | <br> | ||
| 6 | Snuffleupagus | ||
| 7 | <br> | ||
| 8 | </h1> | ||
| 9 | |||
| 10 | <h4 align="center">Security module for php7 and php8 - Killing bugclasses and virtual-patching the rest!</h4> | ||
| 11 | 4 | ||
| 12 | <p align="center"> | 5 | <p align="center"> |
| 13 | <a href="https://github.com/jvoisin/snuffleupagus/actions?query=workflow%3A%22CI+for+linux+distributions%22"> | 6 | <img src="https://github.com/sektioneins/snuffleupagus/blob/master/doc/source/_static/sp.png" alt="Snuffleupagus logo" width="200"> |
| 14 | <img src="https://github.com/jvoisin/snuffleupagus/workflows/CI%20for%20linux%20distributions/badge.svg" | ||
| 15 | alt="github actions testing _all_ distributions" /> | ||
| 16 | </a> | ||
| 17 | <a href="https://github.com/jvoisin/snuffleupagus/actions?query=workflow%3A%22CI+for+php+versions%22"> | ||
| 18 | <img src="https://github.com/jvoisin/snuffleupagus/workflows/CI%20for%20php%20versions/badge.svg" | ||
| 19 | alt="github actions testing _all_ php versions" /> | ||
| 20 | </a> | ||
| 21 | <a href="https://scan.coverity.com/projects/jvoisin-snuffleupagus"> | ||
| 22 | <img src="https://scan.coverity.com/projects/13821/badge.svg?flat=1" | ||
| 23 | alt="Coverity"> | ||
| 24 | </a> | ||
| 25 | <a href="https://bestpractices.coreinfrastructure.org/projects/1267"> | ||
| 26 | <img src="https://bestpractices.coreinfrastructure.org/projects/1267/badge" | ||
| 27 | alt="CII Best Practises"> | ||
| 28 | </a> | ||
| 29 | <a href="http://snuffleupagus.readthedocs.io/?badge=latest"> | ||
| 30 | <img src="https://readthedocs.org/projects/snuffleupagus/badge/?version=latest" | ||
| 31 | alt="readthedocs.org"> | ||
| 32 | </a> | ||
| 33 | <a href="https://coveralls.io/github/jvoisin/snuffleupagus?branch=master"> | ||
| 34 | <img src="https://coveralls.io/repos/github/jvoisin/snuffleupagus/badge.svg?branch=master" | ||
| 35 | alt="coveralls"> | ||
| 36 | </a> | ||
| 37 | <a href="https://twitter.com/sp_php"> | ||
| 38 | <img src="https://img.shields.io/badge/twitter-follow-blue.svg" | ||
| 39 | alt="twitter"> | ||
| 40 | </a> | ||
| 41 | <a href="https://repology.org/project/php:snuffleupagus/versions"> | ||
| 42 | <img src="https://repology.org/badge/tiny-repos/php:snuffleupagus.svg" | ||
| 43 | alt="Packaging status"> | ||
| 44 | </a> | ||
| 45 | </p> | ||
| 46 | 7 | ||
| 47 | <p align="center"> | 8 | # Snuffleupagus fork with Suhosin-NG patches |
| 48 | <a href="#key-features">Key Features</a> • | 9 | |
| 49 | <a href="#download">Download</a> • | ||
| 50 | <a href="#examples">Examples</a> • | ||
| 51 | <a href="https://snuffleupagus.readthedocs.io/">Documentation</a> • | ||
| 52 | <a href="https://github.com/jvoisin/snuffleupagus/blob/master/LICENSE">License</a> • | ||
| 53 | <a href="#thanks">Thanks</a> | ||
| 54 | </p> | 10 | </p> |
| 55 | 11 | ||
| 56 | Snuffleupagus is a [PHP 7+ and 8+](https://secure.php.net/) module designed to | ||
| 57 | drastically raise the cost of attacks against websites, by killing entire bug | ||
| 58 | classes. It also provides a powerful virtual-patching system, allowing | ||
| 59 | administrator to fix specific vulnerabilities and audit suspicious behaviours | ||
| 60 | without having to touch the PHP code. | ||
| 61 | |||
| 62 | ## Key Features | ||
| 63 | |||
| 64 | * No [noticeable performance impact](https://dustri.org/b/snuffleupagus-030-dentalium-elephantinum.html) | ||
| 65 | * Powerful yet simple to write virtual-patching rules | ||
| 66 | * Killing several classes of vulnerabilities | ||
| 67 | * [Unserialize-based](https://www.owasp.org/images/9/9e/Utilizing-Code-Reuse-Or-Return-Oriented-Programming-In-PHP-Application-Exploits.pdf) code execution | ||
| 68 | * [`mail`-based]( https://blog.ripstech.com/2016/roundcube-command-execution-via-email/ ) code execution | ||
| 69 | * Cookie-stealing [XSS]( https://en.wikipedia.org/wiki/Cross-site_scripting ) | ||
| 70 | * File-upload based code execution | ||
| 71 | * Weak PRNG | ||
| 72 | * [XXE]( https://en.wikipedia.org/wiki/XML_external_entity_attack ) | ||
| 73 | * Several hardening features | ||
| 74 | * Automatic `secure` and `samesite` flag for cookies | ||
| 75 | * Bundled set of rules to detect post-compromissions behaviours | ||
| 76 | * Global [strict mode]( https://secure.php.net/manual/en/migration70.new-features.php#migration70.new-features.scalar-type-declarations) and type-juggling prevention | ||
| 77 | * Whitelisting of [stream wrappers](https://secure.php.net/manual/en/intro.stream.php) | ||
| 78 | * Preventing writeable files execution | ||
| 79 | * Whitelist/blacklist for `eval` | ||
| 80 | * Enforcing TLS certificate validation when using [curl](https://secure.php.net/manual/en/book.curl.php) | ||
| 81 | * Request dumping capability | ||
| 82 | * A relatively sane code base: | ||
| 83 | * A [comprehensive](https://coveralls.io/github/jvoisin/snuffleupagus?branch=master) test suite close to 100% coverage | ||
| 84 | * Every commit is tested on [several distributions](https://gitlab.com/jvoisin/snuffleupagus/pipelines) | ||
| 85 | * An `clang-format`-enforced code style | ||
| 86 | * A [comprehensive documentation](https://snuffleupagus.rtfd.io) | ||
| 87 | * Usage of [coverity](https://scan.coverity.com/projects/jvoisin-snuffleupagus) | ||
| 88 | |||
| 89 | ## Download | ||
| 90 | |||
| 91 | We've got a [download | ||
| 92 | page](https://snuffleupagus.readthedocs.io/download.html), where you can find | ||
| 93 | packages for your distribution, but you can of course just `git clone` this | ||
| 94 | repo, or check the releases on [github](https://github.com/jvoisin/snuffleupagus/releases). | ||
| 95 | |||
| 96 | ## Examples | ||
| 97 | |||
| 98 | We're providing [various example rules](https://github.com/jvoisin/snuffleupagus/tree/master/config), | ||
| 99 | that are looking like this: | ||
| 100 | |||
| 101 | ```python | ||
| 102 | # Harden the `chmod` function | ||
| 103 | sp.disable_function.function("chmod").param("mode").value_r("^[0-9]{2}[67]$").drop(); | ||
| 104 | |||
| 105 | # Mitigate command injection in `system` | ||
| 106 | sp.disable_function.function("system").param("command").value_r("[$|;&`\\n]").drop(); | ||
| 107 | ``` | ||
| 108 | |||
| 109 | Upon violation of a rule, you should see lines like this in your logs: | ||
| 110 | 12 | ||
| 111 | ```python | 13 | ## About Snuffleupagus |
| 112 | [snuffleupagus][0.0.0.0][disabled_function][drop] The execution has been aborted in /var/www/index.php:2, because the return value (0) of the function 'strpos' matched a rule. | ||
| 113 | ``` | ||
| 114 | 14 | ||
| 115 | ## Documentation | 15 | Snuffleupagus is a marvellous security module for PHP 7 and PHP 8. This repository is a fork of the [original Snuffleupagus repository](https://github.com/jvoisin/snuffleupagus) used for **development and testing** of **new and experimental features**. It can be seen as the **beta version** of the Snuffleupagus PHP extension, showcasing new ideas, with the aim to eventually be ported back upstream to the original repository. |
| 116 | 16 | ||
| 117 | We've got a [comprehensive website](https://snuffleupagus.readthedocs.io/) with | 17 | ## About Suhosin-NG |
| 118 | all the documentation that you could possibly wish for. You can of course | ||
| 119 | [build it yourself](https://github.com/jvoisin/snuffleupagus/tree/master/doc). | ||
| 120 | 18 | ||
| 121 | ## Thanks | 19 |  |
| 122 | 20 | ||
| 123 | Many thanks to the [Suhosin project](https://suhosin.org) for being a __huge__ | 21 | The [Suhosin-NG project](https://github.com/sektioneins/suhosin-ng) is an effort to advance PHP hardening by providing patches to Snuffleupagus, documentation and its own [set of tools](https://github.com/sektioneins/sng-tools). |
| 124 | source of inspiration, and to all [our | ||
| 125 | contributors](https://github.com/jvoisin/snuffleupagus/graphs/contributors). | ||
