Re: [users@httpd] CSP nonces in apache

2017-09-12 Thread Luis Speciale
Le 12/09/2017 à 14:57, Frank a écrit : You need to use a threaded mpm in order to support http2. Just unload the prefork mpm module, and load the event mpm module. I was Googling about this to find a solution. I'm going to try what you suggest. Thanks for your answer. Luis

Re: [users@httpd] CSP nonces in apache

2017-09-12 Thread Frank
On 12/09/17 05:22 AM, Luis Speciale wrote: Le 12/09/2017 à 09:33, Daniel Gruno a écrit : On 09/12/2017 09:32 AM, Luis Speciale wrote: Oh, my. It's NOT working. I fooled myself yesterday :( Which part in particular isn't working? Hi Daniel I'm going to do an exhaustive check before

Re: [users@httpd] CSP nonces in apache

2017-09-12 Thread Luis Speciale
Le 12/09/2017 à 09:33, Daniel Gruno a écrit : On 09/12/2017 09:32 AM, Luis Speciale wrote: Oh, my. It's NOT working. I fooled myself yesterday :( Which part in particular isn't working? Hi Daniel I'm going to do an exhaustive check before asking for more help, I feel like I'm abusing of

Re: [users@httpd] CSP nonces in apache

2017-09-12 Thread Daniel Gruno
On 09/12/2017 09:32 AM, Luis Speciale wrote: > Oh, my. It's NOT working. I fooled myself yesterday > > :( Which part in particular isn't working? > > Luis > > - > To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org >

Re: [users@httpd] CSP nonces in apache

2017-09-12 Thread Luis Speciale
Oh, my. It's NOT working. I fooled myself yesterday :( Luis - To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org For additional commands, e-mail: users-h...@httpd.apache.org

Re: [users@httpd] CSP nonces in apache (SOLVED)

2017-09-11 Thread Luis Speciale
Le 11/09/2017 à 17:12, Daniel Gruno a écrit : For those who wont to accept inline scripts and styles with a nonce according to the CSP directives. You must reinstall your apache server with lua support. In my Mac I had installed httpd2.4 with brew Open

Re: [users@httpd] CSP nonces in apache

2017-09-11 Thread Daniel Gruno
I'll top-post. You can't modify the headers with a filter, but you can change them before the filtering starts...I think The filter script starts with coroutine.yield(). before that, you can establish the nonce and set the header using either r.headers_out or the more robust r.err_headers_out

Re: [users@httpd] CSP nonces in apache

2017-09-11 Thread Luis Speciale
Le 11/09/2017 à 12:02, Daniel Gruno a écrit : You could alternately use mod_lua as an output filter. LuaOutputFilter fixupNonce /path/to/nonce.lua nonce SetOutputFilter fixupNonce # or AddOutputFilterByType and then in nonce.lua, you'd have: function fixNonce(stype, str) if

Re: [users@httpd] CSP nonces in apache

2017-09-11 Thread Luis Speciale
Le 11/09/2017 à 12:02, Daniel Gruno a écrit : On 09/11/2017 11:51 AM, Luis Speciale wrote: Le 11/09/2017 à 11:38, Mitchell Krog Photography a écrit : As per the original article from Scott Helme that you intially referred to, you will need to generate a random string yourself. Something like

Re: [users@httpd] CSP nonces in apache

2017-09-11 Thread Daniel Gruno
On 09/11/2017 11:51 AM, Luis Speciale wrote: > Le 11/09/2017 à 11:38, Mitchell Krog Photography a écrit : >> As per the original article from Scott Helme that you intially >> referred to, you will need to generate a random string yourself. >> Something like this might help you in the right

Re: [users@httpd] CSP nonces in apache

2017-09-11 Thread Luis Speciale
Le 11/09/2017 à 11:38, Mitchell Krog Photography a écrit : As per the original article from Scott Helme that you intially referred to, you will need to generate a random string yourself. Something like this might help you in the right direction - https://gist.github.com/earthgecko/3089509 I

Re: [users@httpd] CSP nonces in apache

2017-09-11 Thread Mitchell Krog Photography
 users@httpd.apache.org <users@httpd.apache.org>, lspeci...@gmail.com <lspeci...@gmail.com> Date: 11 September 2017 at 11:35:17 AM To: users@httpd.apache.org <users@httpd.apache.org> Subject:  Re: [users@httpd] CSP nonces in apache Le 11/09/2017 à 10:59, Daniel Gruno a écrit : > O

