views:

439

answers:

4

What would be the Most secure and Safe way to allow software to auto-update without opening too many holes to enable a hacker easy access to a system?

+5  A: 

Have you looked into ClickOnce Deployment?

http://msdn.microsoft.com/en-us/library/t71a733d(VS.80).aspx

The short overview is here:

http://msdn.microsoft.com/en-us/library/142dbbz4(VS.80).aspx

David Stratton
+1 for ClickOnce. Provides a great solution to web deployment that buffers you from all the nitty-gritty of it, providing an extremely easy package and deployment process. Updated for clients are quite seamless and painless.
jrista
A: 

If you are going to make your own system then you will probably want to have a public/private key pair.

So, you would zip up the update.

Then encrypt with the private key on the server.

The client can then decrypt and unzip it, and then install it.

That way, as long as your private key is secure then you can ensure that the update is legit.

The only weakness here is that if someone changed the public key to some other key, then they could fool that program into thinking that a trojan is a valid update.

There are various schemes you can use to get around this, but that would depend on how much work you want to put into this.

James Black
A: 

I recommend not building your own auto-update, use ClickOnce if it works for you or a commercial auto-update component if not.

If you want to see what is involved I wrote a series about writing an auto-update component on my blog some time ago, the last post with links to all the posts in the series is at: http://www.nbdtech.com/blog/archive/2007/08/07/How-To-Write-an-Automatic-Update-System-Part-8.aspx

Nir
A: 

ClickOnce auto update is all fair and well but anyone can admit that it is not the most of fashionable solution. I've recently developed a solution that requires such an auto-update feature. Here is a list of brief steps I took to deploying my very own updating service that also allows for roll-backs with 'minimal' know-how.

  1. Add a Setup project to the solution so that the project could be wrapped up neatly in a .exe or .msi installer package.

  2. The following is to setup a FTP server with your desired user credential that only your application knows. On the ftp server, setup a default directory for where you will put any new updates.

  3. Your application will check for internet connection on start-up, log into your remote FTP server and check for any new files to download.

  4. Download new updates to your client application and put them in a date-time named folder for future reference. Some checks need to be in place to make sure that you don't download the same old files.

  5. Close the application and run the new installation. Depending on how you setup your Setup project, the installation wizard may remove the previous version completely or just update partial (patches, etc.).

  6. Your application may have a feature to roll-back to previous version by going into the local update directory and fish out the previously downloaded files. This is where the date-time stamped files come in handy for reference.

This solution offers a level of customization that I think most Enterprise solutions will need and I found that it works very effectively for me. FTP servers are secure and reliable as far as file downloads are involved. You can find a lot of FTP download helper library on the internet so its a matter of making work the way you want and not worry too much about how it works.

Tri Q