[ZendTo] Http headers - audit requirements

Massimo Forni Massimo.Forni at turboden.it
Sat Sep 28 08:36:20 BST 2019


Thank you!!

Sent from my iPhone

> On 28 Sep 2019, at 03:19, Guy Bertrand via ZendTo <zendto at zend.to> wrote:
>
> Hello all Zendto users,
>
> Our corporate security and audit department recently asked me to make sure that our Zendto installation sent back a whole bunch of security HTTP headers.  I told them that a hacker won’t care about any headers you send back, because they don’t use browsers, but more command-line automated type tools.  It fell on deaf ears, and they told me that if I want to pass audit, I had to do this.  Sigh.
>
> So I’ll share what I was able to configure with the ZendTo distribution list to make the site pass the audit.  If you want to skip my verbose description, just go at the bottom of the email for the configs.
>
> In your typical ZendTo config/preferences.php file, there should be a section entitled “// Security HTTP headers”, with 3 paragraphs of comments and possibly only one configuration:
> ‘X-Frame-Options’ => ‘sameorigin’,
>
> That’s nice, but not enough.  I’ve been using https://urldefense.com/v3/__https://securityheaders.com__;!Ql7noIEoQAI!iy1LurtpBry_YcHesVvJUt99-z2cMFf09JTPz_YbBQMfWpmR4I1WOaYzS18T4YDj1xzxmg$  to test our web site, and obviously… the site failed miserably.
>
> So after a whole bunch of reading (https://urldefense.com/v3/__https://geekflare.com/http-header-implementation/__;!Ql7noIEoQAI!iy1LurtpBry_YcHesVvJUt99-z2cMFf09JTPz_YbBQMfWpmR4I1WOaYzS18T4YDPam4VXQ$  was pretty good), tweaking and testing, I’ve come up with a list of HTTP headers that gave me an A score.  Yea!!
>
> Note that I preferred to do this in my web server's configuration, not ZendTo's preferences.php file.  But I did leave the X-Frame-Options in the preferences.php, just to see what would happen the next time I upgrade ZendTo.
>
> The really tricky one is Content-Security-Policy.  If you don’t configure it just right, some of the ZendTo pages will not work.  I finally got it to work.  However, when I look at the code, Jules has obviously used some other open source tools, which have references to other sites (ie: URL), which I have found are not used by ZendTo.  However, in the config file, I have put them in a comment section.
>
> If you are trying to work on Content-Security-Policy (possibly after an upgrade) and you are having issues, do not despair!  Instead of Content-Security-Policy, you can actually start with Content-Security-Policy-Report-Only, which will display any warnings or errors in your browser’s development console (if you know how to get to it), while allowing the pages to display properly.  At least, that is what I did until I got it to work.  You can tweak the config file accordingly and then share it with the rest of us.  Same with the public-key-pins and public-key-pins-report-only.
>
> I’m using Apache Httpd.  If you are using another http server, you will need to adapt the config for your server’s syntax.
>
> Hope this helps!  And Jules, get better, not soon, but right now!!
>
> Regards,
>
> Guy
>
> Guy Bertrand, M.Ing
> Directeur informatique / IT Manager
> EXELA TECHNOLOGIES
> ####################################################################################
>
>
> # cat /etc/httpd/conf.d/httpheaders.conf
> ####################
> # This directive controls whether Server response header field which is sent back to clients includes a description of the generic OS-type of the server as well as information about compiled-in modules.
>
> ServerTokens Prod
>
> #########################################
> # The ServerSignature directive allows the configuration of a trailing footer line under server-generated documents (error messages, mod_proxy ftp directory listings, mod_info output, ...).
>
> ServerSignature Off
>
> #######################################
> # remove header X-Powered-By
>
> Header always unset "X-Powered-By"
> header unset "X-Powered-By"
>
> #######################
> # X-XSS-Protection sets the configuration for the XSS Auditor built into older browser. The recommended value was "X-XSS-Protection: 1; mode=block" but you should now look at Content Security Policy instead.
>
> Header set X-XSS-Protection "1; mode=block"
>
> #####################
> # HTTP Strict Transport Security is an excellent feature to support on your site and strengthens your implementation of TLS by getting the User Agent to enforce the use of HTTPS.
>
> Header always set Strict-Transport-Security "max-age=15768000; includeSubDomains"
>
> #######################
> # X-Content-Type-Options stops a browser from trying to MIME-sniff the content type and forces it to stick with the declared content-type. The only valid value for this header is "X-Content-Type-Options: nosniff".
>
> Header set X-Content-Type-Options nosniff
>
> #####################
> # WARNING! already included in ZendTo preferences.php file.  You can remove it from the preferences.php file and put it here.
>
> #Header always append X-Frame-Options SAMEORIGIN
>
> ############################
> # Using Adobe products like PDF, Flash, etc.? You can implement this header to instruct the browser how to handle the requests over a cross-domain. By implementing this header, you restrict loading your site’s assets from other domain to avoid resource abuse.
>
> Header set X-Permitted-Cross-Domain-Policies "none"
>
> #######################
> # Content Security Policy is an effective measure to protect your site from XSS attacks. By whitelisting sources of approved content, you can prevent the browser from loading malicious assets. Analyse this policy in more detail. You can sign up for a free account on Report URI to collect reports about problems on your site.
> # To start, you can use Content-Security-Policy-Report-Only and use the development tools in your browser to investigate the reported warning and errors.  All pages will be displayed, even if in error.
>
> # NOTE: ZENDTO has references to the following, yet I have not found that I needed to allow them...yet
> #https://urldefense.com/v3/__http://datatables.net__;!Ql7noIEoQAI!iy1LurtpBry_YcHesVvJUt99-z2cMFf09JTPz_YbBQMfWpmR4I1WOaYzS18T4YDNOAuo3w$
> #https://urldefense.com/v3/__http://cookiesandyou.com__;!Ql7noIEoQAI!iy1LurtpBry_YcHesVvJUt99-z2cMFf09JTPz_YbBQMfWpmR4I1WOaYzS18T4YB0LuW4fQ$
> #https://urldefense.com/v3/__http://zendto.to__;!Ql7noIEoQAI!iy1LurtpBry_YcHesVvJUt99-z2cMFf09JTPz_YbBQMfWpmR4I1WOaYzS18T4YBzIOYIMw$
> #mailto://
> #https://urldefense.com/v3/__https://info.smartmessages.net__;!Ql7noIEoQAI!iy1LurtpBry_YcHesVvJUt99-z2cMFf09JTPz_YbBQMfWpmR4I1WOaYzS18T4YAZxUNl2g$
> #https://urldefense.com/v3/__https://fonts.googleapis.com__;!Ql7noIEoQAI!iy1LurtpBry_YcHesVvJUt99-z2cMFf09JTPz_YbBQMfWpmR4I1WOaYzS18T4YCdVSzWTQ$
> #https://urldefense.com/v3/__http://www.smarty.net__;!Ql7noIEoQAI!iy1LurtpBry_YcHesVvJUt99-z2cMFf09JTPz_YbBQMfWpmR4I1WOaYzS18T4YCPWDB5Og$
>
> #Header set Content-Security-Policy
> #Header set Content-Security-Policy-Report-Only
>
> Header set Content-Security-Policy "default-src 'self' 'unsafe-inline' https://urldefense.com/v3/__https://uploadit.exelatech.com:443__;!Ql7noIEoQAI!iy1LurtpBry_YcHesVvJUt99-z2cMFf09JTPz_YbBQMfWpmR4I1WOaYzS18T4YCcLA6JCA$ ;  script-src 'self'  'unsafe-inline' https://urldefense.com/v3/__https://www.google.com__;!Ql7noIEoQAI!iy1LurtpBry_YcHesVvJUt99-z2cMFf09JTPz_YbBQMfWpmR4I1WOaYzS18T4YCeI-LdQg$  https://urldefense.com/v3/__https://www.gstatic.com__;!Ql7noIEoQAI!iy1LurtpBry_YcHesVvJUt99-z2cMFf09JTPz_YbBQMfWpmR4I1WOaYzS18T4YByC6zijQ$ ; connect-src 'self'; img-src 'self' 'unsafe-inline' data: ;  font-src 'self' https://urldefense.com/v3/__https://fonts.googleapis.com__;!Ql7noIEoQAI!iy1LurtpBry_YcHesVvJUt99-z2cMFf09JTPz_YbBQMfWpmR4I1WOaYzS18T4YCdVSzWTQ$  https://urldefense.com/v3/__https://fonts.gstatic.com__;!Ql7noIEoQAI!iy1LurtpBry_YcHesVvJUt99-z2cMFf09JTPz_YbBQMfWpmR4I1WOaYzS18T4YDVUHGAhQ$ ;  style-src 'self' 'unsafe-inline' https://urldefense.com/v3/__https://fonts.googleapis.com__;!Ql7noIEoQAI!iy1LurtpBry_YcHesVvJUt99-z2cMFf09JTPz_YbBQMfWpmR4I1WOaYzS18T4YCdVSzWTQ$ ; frame-src 'self' https://urldefense.com/v3/__https://www.google.com__;!Ql7noIEoQAI!iy1LurtpBry_YcHesVvJUt99-z2cMFf09JTPz_YbBQMfWpmR4I1WOaYzS18T4YCeI-LdQg$  https://urldefense.com/v3/__https://www.gstatic.com__;!Ql7noIEoQAI!iy1LurtpBry_YcHesVvJUt99-z2cMFf09JTPz_YbBQMfWpmR4I1WOaYzS18T4YByC6zijQ$ "
>
> ##########################################
> # Expect-CT allows a site to determine if they are ready for the upcoming Chrome requirements and/or enforce their CT policy.
>
> Header set Expect-CT "max-age=0"
>
> #########################
> # not configured yet, but we still pass audit
> #########################
> # HTTP Public Key Pinning. Minimize the man-in-the-middle (MITM) attacks risk by pinning certificate. This is possible with HPKP (HTTP Public Key Pinning) header.  You can pin the root certificate public key or immediate certificate. At the time of writing, HPKP currently works in Firefox and Chrome and support SHA-256 hash algorithm.
> # To start, you can use public-key-pins-report-only and use the development tools in your browser to investigate the reported warning and errors.  All pages will be displayed, even if in error.
>
> #public-key-pins
> #public-key-pins-report-only
>
> # not configured yet
>
> ########################
> # NEW HEADERS coming soon
> ########################
> # Feature Policy is a new header that allows a site to control which features and APIs can be used in the browser.
>
> # Not configured yet.
>
> ########################
> # referrer-policy is a new header that allows a site to control how much information the browser includes with navigations away from a document and should be set by all sites.
>
> # Not configured yet.
>
> ########################
> # Expect-CT allows a site to determine if they are ready for the upcoming Chrome requirements and/or enforce their CT policy.
>
> # Not configured yet.
> ________________________________
> Attention : le présent message et toutes les pièces jointes sont confidentiels et établis à l'attention exclusive du ou des destinataire(s) indiqué(s). Toute autre diffusion ou utilisation non autorisée est interdite. Si vous recevez ce message par erreur, veuillez immédiatement en avertir l'expéditeur par e-mail en retour, détruire le message et vous abstenir de toute référence aux informations qui y figurent afin d'éviter les sanctions attachées à la divulgation et à l'utilisation d'informations confidentielles. Les messages électroniques sont susceptibles d'altération. Exela Technologies et ses filiales déclinent toute responsabilité en cas d'altération ou de falsification du présent message.
> ________________________________
> Please consider the environment before printing or forwarding this email. If you do print this email, please recycle the paper.
>
> This email message may contain confidential, proprietary and/or privileged information. It is intended only for the use of the intended recipient(s). If you have received it in error, please immediately advise the sender by reply email and then delete this email message. Any disclosure, copying, distribution or use of the information contained in this email message to or by anyone other than the intended recipient is strictly prohibited. Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of Exela Technologies, Inc. or its subsidiaries.
>
> This email does not constitute an agreement to conduct transactions by electronic means and does not create any legally binding contract or enforceable obligation against Exela in the absence of a fully signed written agreement.
> _______________________________________________
> ZendTo mailing list
> ZendTo at zend.to
> https://urldefense.com/v3/__http://jul.es/mailman/listinfo/zendto__;!Ql7noIEoQAI!iy1LurtpBry_YcHesVvJUt99-z2cMFf09JTPz_YbBQMfWpmR4I1WOaYzS18T4YB4c3j2kw$
--
Massimo Forni
ICT Infrastructure Manager

Mobile: +393474110278
________________________________


Turboden S.p.A. I via Cernaia 10 I 25124 Brescia I Italy
t. +390303552001 I f. +390303552011
www.turboden.com<http://www.turboden.com>


Confidentiality notice: this message, together with its attachments, may contain strictly confidential and/or legally privileged information and it is destined solely to the intended addressee(s), who only may use it under his/their responsibility. Opinions, conclusions and other information contained in this message, that do not relate to the official business of this firm, shall be considered as not given or endorsed by it. If you have received this communication in error, please notify us immediately by responding to this email and then delete it from your system. Any use, disclosure, copying or distribution of the contents of this communication by a not-intended recipient or in violation of the purposes of this communication is strictly prohibited and may be unlawful.



More information about the ZendTo mailing list