Skip to contentSkip to conversation

Individual passwords for guest VNC servers ?

DISCUSSION Daniel P. Berrange 3 participants 7 messages Aug 16, 2006 – Aug 31, 2006 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

The current implementation of the VNC server in qemu-dm appears to just leverage whatever password the root user has set in /root/.vnc/passwd. This doesn't really have very nice semantics if one migrates the domain over to a different host...which may not have same VNC password file. It also doesn't allow for delegating access to individuale guest VNC console to differeing sets of users since all guests share same password for access.

Has anyone given any thought to / written any patches to enable assignment of different passwords to individual guest's VNC servers. At its simplest one could just allow the crypt/md5 hash of the desired password to be supplied in the xm config file, or XenD SEXPR when creating a new domain and pass that hash through to qemu-dm to use instead of /root/.vnc/passwd

Regards,
Dan.

Signature · 4 lines
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 
#1 lore raw
Quoted 4 lines · Daniel P. Berrange

The current implementation of the VNC server in qemu-dm appears to just leverage whatever password the root user has set in /root/.vnc/passwd. This doesn't really have very nice semantics if one migrates the domain over to a different host...which may not have same VNC password file.

Ok, so looking more closly I'm wrong here. The VNC server in qemu-dm does not use a password at all - it sets the VNC auth protocol to None.

At the same time it binds to 0.0.0.0 - so any HVM guest running VNC is completely unsecured, accessible to anyone who can route to the Dom0 host unless you've firewalled off all the ports >= 5900 on the machine. This looks like a pretty serious flaw to be fixed for 3.0.3

Quoted 5 lines

Has anyone given any thought to / written any patches to enable assignment of different passwords to individual guest's VNC servers. At its simplest one could just allow the crypt/md5 hash of the desired password to be supplied in the xm config file, or XenD SEXPR when creating a new domain and pass that hash through to qemu-dm to use instead of /root/.vnc/passwd

It appears that given the way the standard VNC challenge-response auth scheme works there's no choice but to store the actual password - at very least using some reversible encryption - we can't simply store the hash as one would with passwords for /etc/shadow. There are other newer auth schemes defined in VNC protocol, but its not clear whether these have broad support amongst VNC viewer clients.

Dan.

Signature · 4 lines
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 
#3 lore raw
In reply to a message not in the archive
Quoted 11 lines · Anthony Liguori
Quoted 4 lines · Daniel P. Berrange

least using some reversible encryption - we can't simply store the hash as one would with passwords for /etc/shadow. There are other newer auth schemes defined in VNC protocol, but its not clear whether these have broad support amongst VNC viewer clients.

I'm of the opinion that we should just choose a set of supported clients. Much to my surprise, most clients don't even support what's defined in the RFB spec--let alone all the extension :-/ Even the more popular ones... The 8 bit depths are particularly annoying as it seems that no one pays attention to the pixel format :-(

Ahhhh - this 8-bit pixel format thing you talk about could explain why I see strange colour shifts on the console for HVM domains ! Guess I'll have to double check this stuff in the virt-manager VNC protocol code. My normal Linux desktop RealVNC client shows a different colour-shift again...

Dan.

Signature · 4 lines
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 
#4 lore raw
In reply to Daniel P. Berrange

I'm thinking of adding the following protection to VNC console. I know it's not perfect, nonetheless, it's far better than the current no protection situation. Please comment.

Specification:
- The same challenge-response auth scheme as standard VNC to be available from VNC viewer (like RealVNC).
- The vnc password of each VM is described in the VM configuration file. When omit the password, do not use authentification.
ex) vnc_passwd = xxxxx
- Where "xxxxx" is an uuencoded encrypted password, that is, you can get this value by

  # cat ~/.vnc/passwd | uuencode -m passwd
    (needs uuencode command: sharutils package)

Watanabe.

Quoted 38 lines · Daniel P. Berrange
Quoted 4 lines

The current implementation of the VNC server in qemu-dm appears to just leverage whatever password the root user has set in /root/.vnc/passwd. This doesn't really have very nice semantics if one migrates the domain over to a different host...which may not have same VNC password file.

Ok, so looking more closly I'm wrong here. The VNC server in qemu-dm does not use a password at all - it sets the VNC auth protocol to None.

At the same time it binds to 0.0.0.0 - so any HVM guest running VNC is completely unsecured, accessible to anyone who can route to the Dom0 host unless you've firewalled off all the ports >= 5900 on the machine. This looks like a pretty serious flaw to be fixed for 3.0.3

Quoted 5 lines

