Daniel P. Berrange
2006-Dec-05 19:31 UTC
[Xen-devel] [PATCH] Scrub VNC passwords from XenD log files
The XendDomainInfo and XendConfig classes both log the guest VM config data to the /var/log/xen/xend.log in many places. Unfortunately the VNC passwords are stored in plain text in the guest VM config files. So we end up with plain text passwords in the xend.log file Now we can make /var/log/xen mode 0700 to protect them from local users, but it is very common when debugging issues to request that a user attach the contents of /var/log/xen/xend.log to the bug report ticket, or emails sent to mailing lists. This will obviously compromise any VNC passwords to essentially the while world & his dog. What''s more, Google will make it incredibly easy to search for these too. There are a few potential approaches to this 1. Remove all logging from xend.log 2. Change default log level to only record WARN and higher, so DEBUG stuff is not recorded normally 3. Scrub the passwords out of the data being logged 4. Do nothing I really don''t like options 1 or 2, because the stuff XenD is logging is actually incredibly helpful when debugging end user problems. 4 is not really a viable option either. So we''re left with 3. Thus I am attaching a prototype patch which scrubs VNC passwords out of the data being logged by XenD. Regards, Dan. -- |=- 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 Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ewan Mellor
2006-Dec-06 12:25 UTC
Re: [Xen-devel] [PATCH] Scrub VNC passwords from XenD log files
On Tue, Dec 05, 2006 at 07:31:25PM +0000, Daniel P. Berrange wrote:> The XendDomainInfo and XendConfig classes both log the guest VM config data > to the /var/log/xen/xend.log in many places. Unfortunately the VNC passwords > are stored in plain text in the guest VM config files. So we end up with > plain text passwords in the xend.log file > > Now we can make /var/log/xen mode 0700 to protect them from local users, > but it is very common when debugging issues to request that a user attach > the contents of /var/log/xen/xend.log to the bug report ticket, or emails > sent to mailing lists. This will obviously compromise any VNC passwords > to essentially the while world & his dog. What''s more, Google will make > it incredibly easy to search for these too. > > > There are a few potential approaches to this > > 1. Remove all logging from xend.log > 2. Change default log level to only record WARN and higher, so DEBUG > stuff is not recorded normally > 3. Scrub the passwords out of the data being logged > 4. Do nothing > > I really don''t like options 1 or 2, because the stuff XenD is logging is > actually incredibly helpful when debugging end user problems. 4 is not > really a viable option either. So we''re left with 3. > > Thus I am attaching a prototype patch which scrubs VNC passwords out of > the data being logged by XenD.That looks good to me -- could I have a Signed-off-by line, so I can apply it? Thanks, Ewan. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Daniel P. Berrange
2006-Dec-06 17:16 UTC
Re: [Xen-devel] [PATCH] Scrub VNC passwords from XenD log files
On Wed, Dec 06, 2006 at 12:25:20PM +0000, Ewan Mellor wrote:> On Tue, Dec 05, 2006 at 07:31:25PM +0000, Daniel P. Berrange wrote: > > > The XendDomainInfo and XendConfig classes both log the guest VM config data > > to the /var/log/xen/xend.log in many places. Unfortunately the VNC passwords > > are stored in plain text in the guest VM config files. So we end up with > > plain text passwords in the xend.log file > > > > Now we can make /var/log/xen mode 0700 to protect them from local users, > > but it is very common when debugging issues to request that a user attach > > the contents of /var/log/xen/xend.log to the bug report ticket, or emails > > sent to mailing lists. This will obviously compromise any VNC passwords > > to essentially the while world & his dog. What''s more, Google will make > > it incredibly easy to search for these too. > > > > > > There are a few potential approaches to this > > > > 1. Remove all logging from xend.log > > 2. Change default log level to only record WARN and higher, so DEBUG > > stuff is not recorded normally > > 3. Scrub the passwords out of the data being logged > > 4. Do nothing > > > > I really don''t like options 1 or 2, because the stuff XenD is logging is > > actually incredibly helpful when debugging end user problems. 4 is not > > really a viable option either. So we''re left with 3. > > > > Thus I am attaching a prototype patch which scrubs VNC passwords out of > > the data being logged by XenD. > > That looks good to me -- could I have a Signed-off-by line, so I can apply it?I didn''t add the signed-off-by because the patch isn''t finished - I really just wanted to see if people were amenable to this kind of approach before doing more work on it. Since you like it, I''ll finish it off shortly - there just a couple more test cases I need to go through - suspend/restore & inactive domains - to verify passwords are always scrubbed correctly. I''ll post a final version of the patch by the end of today if all goes to plan. Regards, Dan. -- |=- 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 Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ewan Mellor
2006-Dec-06 17:24 UTC
Re: [Xen-devel] [PATCH] Scrub VNC passwords from XenD log files
On Wed, Dec 06, 2006 at 05:16:03PM +0000, Daniel P. Berrange wrote:> I didn''t add the signed-off-by because the patch isn''t finished - I really > just wanted to see if people were amenable to this kind of approach before > doing more work on it. Since you like it, I''ll finish it off shortly - there > just a couple more test cases I need to go through - suspend/restore & inactive > domains - to verify passwords are always scrubbed correctly. I''ll post a final > version of the patch by the end of today if all goes to plan.Great, thanks. I think you''re right that this is the best of all the available options, fiddly though it is. Perhaps we could write a final check at the end of xm-test, to make sure that "vncpasswd" doesn''t appear in the logs anywhere -- that would make sure that this never regresses. Ewan. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Daniel P. Berrange
2006-Dec-06 19:43 UTC
Re: [Xen-devel] [PATCH] Scrub VNC passwords from XenD log files
On Wed, Dec 06, 2006 at 05:24:36PM +0000, Ewan Mellor wrote:> On Wed, Dec 06, 2006 at 05:16:03PM +0000, Daniel P. Berrange wrote: > > > I didn''t add the signed-off-by because the patch isn''t finished - I really > > just wanted to see if people were amenable to this kind of approach before > > doing more work on it. Since you like it, I''ll finish it off shortly - there > > just a couple more test cases I need to go through - suspend/restore & inactive > > domains - to verify passwords are always scrubbed correctly. I''ll post a final > > version of the patch by the end of today if all goes to plan. > > Great, thanks. I think you''re right that this is the best of all the > available options, fiddly though it is. Perhaps we could write a final check > at the end of xm-test, to make sure that "vncpasswd" doesn''t appear in the > logs anywhere -- that would make sure that this never regresses.Attached is a final version of the patch to scrub passwords. I have tested it with HVM guests, and parvirt guests, using ''start'', ''new'', ''create'', ''suspend'', ''resume'' commands to XM. In all cases, no password was present to the XenD log files created. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Regards, Dan. -- |=- 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 Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ewan Mellor
2006-Dec-07 12:14 UTC
Re: [Xen-devel] [PATCH] Scrub VNC passwords from XenD log files
On Wed, Dec 06, 2006 at 07:43:09PM +0000, Daniel P. Berrange wrote:> On Wed, Dec 06, 2006 at 05:24:36PM +0000, Ewan Mellor wrote: > > On Wed, Dec 06, 2006 at 05:16:03PM +0000, Daniel P. Berrange wrote: > > > > > I didn''t add the signed-off-by because the patch isn''t finished - I really > > > just wanted to see if people were amenable to this kind of approach before > > > doing more work on it. Since you like it, I''ll finish it off shortly - there > > > just a couple more test cases I need to go through - suspend/restore & inactive > > > domains - to verify passwords are always scrubbed correctly. I''ll post a final > > > version of the patch by the end of today if all goes to plan. > > > > Great, thanks. I think you''re right that this is the best of all the > > available options, fiddly though it is. Perhaps we could write a final check > > at the end of xm-test, to make sure that "vncpasswd" doesn''t appear in the > > logs anywhere -- that would make sure that this never regresses. > > Attached is a final version of the patch to scrub passwords. I have tested > it with HVM guests, and parvirt guests, using ''start'', ''new'', ''create'', > ''suspend'', ''resume'' commands to XM. In all cases, no password was present > to the XenD log files created. > > Signed-off-by: Daniel P. Berrange <berrange@redhat.com>Applied, thanks. Ewan. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel