Re:Security Checklist
by ams6110 on Sunday March 20, 2016 @05:22PM
(#11324736)
Can you recommend a good reference for properly setting up HPKP?
[ Parent
| on HN ]
Re:Security Checklist
by tombrossman on Sunday March 20, 2016 @05:58PM
(#11324874)
This is a good guide: https://scotthelme.co.uk/hpkp-http-public-key-pinning/
I had a difficult time getting it to work without throwing errors for either Nginx or SSL Labs tests and it was down to good old single vs. double-quotes. Copy-pasting the output from a policy generator is not at all guaranteed to work well.
Here's a template you can use, substituting EXAMPLE for your certificate hashes (and optionally the report URI). Tested and working on Nginx and multiple third-party validators:
add_header Public-Key-Pins 'pin-sha256="EXAMPLE"; pin-sha256="EXAMPLE"; max-age=86400; report-uri=" https://report-uri.io/report/EXAMPLE"';