Zimbra Tips: How To Protect Policyd WebUI

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
 
<LIMIT GET>
require valid-user
</LIMIT>
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
</Directory>
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
policyd-webui
Good luck and hopefully useful

Nhận xét

Bài đăng phổ biến