Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Securing a Web Service

I have a Web Service (ASMX) with a few Web methods on our production Web server. On a separate internal Web server (which isn't publicly exposed) I have another Web site that will use the ASMX's public web methods. What are some of the best ways to secure the Web service such that only the internal Web server can access the Web Services running on the publicly exposed Web server?

like image 836
Bullines Avatar asked Sep 23 '08 13:09

Bullines


4 Answers

One of the easiest ways is to pass credentials in the soap header of the message. So each call passes along the info needed to determine if the user is authorized. WSE makes some of that easier but one of the most succinct descriptions of this process can be found in Rocky Lhotka's book on Business Objects. I get a lot of books to review by publishers and this one had the best explanation

like image 118
Thomas Wagner Avatar answered Oct 25 '22 00:10

Thomas Wagner


Assuming you don't have the option of using WCF, I'd advocate using WSE 3 (Web Service Enhancements). You can get the toolkit / SDK thingummy at MS's site

To limit the access to only internal machines (as I think your question asked), I'd set up a separate web site in IIS and set it to only respond to the internal IP address of your server.

like image 25
ZombieSheep Avatar answered Oct 25 '22 01:10

ZombieSheep


I would set a firewall rule to restrict access to a whitelist of IP addresses.

like image 30
RB. Avatar answered Oct 25 '22 00:10

RB.


Use IIS's directory security IP address restrictions, and limit access to just that internal web server IP address.

If you can't do that then, and you can't setup a username/password on the directory, then use WSE and add a username/password into the service, or look at certificates if you want some fun grin

like image 42
blowdart Avatar answered Oct 25 '22 00:10

blowdart