@@ -52,52 +52,52 @@ CLI interface access
5252
5353The command line interface can be accessed in three ways.
5454
55- `varnishd ` can be told to listen and offer CLI connections
56- on a TCP socket. You can bind the socket to pretty
57- much anything the kernel will accept::
55+ :ref: `varnishd(1) ` can be told to listen and offer CLI connections on
56+ a TCP socket. You can bind the socket to pretty much anything the
57+ kernel will accept::
5858
5959 -T 127.0.0.1:631
6060 -T localhost:9999
6161 -T 192.168.1.1:34
6262 -T '[fe80::1]:8082'
6363
64- The default is ``-T localhost:0 `` which will pick a random
65- port number, which `varnishadm(8) ` can learn from the shared
66- memory.
64+ The default is ``-T localhost:0 `` which will pick a random port
65+ number, which :ref: `varnishadm(1) ` can learn from the shared memory.
6766
68- By using a " localhost" address, you restrict CLI access
69- to the local machine.
67+ By using a `` localhost `` address, you restrict CLI access to the local
68+ machine.
7069
7170You can also bind the CLI port to an IP address reachable across
7271the net, and let other machines connect directly.
7372
74- This gives you no secrecy, i.e. the CLI commands will
75- go across the network as ASCII text with no encryption, but
76- the -S/ PSK authentication requires the remote end to know
77- the shared secret.
73+ This gives you no secrecy, i.e. the CLI commands will go across the
74+ network as ASCII text with no encryption, but the `` -S `` / pre shared
75+ key (` PSK `_) authentication requires the remote end to know the shared
76+ secret.
7877
79- Alternatively you can bind the CLI port to a ' localhost' address,
78+ Alternatively you can bind the CLI port to a `` localhost `` address,
8079and give remote users access via a secure connection to the local
8180machine, using ssh/VPN or similar.
8281
83- If you use `ssh ` you can restrict which commands each user can execute
84- to just `varnishadm `, or even use a wrapper scripts around ` varnishadm `
85- to allow specific CLI commands.
82+ If you use `ssh(1) ` you can restrict which commands each user can
83+ execute to just :ref: `varnishadm(1) `, or even use a wrapper scripts
84+ around :ref: ` varnishadm(1) ` to allow specific CLI commands.
8685
87- It is also possible to configure `varnishd ` for "reverse mode", using
88- the '-M' argument. In that case `varnishd ` will attempt to open a
89- TCP connection to the specified address, and initiate a CLI connection
90- to your central Varnish management facility.
86+ It is also possible to configure :ref: `varnishd(1) ` for "reverse
87+ mode", using the `` -M `` argument. In that case :ref: `varnishd(1) `
88+ will attempt to open a TCP connection to the specified address, and
89+ initiate a CLI connection to your central Varnish management facility.
9190
9291.. XXX:Maybe a sample command here with a brief explanation? benc
9392
9493 The connection in this case is also without encryption, but
95- the remote end must still authenticate using -S/ PSK.
94+ the remote end must still authenticate using `` -S `` \ /` PSK `_ .
9695
97- Finally, if you run varnishd with the '-d' option, you get a CLI
98- command on stdin/stdout, but since you started the process, it
99- would be hard to prevent you getting CLI access, wouldn't it ?
96+ Finally, if you run varnishd with the `` -d `` option, you get a CLI
97+ command on stdin/stdout, but since you started the process, it would
98+ be hard to prevent you getting CLI access, wouldn't it ?
10099
100+ .. _PSK :
101101
102102CLI interface authentication
103103^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -106,37 +106,38 @@ By default the CLI interface is protected with a simple, yet powerful
106106"Pre Shared Key" authentication method, which do not provide secrecy
107107(ie: The CLI commands and responses are not encrypted).
108108
109- The way -S /PSK works is really simple: During startup a file is
110- created with a random content and the file is only accessible to
111- the user who started `varnishd ` (or the superuser).
109+ The way `` -S `` \ /PSK works is really simple: During startup a file is
110+ created with a random content and the file is only accessible to the
111+ user who started :ref: `varnishd(1) ` (or the superuser).
112112
113113To authenticate and use a CLI connection, you need to know the
114- contents of that file, in order to answer the cryptographic
115- challenge `varnishd ` issues, see :ref: `ref_psk_auth `.
114+ contents of that file, in order to answer the cryptographic challenge
115+ :ref: `varnishd(1) ` issues, see :ref: `ref_psk_auth `.
116116
117- `varnishadm ` uses all of this to restrict access, it will only function,
118- provided it can read the secret file.
117+ :ref: `varnishadm(1) ` uses all of this to restrict access, it will only
118+ function, provided it can read the secret file.
119119
120- If you want to allow other users, local or remote, to be able to access
121- CLI connections, you must create your own secret file and make it possible
122- for (only!) these users to read it.
120+ If you want to allow other users, local or remote, to be able to
121+ access CLI connections, you must create your own secret file and make
122+ it possible for (only!) these users to read it.
123123
124124A good way to create the secret file is::
125125
126126 dd if=/dev/random of=/etc/varnish_secret count=1
127127
128- When you start `varnishd `, you specify the filename with '-S', and
129- it goes without saying that the `varnishd ` master process needs
130- to be able to read the file too.
128+ When you start :ref: `varnishd(1) `, you specify the filename with '-S',
129+ and it goes without saying that the :ref: `varnishd(1) ` master process
130+ needs to be able to read the file too.
131131
132- You can change the contents of the secret file while `varnishd `
133- runs, it is read every time a CLI connection is authenticated.
132+ You can change the contents of the secret file while
133+ :ref: `varnishd(1) ` runs, it is read every time a CLI connection is
134+ authenticated.
134135
135- On the local system, `varnishadm ` can retrieve the filename from
136- shared memory, but on remote systems, you need to give ` varnishadm `
137- a copy of the secret file, with the -S argument.
136+ On the local system, :ref: `varnishadm(1) ` can retrieve the filename
137+ from shared memory, but on remote systems, you need to give
138+ :ref: ` varnishadm(1) ` a copy of the secret file, with the -S argument.
138139
139- If you want to disable -S /PSK authentication, use an ``-S none ``
140+ If you want to disable `` -S `` \ /PSK authentication, use an ``-S none ``
140141argument to varnishd::
141142
142143 varnishd [...] -S none [...]
@@ -155,20 +156,22 @@ HTTP service, but a few can do more damage than others:
155156 Execute arbitrary programs
156157
157158:ref: `ref_param_vcc_allow_inline_c `
158- Allow inline C in VCL, which would allow any C code from VCL to be executed by Varnish.
159+ Allow inline C in VCL, which would allow any C code from VCL
160+ to be executed by Varnish.
159161
160162Furthermore you may want to look at and lock down:
161163
162164:ref: `ref_param_syslog_cli_traffic `
163165 Log all CLI commands to `syslog(8) `, so you know what goes on.
164166
165167:ref: `ref_param_vcc_unsafe_path `
166- Restrict VCL/VMODs to :ref: `ref_param_vcl_path ` and :ref: `ref_param_vmod_path `
168+ Restrict VCL/VMODs to :ref: `ref_param_vcl_path ` and
169+ :ref: `ref_param_vmod_path `
167170
168171:ref: `ref_param_vmod_path `
169- The directory (or colon separated list of directories) where
170- Varnish will look for modules. This could potentially be
171- used to load rogue modules into Varnish.
172+ The directory (or colon separated list of directories) where
173+ Varnish will look for modules. This could potentially be
174+ used to load rogue modules into Varnish.
172175
173176The CLI interface
174177-----------------
@@ -181,12 +184,11 @@ As described above, some of the damage can be limited by restricting
181184certain parameters, but that will only protect the local filesystem,
182185and operating system, it will not protect your HTTP service.
183186
184- We do not currently have a way to restrict specific CLI commands
185- to specific CLI connections. One way to get such an effect is to
186- "wrap" all CLI access in pre-approved scripts which use `varnishadm(1) `
187-
188- to submit the sanitized CLI commands, and restrict a remote user
189- to only those scripts, for instance using sshd(8)'s configuration.
187+ We do not currently have a way to restrict specific CLI commands to
188+ specific CLI connections. One way to get such an effect is to "wrap"
189+ all CLI access in pre-approved scripts which use :ref: `varnishadm(1) `
190+ to submit the sanitized CLI commands, and restrict a remote user to
191+ only those scripts, for instance using sshd(8)'s configuration.
190192
191193VCL programs
192194------------
@@ -198,11 +200,13 @@ Both of these mechanisms allow execution of arbitrary code and will
198200thus allow a person to get access to the machine, with the
199201privileges of the child process.
200202
201- If `varnishd ` is started as root/superuser, we sandbox the child
202- process, using whatever facilities are available on the operating
203- system, but if `varnishd ` is not started as root/superuser, this is
204- not possible. No, don't ask me why you have to be superuser to
205- lower the privilege of a child process...
203+ If :ref: `varnishd(1) ` is started as root/superuser, we sandbox the
204+ child process, using whatever facilities are available on the
205+ operating system, but if :ref: `varnishd(1) ` is not started as
206+ root/superuser, this is not possible. No, don't ask me why you have to
207+ be superuser to lower the privilege of a child process...
208+
209+ .. XXX the above is not correct for the solaris jail
206210
207211 Inline-C is disabled by default since Varnish version 4, so unless
208212you enable it, you don't have to worry about it.
@@ -229,4 +233,3 @@ to various kinds of attacks and subversive activities.
229233If you have "administrative" HTTP requests, for instance PURGE
230234requests, we strongly recommend that you restrict them to trusted
231235IP numbers/nets using VCL's :ref: `vcl_syntax_acl `.
232-
0 commit comments