summaryrefslogtreecommitdiff
path: root/doc/source
diff options
context:
space:
mode:
Diffstat (limited to 'doc/source')
-rw-r--r--doc/source/config.rst24
-rw-r--r--doc/source/faq.rst72
2 files changed, 51 insertions, 45 deletions
diff --git a/doc/source/config.rst b/doc/source/config.rst
index 525885f..64d3591 100644
--- a/doc/source/config.rst
+++ b/doc/source/config.rst
@@ -11,15 +11,15 @@ Configuration
11 read the present documentation about how to configure them, 11 read the present documentation about how to configure them,
12 evaluate your threat model and write your configuration file accordingly. 12 evaluate your threat model and write your configuration file accordingly.
13 13
14Since PHP *ini-like* configuration model isn't flexible enough, 14Since PHP *ini-like* configuration model isn't flexible enough for our
15Snuffleupagus is using its own format in the file specified by 15usecases, Snuffleupagus is using its own format in the file specified by
16the directive ``sp.configuration_file`` **in** your ``php.ini`` file, 16the directive ``sp.configuration_file`` **in** your ``php.ini`` file,
17like ``sp.configuration_file=/etc/php/conf.d/snuffleupagus.rules``. 17like ``sp.configuration_file=/etc/php/conf.d/snuffleupagus.rules``.
18 18
19You can use the ``,`` separator to include multiple configuration files: 19You can use the ``,`` separator to include multiple configuration files:
20``sp.configuration_file=/etc/php/conf.d/snuffleupagus.rules,/etc/php/conf.d/sp_wordpress.rules``. 20``sp.configuration_file=/etc/php/conf.d/snuffleupagus.rules,/etc/php/conf.d/sp_wordpress.rules``.
21 21
22We're also also supporting `glob <https://en.wikipedia.org/wiki/Glob_%28programming%29>`__, 22It also supports `glob <https://en.wikipedia.org/wiki/Glob_%28programming%29>`__,
23so you can write something like: 23so you can write something like:
24``sp.configuration_file=/etc/php/conf.d/*.rules,/etc/php/conf.d/extra/test.rules``. 24``sp.configuration_file=/etc/php/conf.d/*.rules,/etc/php/conf.d/extra/test.rules``.
25 25
@@ -32,9 +32,9 @@ To sum up, you should put this in your ``php.ini``:
32 32
33And the **snuffleupagus rules** into the ``.rules`` files. 33And the **snuffleupagus rules** into the ``.rules`` files.
34 34
35Since our configuration format is a bit more complex than php's one, 35Since the configuration format is a bit more complex than php's one,
36we have a ``sp.allow_broken_configuration`` parameter (``false`` by default), 36their is a ``sp.allow_broken_configuration`` parameter (``false`` by default),
37that you can set to ``true`` if you want PHP to carry on if your Snuffleupagus' 37that can be set to ``true`` if you want PHP to carry on if your Snuffleupagus'
38configuration contains syntax errors. You'll still get a big scary message in 38configuration contains syntax errors. You'll still get a big scary message in
39your logs of course. We do **not** recommend to use it of course, but sometimes 39your logs of course. We do **not** recommend to use it of course, but sometimes
40it might be useful to be able to "debug in production" without breaking your 40it might be useful to be able to "debug in production" without breaking your
@@ -45,23 +45,23 @@ Configuration file format
45 45
46Options are chainable by using dots (``.``). 46Options are chainable by using dots (``.``).
47 47
48Some options have a string parameter, that **must** be quoted with double quotes, e.g. ``"string"``. 48String parameters **must** be quoted with double quotes, e.g. ``"string"``.
49 49
50Comments are prefixed either with ``#``, or ``;``. 50Comments are prefixed either with ``#``, or ``;``.
51 51
52Some rules apply in a specific ``function`` (context) on a specific ``variable`` 52Some rules apply to a specific ``function`` (context) on a specific ``variable``
53(data), like ``disable_function``. Others can only be enabled/disabled, like 53(data), like ``disable_function``. Others can only be enabled/disabled, like
54``harden_random``. 54``harden_random``.
55 55
56Most of the features can be used in ``simulation`` mode by appending the 56Most of the features can be used in ``simulation`` mode by appending the
57``.simulation()`` or ``.sim()`` option to them (eg. ``sp.readonly_exec.simulation().enable();``) to see 57``.simulation()`` or ``.sim()`` option to them (eg. ``sp.readonly_exec.simulation().enable();``) to see
58whether or not they could break your website. The simulation mode won't block the request, 58whether or not they could break your website. The simulation mode won't block the request,
59but will write a warning in the log. 59and will only log a warning.
60 60
61The rules are evaluated in the order that they are written, the **first** one 61The rules are evaluated in the order that they are written, the **first** one
62to match will terminate the evaluation (except for rules in simulation mode). 62to match will terminate the evaluation, except of course for rules in simulation mode.
63 63
64Rules can be split into lines and contain whitespace for easier readability and maintenance: (This feature is available since version 0.8.0.) 64Since Snuffleupagus 0.8.0, rules can be split into lines and contain whitespace for easier readability and maintenance:
65 65
66:: 66::
67 67
@@ -70,8 +70,6 @@ Rules can be split into lines and contain whitespace for easier readability and
70 .alias("newline in mail() To:") 70 .alias("newline in mail() To:")
71 .drop(); 71 .drop();
72 72
73The terminating ``;`` is optional for now, but it should be used for future compatibility.
74
75Rules, including comments, needs to be written in ASCII, other encodings aren't 73Rules, including comments, needs to be written in ASCII, other encodings aren't
76supported and might cause syntax errors and related issues like making 74supported and might cause syntax errors and related issues like making
77all rules after non-ASCII symbols not considered for execution and silently discarded. 75all rules after non-ASCII symbols not considered for execution and silently discarded.
diff --git a/doc/source/faq.rst b/doc/source/faq.rst
index 0485f21..df2cdb5 100644
--- a/doc/source/faq.rst
+++ b/doc/source/faq.rst
@@ -54,18 +54,18 @@ Why not Suhosin?
54 54
55We're huge fans of `Suhosin <https://suhosin.org>`_, unfortunately: 55We're huge fans of `Suhosin <https://suhosin.org>`_, unfortunately:
56 56
57- it doesn't work very well on PHP7 57- It doesn't work very well on PHP7+.
58- it has some oudated features and misses new ones 58- It has some outdated features and misses modern ones.
59- it doesn't cope very well with our various industrialization needs 59- It doesn't cope very well with some industrialization needs.
60- it has some shortcomings by design 60- It has some shortcomings by design.
61 61
62We're using the `disable_function <https://secure.php.net/manual/en/ini.core.php#ini.disable-functions>`_ 62For example,the `disable_function <https://secure.php.net/manual/en/ini.core.php#ini.disable-functions>`_
63directive, but unfortunately, it doesn't provide enough usable granularity (guess how many CMSs are using 63directive doesn't provide enough usable granularity: guess how many CMSs are using
64the `system <https://secure.php.net/manual/en/function.system.php#refsect1-function.system-notes>`_ 64the `system <https://secure.php.net/manual/en/function.system.php#refsect1-function.system-notes>`_
65function to perform various mandatory maintenance tasks). 65function to perform various mandatory maintenance tasks.
66 66
67This is why we decided to write our own hardening module, in the spirit of Suhosin, 67This is why we decided to write our own hardening module, in the spirit of Suhosin,
68with virtual-patching support, as well as other cool new features. 68with virtual-patching support, as well as other fancy new features.
69 69
70 70
71What license is Snuffleupagus released under and why? 71What license is Snuffleupagus released under and why?
@@ -75,11 +75,11 @@ Snuffleupagus is licensed under the `LGPL <https://www.gnu.org/copyleft/lesser.h
75was developed by the fine people from `NBS System <https://nbs-system.com/>`__, 75was developed by the fine people from `NBS System <https://nbs-system.com/>`__,
76and is maintained by Julien (jvoisin) Voisin. 76and is maintained by Julien (jvoisin) Voisin.
77 77
78We chose the LGPL because we don't care that much how you're using Snuffleupagus, 78The LGPL was chosen because we don't care that much how you're using Snuffleupagus,
79but we'd like to force people to make their improvements/contributions 79but we'd like to have improvements/contributions made available for everyone to
80available to everyone. 80benefit from.
81 81
82The complete license text is shipped with the sources and can be found under ``LICENSE``. 82The complete license text is shipped with the sources and can be found in the ``LICENSE`` file.
83 83
84For compatibility with older PHP versions, some original PHP source code was copied or ported back to older versions. 84For compatibility with older PHP versions, some original PHP source code was copied or ported back to older versions.
85This source code resides in ``src/sp_php_compat.c`` and ``src/sp_php_compat.h`` and retains its original license 85This source code resides in ``src/sp_php_compat.c`` and ``src/sp_php_compat.h`` and retains its original license
@@ -89,12 +89,11 @@ This source code resides in ``src/sp_php_compat.c`` and ``src/sp_php_compat.h``
89What is the different between Snuffleupagus and a (WAF) like ModSecurity? 89What is the different between Snuffleupagus and a (WAF) like ModSecurity?
90""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 90"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
91 91
92`ModSecurity <https://modsecurity.org/>`__ and other `Web Application 92`ModSecurity <https://modsecurity.org/>`__ and other `Web Application Firewalls
93Firewalls (WAF) <https://en.wikipedia.org/wiki/Web_application_firewall>`__ are 93(WAF) <https://en.wikipedia.org/wiki/Web_application_firewall>`__ are working
94working by inspecting the http traffic. Snuffleupagus being a PHP module, is 94by inspecting the http traffic. Snuffleupagus being a PHP module, operates
95operating directly inside your website's code, with a lesser overhead, as well 95directly inside the website's code, with a smaller overhead, as well as a
96as a better understanding of what is currently happening inside your 96better comprehension of what is currently happening there.
97application.
98 97
99 98
100Should I use Snuffleupagus? 99Should I use Snuffleupagus?
@@ -103,18 +102,19 @@ Should I use Snuffleupagus?
103Yes. 102Yes.
104 103
105Even if you're not using the virtual-patching capabilities, Snuffleupagus comes 104Even if you're not using the virtual-patching capabilities, Snuffleupagus comes
106with various passive features that won't break your website while killing numerous vulnerabilities. 105with various passive features that won't break your website while killing
106numerous vulnerability classes.
107 107
108Please keep in mind that you are not only protecting yourself and your users/customers, 108Please keep in mind that you are not only protecting yourself and your users/customers,
109but also other people on the internet that might be attacked by your server if 109but also other people on the internet that might be attacked by your server
110it becomes compromised. 110should it become compromised.
111 111
112How mature is this project? 112How mature is this project?
113""""""""""""""""""""""""""" 113"""""""""""""""""""""""""""
114 114
115This project has been floating around since early 2016 and we did the first commit 115This project has been floating around since early 2016 and the first commit
116the 28:sup:`th` of December of the same year. It's currently stable, 116is from the 28th of December of the same year. It's currently stable,
117and is usable and used in production. 117and is usable and used in production at various scales.
118 118
119Are you saying that PHP isn't secure? 119Are you saying that PHP isn't secure?
120""""""""""""""""""""""""""""""""""""" 120"""""""""""""""""""""""""""""""""""""
@@ -137,8 +137,8 @@ all your security issues, but we believe that it might definitely help.
137Sounds great, but is it working? 137Sounds great, but is it working?
138"""""""""""""""""""""""""""""""" 138""""""""""""""""""""""""""""""""
139 139
140We've been using it in production since a couple of years, and it thwarted 140It has been used in production since its inception, and thwarted
141numerous known and unknown attacks. If you want some evidences, one of the 141numerous known and unknown attacks. Should you want some evidences, one of the
142developer published in June 2019 a `blogpost 142developer published in June 2019 a `blogpost
143<https://dustri.org/b/snuffleupagus-versus-recent-high-profile-vulnerabilities.html>`__ 143<https://dustri.org/b/snuffleupagus-versus-recent-high-profile-vulnerabilities.html>`__
144showcasing how efficient Snuffleupagus was versus *major* web 144showcasing how efficient Snuffleupagus was versus *major* web
@@ -147,13 +147,13 @@ vulnerabilities from 2018/2019.
147 147
148Why should I send you bugs, security issues and patches? 148Why should I send you bugs, security issues and patches?
149""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 149"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
150
150Snuffleupagus is an open-source security software, by reporting (or fixing) 151Snuffleupagus is an open-source security software, by reporting (or fixing)
151bugs, or implementing new features, you are helping others to protect themselves. 152bugs, or implementing new features, you are helping others to protect themselves.
152 153
153We're also firm believers in the *Beerbounty* system: 154We're also firm believers in the *Beerbounty* system: we are happy to offer you
154we are happy to offer you beers when/if we ever meet if you helped the project in 155beers when/if we ever meet if you helped the project in any way. If you don't
155any way. If you don't like beer, we're sure that we'll find something else, 156like beer, we're sure that we'll find something else, don't worry.
156don't worry.
157 157
158 158
159Installation and configuration 159Installation and configuration
@@ -161,6 +161,7 @@ Installation and configuration
161 161
162Can snuffleupagus break my application? 162Can snuffleupagus break my application?
163""""""""""""""""""""""""""""""""""""""" 163"""""""""""""""""""""""""""""""""""""""
164
164Yes. 165Yes.
165 166
166Some options won't break anything, like :ref:`harden-rand <harden-rand-feature>`, 167Some options won't break anything, like :ref:`harden-rand <harden-rand-feature>`,
@@ -170,7 +171,7 @@ rules might pretty well break your website.
170It's up to you to configure Snuffleupagus accordingly to your needs. 171It's up to you to configure Snuffleupagus accordingly to your needs.
171 172
172You can also enable the ``simulation`` mode on features that you're not sure about, 173You can also enable the ``simulation`` mode on features that you're not sure about,
173to see what snuffleupagus would do to your application, before activating them for good. 174to see what Snuffleupagus would do to your application, before activating them for good.
174 175
175How can I find out the problem when my application breaks? 176How can I find out the problem when my application breaks?
176"""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 177""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
@@ -180,17 +181,20 @@ By checking the logs; Snuffleupagus systematically prefix them with ``[snuffleup
180 181
181Does Snuffleupagus run on Windows? 182Does Snuffleupagus run on Windows?
182"""""""""""""""""""""""""""""""""" 183""""""""""""""""""""""""""""""""""
184
183No idea, feel free to `try <https://github.com/jvoisin/snuffleupagus/issues/2>`_. 185No idea, feel free to `try <https://github.com/jvoisin/snuffleupagus/issues/2>`_.
184 186
185 187
186Does Snuggleupagus run on `HHVM <http://hhvm.com/>`_? 188Does Snuggleupagus run on `HHVM <http://hhvm.com/>`_?
187""""""""""""""""""""""""""""""""""""""""""""""""""""" 189"""""""""""""""""""""""""""""""""""""""""""""""""""""
190
188No it doesn't, since `HHVM's API <https://github.com/facebook/hhvm/wiki/Extension-API>`_ 191No it doesn't, since `HHVM's API <https://github.com/facebook/hhvm/wiki/Extension-API>`_
189is really different from PHP7's one. We're not currently planning to rewrite 192is really different from PHP7's one. We're not currently planning to rewrite
190Snuffleupagus to support it. 193Snuffleupagus to support it.
191 194
192Will Snuffleupagus run on my old PHP 5? 195Will Snuffleupagus run on my old PHP 5?
193""""""""""""""""""""""""""""""""""""""" 196"""""""""""""""""""""""""""""""""""""""
197
194No. 198No.
195 199
196Since PHP5 `is deprecated since the end of 2018 <http://php.net/supported-versions.php>`_, 200Since PHP5 `is deprecated since the end of 2018 <http://php.net/supported-versions.php>`_,
@@ -202,6 +206,7 @@ Help and support
202 206
203I found a security issue 207I found a security issue
204"""""""""""""""""""""""" 208""""""""""""""""""""""""
209
205If you believe you have found a security issue affecting Snuffleupagus, 210If you believe you have found a security issue affecting Snuffleupagus,
206then we would be more than happy to hear from you! 211then we would be more than happy to hear from you!
207 212
@@ -219,17 +224,19 @@ you find a security issue.
219 224
220I found a bug. How can I report it? 225I found a bug. How can I report it?
221""""""""""""""""""""""""""""""""""" 226"""""""""""""""""""""""""""""""""""
227
222We do have an issue tracker on `Github <https://github.com/jvoisin/snuffleupagus/issues>`_. 228We do have an issue tracker on `Github <https://github.com/jvoisin/snuffleupagus/issues>`_.
223Please make sure to include as much information as possible when reporting your issue, 229Please make sure to include as much information as possible when reporting your issue,
224such as your operating system, your version of PHP, your version of Snuffleupagus, 230such as your operating system, your version of PHP, your version of Snuffleupagus,
225your logs, the problematic PHP code, the request, a brief description, … long story short, 231your logs, the problematic PHP code, the request, a brief description, … long story short,
226give us everything that you can. 232give us everything you have.
227 233
228If you're feeling extra-nice, you can try to :ref:`debug it yourself <debug>`, 234If you're feeling extra-nice, you can try to :ref:`debug it yourself <debug>`,
229it's not that hard. 235it's not that hard.
230 236
231Where can I find even more help? 237Where can I find even more help?
232"""""""""""""""""""""""""""""""" 238""""""""""""""""""""""""""""""""
239
233The :doc:`configuration page <config>` might be what you're looking for. 240The :doc:`configuration page <config>` might be what you're looking for.
234If you're adventurous, you can also check the `issue tracker <https://github.com/jvoisin/snuffleupagus/issues/?q=is%3Aissue>`_ 241If you're adventurous, you can also check the `issue tracker <https://github.com/jvoisin/snuffleupagus/issues/?q=is%3Aissue>`_
235(make sure to check the `closed issues <https://github.com/jvoisin/snuffleupagus/issues?q=is%3Aissue+is%3Aclosed>`_ too). 242(make sure to check the `closed issues <https://github.com/jvoisin/snuffleupagus/issues?q=is%3Aissue+is%3Aclosed>`_ too).
@@ -240,6 +247,7 @@ Unimplemented mitigations and abandoned ideas
240 247
241Constant time comparisons 248Constant time comparisons
242""""""""""""""""""""""""" 249"""""""""""""""""""""""""
250
243We didn't manage to perform time-based side-channel attacks on strings 251We didn't manage to perform time-based side-channel attacks on strings
244against real world PHP application, and the results that we gathered on 252against real world PHP application, and the results that we gathered on
245tailored test cases weren't concluding: for simplicity's sake, we chose 253tailored test cases weren't concluding: for simplicity's sake, we chose