Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Lock down a web site's allowable IP range to just one IP address [modified]

Lock down a web site's allowable IP range to just one IP address [modified]

Scheduled Pinned Locked Moved ASP.NET
csharpapacheasp-netsysadminwindows-admin
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jpang001
    wrote on last edited by
    #1

    I’m developing a .NET/C# application software for an instrument which has a built-in PC (Core 2 CPU/2.66GZ/4GB RAM) and will have access to the Internet from behind the facility IT firewall. To support remote device maintenance via Intetnet using browser, I want to run a web site locally IIS hosted on the instrument PC. Apparently, this site is for authorized user only (could be anywhere on the Inernet). I know security is the major problem to deal with in this scenario. To reduce the surface of attach, can I lock down the allowable IP range to just one IP address where the service user is? This one IP address will be made configurable. Is this a viable approach to secure the web site with the least cost? Just googled that .htaccess file can be created in webroot to block IP ranges. Will this still allow scripts to access the site Sorry, .htaccess is available on Apache server only. What's equivalent on IIS?

    modified on Saturday, June 19, 2010 10:19 PM

    D 1 Reply Last reply
    0
    • J jpang001

      I’m developing a .NET/C# application software for an instrument which has a built-in PC (Core 2 CPU/2.66GZ/4GB RAM) and will have access to the Internet from behind the facility IT firewall. To support remote device maintenance via Intetnet using browser, I want to run a web site locally IIS hosted on the instrument PC. Apparently, this site is for authorized user only (could be anywhere on the Inernet). I know security is the major problem to deal with in this scenario. To reduce the surface of attach, can I lock down the allowable IP range to just one IP address where the service user is? This one IP address will be made configurable. Is this a viable approach to secure the web site with the least cost? Just googled that .htaccess file can be created in webroot to block IP ranges. Will this still allow scripts to access the site Sorry, .htaccess is available on Apache server only. What's equivalent on IIS?

      modified on Saturday, June 19, 2010 10:19 PM

      D Offline
      D Offline
      DaveAuld
      wrote on last edited by
      #2

      From IIS Manager; (This sequence is 2003 Server, but dare say others are similiar) 1) Right Click the Web Site and choose Properties 2) Select the Directory Security Tab 3) Click Edit in the IP Address and Domanin Name restrictions panel 4) Grant/Deny relevant domains/ip as required.

      Dave Don't forget to rate messages!
      Find Me On: Web|Facebook|Twitter|LinkedIn
      Waving? dave.m.auld[at]googlewave.com

      J 1 Reply Last reply
      0
      • D DaveAuld

        From IIS Manager; (This sequence is 2003 Server, but dare say others are similiar) 1) Right Click the Web Site and choose Properties 2) Select the Directory Security Tab 3) Click Edit in the IP Address and Domanin Name restrictions panel 4) Grant/Deny relevant domains/ip as required.

        Dave Don't forget to rate messages!
        Find Me On: Web|Facebook|Twitter|LinkedIn
        Waving? dave.m.auld[at]googlewave.com

        J Offline
        J Offline
        jpang001
        wrote on last edited by
        #3

        Is it possible to do it in code? e.g. after receiving an allowable IP address, place it somewhere in a config file?

        D D 2 Replies Last reply
        0
        • J jpang001

          Is it possible to do it in code? e.g. after receiving an allowable IP address, place it somewhere in a config file?

          D Offline
          D Offline
          Dimitri Witkowski
          wrote on last edited by
          #4

          Yeah, it's possible to do in code using WMI, you can read here[^] how to do it. You should change binding for the application.

          Die Energie der Welt ist konstant. Die Entropie der Welt strebt einem Maximum zu.

          1 Reply Last reply
          0
          • J jpang001

            Is it possible to do it in code? e.g. after receiving an allowable IP address, place it somewhere in a config file?

            D Offline
            D Offline
            DaveAuld
            wrote on last edited by
            #5

            yes, see this article on CP; Using ASP.NET HTTP Modules to restrict access by IP address[^] [edit: changed icon to answer]

            Dave Don't forget to rate messages!
            Find Me On: Web|Facebook|Twitter|LinkedIn
            Waving? dave.m.auld[at]googlewave.com

            modified on Sunday, June 20, 2010 10:43 AM

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups