diff options
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 136 |
1 files changed, 125 insertions, 11 deletions
| @@ -1,21 +1,135 @@ | |||
| 1 |  | 1 | <h1 align="center"> |
| 2 |  | 2 | <br> |
| 3 |  | 3 | <a href="https://snuffleupagus.readthedocs.io/"> |
| 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> | ||
| 4 | 11 | ||
| 5 | <p align="center"> | 12 | <p align="center"> |
| 6 | <img src="https://github.com/sektioneins/snuffleupagus/blob/master/doc/source/_static/sp.png" alt="Snuffleupagus logo" width="200"> | 13 | <a href="https://github.com/jvoisin/snuffleupagus/actions/workflows/distributions_php7.yml"> |
| 14 | <img src="https://github.com/jvoisin/snuffleupagus/actions/workflows/distributions_php7.yml/badge.svg" | ||
| 15 | alt="Testing PHP7 on various Linux distributions" /> | ||
| 16 | </a> | ||
| 17 | <a href="https://github.com/jvoisin/snuffleupagus/actions/workflows/distributions_php8.yml"> | ||
| 18 | <img src="https://github.com/jvoisin/snuffleupagus/actions/workflows/distributions_php8.yml/badge.svg" | ||
| 19 | alt="Testing PHP8 on various Linux distributions" /> | ||
| 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 | <a href="https://github.com/jvoisin/snuffleupagus"> | ||
| 46 | <img src="https://github.com/jvoisin/snuffleupagus/actions/workflows/codeql-analysis.yml/badge.svg" | ||
| 47 | alt="CodeQL"> | ||
| 48 | </a> | ||
| 49 | </p> | ||
| 7 | 50 | ||
| 8 | # Snuffleupagus fork with Suhosin-NG patches | 51 | <p align="center"> |
| 9 | 52 | <a href="#key-features">Key Features</a> • | |
| 53 | <a href="#download">Download</a> • | ||
| 54 | <a href="#examples">Examples</a> • | ||
| 55 | <a href="https://snuffleupagus.readthedocs.io/">Documentation</a> • | ||
| 56 | <a href="https://github.com/jvoisin/snuffleupagus/blob/master/LICENSE">License</a> • | ||
| 57 | <a href="#thanks">Thanks</a> | ||
| 10 | </p> | 58 | </p> |
| 11 | 59 | ||
| 60 | Snuffleupagus is a [PHP 7+ and 8+](https://secure.php.net/) module designed to | ||
| 61 | drastically raise the cost of attacks against websites, by killing entire bug | ||
| 62 | classes. It also provides a powerful virtual-patching system, allowing | ||
| 63 | administrator to fix specific vulnerabilities and audit suspicious behaviours | ||
| 64 | without having to touch the PHP code. | ||
| 65 | |||
| 66 | ## Key Features | ||
| 67 | |||
| 68 | * No [noticeable performance impact](https://dustri.org/b/snuffleupagus-030-dentalium-elephantinum.html) | ||
| 69 | * Powerful yet simple to write virtual-patching rules | ||
| 70 | * Killing several classes of vulnerabilities | ||
| 71 | * [Unserialize-based](https://www.owasp.org/images/9/9e/Utilizing-Code-Reuse-Or-Return-Oriented-Programming-In-PHP-Application-Exploits.pdf) code execution | ||
| 72 | * [`mail`-based]( https://blog.ripstech.com/2016/roundcube-command-execution-via-email/ ) code execution | ||
| 73 | * Cookie-stealing [XSS]( https://en.wikipedia.org/wiki/Cross-site_scripting ) | ||
| 74 | * File-upload based code execution | ||
| 75 | * Weak PRNG | ||
| 76 | * [XXE]( https://en.wikipedia.org/wiki/XML_external_entity_attack ) | ||
| 77 | * Several hardening features | ||
| 78 | * Automatic `secure` and `samesite` flag for cookies | ||
| 79 | * Bundled set of rules to detect post-compromissions behaviours | ||
| 80 | * Global [strict mode]( https://secure.php.net/manual/en/migration70.new-features.php#migration70.new-features.scalar-type-declarations) and type-juggling prevention | ||
| 81 | * Whitelisting of [stream wrappers](https://secure.php.net/manual/en/intro.stream.php) | ||
| 82 | * Preventing writeable files execution | ||
| 83 | * Whitelist/blacklist for `eval` | ||
| 84 | * Enforcing TLS certificate validation when using [curl](https://secure.php.net/manual/en/book.curl.php) | ||
| 85 | * Request dumping capability | ||
| 86 | * A relatively sane code base: | ||
| 87 | * A [comprehensive](https://coveralls.io/github/jvoisin/snuffleupagus?branch=master) test suite close to 100% coverage | ||
| 88 | * Every commit is tested on [several distributions](https://gitlab.com/jvoisin/snuffleupagus/pipelines) | ||
| 89 | * An `clang-format`-enforced code style | ||
| 90 | * A [comprehensive documentation](https://snuffleupagus.rtfd.io) | ||
| 91 | * Usage of [coverity](https://scan.coverity.com/projects/jvoisin-snuffleupagus) | ||
| 92 | |||
| 93 | ## Download | ||
| 94 | |||
| 95 | We've got a [download | ||
| 96 | page](https://snuffleupagus.readthedocs.io/download.html), where you can find | ||
| 97 | packages for your distribution, but you can of course just `git clone` this | ||
| 98 | repo, or check the releases on [github](https://github.com/jvoisin/snuffleupagus/releases). | ||
| 99 | |||
| 100 | ## Examples | ||
| 101 | |||
| 102 | We're providing [various example rules](https://github.com/jvoisin/snuffleupagus/tree/master/config), | ||
| 103 | that are looking like this: | ||
| 104 | |||
| 105 | ```python | ||
| 106 | # Harden the `chmod` function | ||
| 107 | sp.disable_function.function("chmod").param("mode").value_r("^[0-9]{2}[67]$").drop(); | ||
| 108 | |||
| 109 | # Mitigate command injection in `system` | ||
| 110 | sp.disable_function.function("system").param("command").value_r("[$|;&`\\n]").drop(); | ||
| 111 | ``` | ||
| 112 | |||
| 113 | Upon violation of a rule, you should see lines like this in your logs: | ||
| 114 | |||
| 115 | ```python | ||
| 116 | [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. | ||
| 117 | ``` | ||
| 118 | |||
| 119 | ## Documentation | ||
| 12 | 120 | ||
| 13 | ## About Snuffleupagus | 121 | We've got a [comprehensive website](https://snuffleupagus.readthedocs.io/) with |
| 122 | all the documentation that you could possibly wish for. You can of course | ||
| 123 | [build it yourself](https://github.com/jvoisin/snuffleupagus/tree/master/doc). | ||
| 14 | 124 | ||
| 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. | 125 | ## Thanks |
| 16 | 126 | ||
| 17 | ## About Suhosin-NG | 127 | Many thanks to: |
| 18 | 128 | ||
| 19 |  | 129 | - The [Suhosin project](https://suhosin.org) for being a __huge__ source of inspiration |
| 130 | - [NBS System](https://www.nbs-system.com) for initially sponsoring the development | ||
| 131 | - [Suhosin-ng](https://github.com/sektioneins/suhosin-ng) for their | ||
| 132 | experimentations and [contributions](https://github.com/jvoisin/snuffleupagus/commits?author=bef), | ||
| 133 | as well as [NLNet](https://nlnet.nl/project/Suhosin-NG/) for sponsoring it | ||
| 134 | - All [our contributors](https://github.com/jvoisin/snuffleupagus/graphs/contributors) | ||
| 20 | 135 | ||
| 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). | ||
