Zimbra Tips: How To Protect Policyd WebUI

Home » Zimbra » Zimbra Tips: How To Protect Policyd WebUI
Zimbra 22 Comments

Still talking about Policyd. When you access policyd webui, it’s not asking username and password. So, everyone can access policyd configuration via webui. To protect policyd webui, we can use three ways. First, we can stopping Apache service Zimbra with zmapachectl stop. Second, we can use firewall to protect and third, we can use login username and password  with htaccess. From three options available, i am recommended to using third option. This is how to protect policyd webui using username and password with htaccess.

cd /opt/zimbra/cbpolicyd/share/webui/
vi .htaccess

fill with the following lines

AuthUserFile /opt/zimbra/cbpolicyd/share/webui/.htpasswd
AuthGroupFile /dev/null
AuthName "User and Password"
AuthType Basic

require valid-user

create htpasswd file, username and password

touch .htpasswd
/opt/zimbra/httpd/bin/htpasswd -cb .htpasswd USERNAME PASSWORD

change username and password with username/password do you want. Edit httpd.conf Apache Zimbra

vi /opt/zimbra/conf/httpd.conf

add the following configuration at the bottom

Alias /webui /opt/zimbra/cbpolicyd/share/webui/
<Directory /opt/zimbra/cbpolicyd/share/webui/>
# Comment out the following 3 lines to make web ui accessible from anywhere
AllowOverride AuthConfig
Order Deny,Allow
Allow from all

Restart Apache Zimbra service

su - zimbra -c "zmapachectl restart"

please try to access policyd webui via browser. it would asking username and password like the following picture


Good luck and hopefully useful 😀

Let’s See the Video on Youtube

22 thoughts on - Zimbra Tips: How To Protect Policyd WebUI