Search code examples
asp.netweb-configipkenticowhitelist

Whitelist admin section of Kentico


I don't like the world seeing the admin interface of my Kentico site. Kentico allows you to create a new folder for admin pages but the existing folder is still there and its pages still accessible. I want to whitelist the admin folder by IP.


Solution

  • Add the following section to your web.config. This enables an IP whitelist for the admin folder. More details here.

      <location path="Admin">
        <system.webServer>
          <security>        
            <ipSecurity allowUnlisted="false" denyAction="NotFound">
              <clear />
              <add allowed="true" subnetMask="255.255.255.255" ipAddress="987.654.321.012" /> <!-- add your IP here -->
            </ipSecurity>
          </security>
        </system.webServer>
      </location>