How to protect access to the admin console of Varnish?

The admin console is accessible to anyone with local access to the server on a particular port (see /etc/sysconfig/varnish). You could follow these simple measures to further secure this access. Although the first measure is enough to prevent any unauthorized access:

  1. Protect access to the console with a secret

a) Create a file called secret and add in it a unique secret (just like a password string): /etc/varnish/secret

b) Save the file and open /etc/sysconfig/varnish and insert a flag to the 'DAEMON_OPTS="-a :80' string just like this (add only the text in bold leaving all as is):

DAEMON_OPTS="-a :80 -S /etc/varnish/secret -T...

c) Save and restart varnish: service varnish restart

  1. Change the local administratin port number

a) Open file /etc/sysconfig/varnish

b) Replace the number "6082" in te DAEMON_OPTS line with an unused random port number (pick one unused number - it doesn't matter)

c) Save then restart varnish: service varnish restart

  • 10 Users Found This Useful
Was this answer helpful?

Related Articles

How do I uninstall the cPanel Varnish Plugin?

Here are the steps to remove the cPanel Varnish Plugin from your server. It's recommended that...

I've installed the cPanel Varnish Plugin, now what?

No action is required from your end. The installation script takes care of installing and...

Where can I download the installer?

The installer is in the Client Area location. Simply login to your account at...