Re: [users@httpd] CSP nonces in apache

2017-09-11 Thread Luis Speciale
Le 11/09/2017 à 10:59, Daniel Gruno a écrit : On 09/11/2017 10:48 AM, Luis Speciale wrote: Le 07/09/2017 à 20:57, Daniel Gruno a écrit : might be that you need to uppercase it to NUMBNONCE. After a week trying I'm beginning to think that it can't be done the way I thought. Is there a way

Re: [users@httpd] CSP nonces in apache

2017-09-11 Thread Daniel Gruno
On 09/11/2017 10:48 AM, Luis Speciale wrote: > Le 07/09/2017 à 20:57, Daniel Gruno a écrit : > >> >> might be that you need to uppercase it to NUMBNONCE. > > After a week trying I'm beginning to think that it can't be done the way > I thought. Is there a way (another, of course) to achieve this?

Re: [users@httpd] CSP nonces in apache

2017-09-11 Thread Luis Speciale
Le 07/09/2017 à 20:57, Daniel Gruno a écrit : might be that you need to uppercase it to NUMBNONCE. After a week trying I'm beginning to think that it can't be done the way I thought. Is there a way (another, of course) to achieve this? Luis

Re: [users@httpd] CSP nonces in apache

2017-09-07 Thread Luis Speciale
Le 07/09/2017 à 20:57, Daniel Gruno a écrit : Try: Substitute "s/<(style|script)((?!\s*src=).*)>/<$1 nonce-${numbnonce} $2>/i" Now it substitutes

Re: [users@httpd] CSP nonces in apache

2017-09-07 Thread Daniel Gruno
On 09/07/2017 08:54 PM, Luis Speciale wrote: > Le 07/09/2017 à 20:36, Daniel Gruno a écrit : >> On 09/07/2017 08:30 PM, Luis Speciale wrote: >>> Le 07/09/2017 à 19:53, Daniel Gruno a écrit : >>> >>> Thank you for your answer. >>> Quick spot-check says you should probably change '.)*)' to

Re: [users@httpd] CSP nonces in apache

2017-09-07 Thread Luis Speciale
Le 07/09/2017 à 20:36, Daniel Gruno a écrit : On 09/07/2017 08:30 PM, Luis Speciale wrote: Le 07/09/2017 à 19:53, Daniel Gruno a écrit : Thank you for your answer. Quick spot-check says you should probably change '.)*)' to ').*)' I tried this but it doesn't seem to work. Also, the env

Re: [users@httpd] CSP nonces in apache

2017-09-07 Thread Daniel Gruno
On 09/07/2017 08:30 PM, Luis Speciale wrote: > Le 07/09/2017 à 19:53, Daniel Gruno a écrit : > > Thank you for your answer. > >> Quick spot-check says you should probably change '.)*)' to ').*)' > > I tried this but it doesn't seem to work. > >> Also, the env vars need to be ${}'ed. > > Ok,

Re: [users@httpd] CSP nonces in apache

2017-09-07 Thread Luis Speciale
Le 07/09/2017 à 19:53, Daniel Gruno a écrit : Thank you for your answer. Quick spot-check says you should probably change '.)*)' to ').*)' I tried this but it doesn't seem to work. Also, the env vars need to be ${}'ed. Ok, I got it. Assuming you want to inject nonce-foo into all

Re: [users@httpd] CSP nonces in apache

2017-09-07 Thread Daniel Gruno
On 09/07/2017 07:46 PM, Luis Speciale wrote: > Hello; > > I wanted to have CSP nonces in apache. Something like this in NGINX > https://scotthelme.co.uk/csp-nonce-support-in-nginx/ > The idea is to generate a number, put this number in the CSP nonce (the > header) and then replicate this number

[users@httpd] CSP nonces in apache

2017-09-07 Thread Luis Speciale
Hello; I wanted to have CSP nonces in apache. Something like this in NGINX https://scotthelme.co.uk/csp-nonce-support-in-nginx/ The idea is to generate a number, put this number in the CSP nonce (the header) and then replicate this number in every inline script. So in my httpd-vhosts.conf I