Has anyone given any thought to / written any patches to enable assignment of different passwords to individual guest's VNC servers. At its simplest one could just allow the crypt/md5 hash of the desired password to be supplied in the xm config file, or XenD SEXPR when creating a new domain and pass that hash through to qemu-dm to use instead of /root/.vnc/passwd

It appears that given the way the standard VNC challenge-response auth scheme works there's no choice but to store the actual password - at very least using some reversible encryption - we can't simply store the hash as one would with passwords for /etc/shadow. There are other newer auth schemes defined in VNC protocol, but its not clear whether these have broad support amongst VNC viewer clients.

Dan.

Signature · 9 lines
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
#5 lore raw
Quoted 7 lines · Masami Watanabe

I'm thinking of adding the following protection to VNC console. I know it's not perfect, nonetheless, it's far better than the current no protection situation. Please comment.

Specification:
- The same challenge-response auth scheme as standard VNC to be available from VNC viewer (like RealVNC).

Yeah, looking at the various clients, challenge-response is the only one we can really rely on being present - in fact its the only one supported by Fedora VNC client (RealVNC IIRC?) at all.

Quoted 3 lines

- The vnc password of each VM is described in the VM configuration file. When omit the password, do not use authentification.
ex) vnc_passwd = xxxxx

I think we should be secure by default - if they omit the password then we should either generate one - and store it in xenstore, or refuse to activate VNC server. If we really really want to allow no passwords, then admin could have to explicitly request it with vnc_no_password=1 in the config file - but my prefernce is still that we should flat out refuse to allow an empty password - in this day & day its just plain wrong. RealVNC server for example, refuses to allow empty password.

Quoted 4 lines

- Where "xxxxx" is an uuencoded encrypted password, that is, you can get this value by

  # cat ~/.vnc/passwd | uuencode -m passwd
    (needs uuencode command: sharutils package)

Perhaps base64 would be preferable - that's a standard part of Linux coreutils toolset, rather than an addon like uuencode is.

Regards,
Dan.

Signature · 4 lines
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 
#7 lore raw
In reply to Masami Watanabe

Hi Dan,

I take your point about security, I'll do as follows.
- vnc_passwd is not omissible.
- The domain cannot be created if there is no vnc_passwd.

Thanks.
Watanabe.

Quoted 45 lines · Masami Watanabe
Quoted 7 lines

I'm thinking of adding the following protection to VNC console. I know it's not perfect, nonetheless, it's far better than the current no protection situation. Please comment.

Specification:
- The same challenge-response auth scheme as standard VNC to be available from VNC viewer (like RealVNC).

Yeah, looking at the various clients, challenge-response is the only one we can really rely on being present - in fact its the only one supported by Fedora VNC client (RealVNC IIRC?) at all.

Quoted 3 lines

- The vnc password of each VM is described in the VM configuration file. When omit the password, do not use authentification.
ex) vnc_passwd = xxxxx

I think we should be secure by default - if they omit the password then we should either generate one - and store it in xenstore, or refuse to activate VNC server. If we really really want to allow no passwords, then admin could have to explicitly request it with vnc_no_password=1 in the config file - but my prefernce is still that we should flat out refuse to allow an empty password - in this day & day its just plain wrong. RealVNC server for example, refuses to allow empty password.

Quoted 4 lines

- Where "xxxxx" is an uuencoded encrypted password, that is, you can get this value by

  # cat ~/.vnc/passwd | uuencode -m passwd
    (needs uuencode command: sharutils package)

Perhaps base64 would be preferable - that's a standard part of Linux coreutils toolset, rather than an addon like uuencode is.

Regards,
Dan.

Signature · 9 lines
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
#6 lore raw
In reply to Daniel P. Berrange
Quoted 7 lines · Daniel P. Berrange

I think we should be secure by default - if they omit the password then we should either generate one - and store it in xenstore, or refuse to activate VNC server. If we really really want to allow no passwords, then admin could have to explicitly request it with vnc_no_password=1 in the config file - but my prefernce is still that we should flat out refuse to allow an empty password - in this day & day its just plain wrong. RealVNC server for example, refuses to allow empty password.

IMHO this kind of "I'll make you do this for your own good" is a bug, not a feature.

When I run a VNC server, I typically have it bound to accept connections only from localhost, then I SSH tunnel in. I'm the only one using the box, so I know that no one else can log in. Being forced to have a password when I'm already using much stronger authentication is an annoyance and a waste of my time.

You can imagine other situations where the administrator knows that having no password is as secure as he needs it-- on an internal network or VPN, for instance. Or, a single user on a local machine. If I've got the box sitting in front of me, no one else can log in, and I type "xm create -f hvm.cfg", why should I have to type a password?

Having the "vnc_no_password" option is my preference; it encourages right behavior where appropriate, but leaves the administrator the option to make an informed decision.

-George