Re: CSP nonces in apache

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 ').*)'
>>>
>>> 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 non-external scripts, I
>>>> would shorten it to something like:
>>>>
>>>> s|<(style|script)\s*((?!src=).*)>|<$1 nonce-${numbnonce} $2>|
>>>
>>> When i do like you said, I have an error
>>> Bad Substitute flag, only s///[infq] are supported
>>> I imagine it's because the extra pipe.
>>> But even without it
>>> Substitute "s|<(style)\s*((?!src=).*)>|<$1 nonce-${numbnonce} $2>|i"
>>> I have no substitution at all.
>>
>> Try:
>>
>> Substitute "s/<(style|script)((?!\s*src=).*)>/<$1 nonce-${numbnonce}
>> $2>/i"
> 
> Now it substitutes <script> with <script nonce-%{unique_id}e="">
> It ignores the value of numbnonce (%{UNIQUE_ID}e) and writes it
> litterally, even if in the headers this variable appears ok.
> When I look the headers it has the correct value
> 'nonce-WbGTF8CoABAAADn5XWYAAAAP'

might be that you need to uppercase it to NUMBNONCE.

> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
> For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx




[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux