Secure website using web.config

I want to secure my web app using web.config.

I've been all over the web and tried it all.

It's time for the experts.

My web.config:

<configuration>
   
 
  <system.web>
    <compilation debug="true" targetFramework="4.5" />
    <httpRuntime targetFramework="4.5" />

  </system.web>

  <connectionStrings>
  <add connectionString="data source=174.37.215.82;UID=pfcu;PWD=betterbank;initial catalog=pfcu" providerName="System.Data.SqlClient" name="Sitefinity" />
    <!--<add connectionString="data source=DEVELOPMENT7\PFCU;UID=sa;PWD=1946isaac;initial catalog=pfcu" providerName="System.Data.SqlClient"  name="Sitefinity" />-->
      </connectionStrings>
    <system.webServer>
        <defaultDocument>
            <files>
                <add value="RatesSelector.aspx" />
            </files>
        </defaultDocument>
      <security>
        <ipSecurity allowUnlisted="false">
          <!-- this line blocks everybody, except those listed below -->
          <clear />
          <!-- removes all upstream restrictions -->
          <add ipAddress="127.0.0.1" allowed="true" />
          <!-- allow requests from the local machine -->
          <add ipAddress="83.116.19.53" allowed="true" />
          <!-- allow the specific IP of 83.116.19.53  -->
          <add ipAddress="83.116.119.0" subnetMask="255.255.255.0" allowed="true" />
          <!--allow network 83.116.119.0 to 83.116.119.255-->
          <add ipAddress="83.116.0.0" subnetMask="255.255.0.0" allowed="true" />
          <!--allow network 83.116.0.0 to 83.116.255.255-->
          <add ipAddress="83.0.0.0" subnetMask="255.0.0.0" allowed="true" />
          <!--allow entire /8 network of 83.0.0.0 to 83.255.255.255-->
        </ipSecurity>
        <authentication>
          <basicAuthentication enabled="true" />
        </authentication>
      </security>
      <modules runAllManagedModulesForAllRequests="true" />
    </system.webServer>
 
</configuration>
The error is attached.  Is there any other method I can use using c#
Under the gun

Thanks,
Isaac
securityerror.png
TechIsaacIT Contracting Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Randy DownsOWNERCommented:
Maybe this will help

You cannot do it in the website web.config only.

If you can use IIS manager: Open IIS Manager, locate the site, click on the folder you want to protect, then click on IP address and Domain Restrinctions.

Also click on "Edit feature settings" in the right Actions panel" to specify actions for unspecified clients (i.e. Deny with Forbidden, or simply Deny With Not Found).

This will generate the right configuration for you.
0
Bob LearnedCommented:
Maybe being secure would mean not publishing your IP addresses on the public Internet...
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.