How to Add Content-Security-Policy (CSP) Headers in Zimbra

Posted by

A few days ago, one of our clients requested to enable Content-Security-Policy (CSP) on their email server. So, this is what I do

zmprov mcf +zimbraResponseHeader "Content-Security-Policy: default-src https: 'self' 'unsafe-inline'; script-src https: 'self' 'unsafe-inline' 'unsafe-eval'; object-src 'none'; img-src 'self' data:"

This configuration has been tested on Zimbra 10 and has worked well so far. Below are the conditions before and after implementing CSP

Before

Before apply CSP

After

After apply CSP

Good luck 🙂

4 comments

  1. Hello, I added the headers indicated here and it worked. Thank you. but I just have one question, I have permissions-police in red. How do I solve this? thanks, again

  2. Dear Imanudin
    Thanks for your help. After deploying this, CSP shows green but they give a warning like below
    “This policy contains ‘unsafe-inline’ which is dangerous in the default-src directive. This policy contains ‘unsafe-inline’ which is dangerous in the script-src directive. This policy contains ‘unsafe-eval’ which is dangerous in the script-src directive.”
    how can I overcome from this…?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.