How to block accessing the application using IP Address?

How to block accessing the application using IP Address?

To achieve this, we used tuckey url rewrite framework to block the IP based access. The framework is already bundled in our application.

Follow the below steps to block the IP based access,
      Assume ServiceDesk Plus server's IP address is "101.102.103.104"

Step 1 : Download the attached urlrewrite.xml file.

Step 2 : Open the urlrewrite.xml file under <SDP Home>\webapps\ROOT\WEB-INF folder. Don't modify the existing content. Copy the rule tags from attached urlrewrite.xml and paste those contents in urlrewrite.xml in last (before </urlrewrite.xml> line).
     NOTE: If the urlrewrite.xml file is not exists, 
Save the attached urlrewrite.xml file under <SDP Home>\webapps\ROOT\WEB-INF directory.

Step 3:  Replace the "101.102.103.104" IP address with ServiceDesk application installed server's IP address. Also don't remove the special chars added back and forth of IP Address.



Step 4 : Replace the acme.com with domain name used to access the ServiceDesk Plus application.



Step 5 :  Open the web.xml file under <SDP Home>\webapps\ROOT\WEB-INF folder. Add or edit (if exists) the below filter-mapping details in web.xml in all the below context folders. This filter must added after SDPSecurityFilter.

<filter>
<filter-name>UrlRewriteFilter</filter-name>
<filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
</filter>

<filter-mapping>
<filter-name>UrlRewriteFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>


NOTE: If filter mapping exists, the url-pattern (<url-pattern>/portal/*</url-pattern>) will be different and no dispatchers.

Step 6 :
      (1)  Need to copy and paste the current edited urlrewrite.xml to below context folder.
      (2)  Copy the filter contents from Step 5 and paste into the web.xml in below all context folder.
All Contexts :
  1. under webapps/ROOT/WEB-INF/    (already done)
  2. under webapps/sd/WEB-INF/
  3. under webapps/mc/WEB-INF/
  4. under logs/WEB-INF/
  5. under integration/resources/WEB-INF/
  6. under inlineimages/WEB-INF/
  7. under fos/WEB-INF/
  8. under custom/WEB-INF/

Step 7 : Restart the ServiceDesk Plus application server.

                  New to ADSelfService Plus?

                    • Related Articles

                    • How to start ServiceDesk Plus on a single IP address/IP Binding

                      For customers running version 9.3 and below. 1. Goto Drive:\ManageEngine\ServiceDesk\server\default\conf\TrayIconInfo.xml and add "ipToBind" parameter to the following line:  <SDP-PROPERTIES RequestScheme="http" WebPort="8080"/>  Now the line would ...
                    • Block attachments from specific IP Address

                      Requirement: In few organisations, certain IP Address are refrained from creating requests with attachments. Steps to configure: Goto Admin > Developer Space > Request Custom Functions > Global function > New > Paste the content from the ...
                    • Query to show to Assets with their IP and MAC Address (MSSQL & PGSQL)

                      Tested in Build PGSQL (14300) or MSSQL (14306) SELECT productType.COMPONENTTYPENAME AS "Product Type", resource.RESOURCENAME AS "Asset Name", networkinfo.IPADDRESS "IP Address", networkinfo.macaddress "MAC Address", product.COMPONENTNAME AS ...
                    • Fix: Failed to parse To/Cc address while fetching mails using Graph

                      Issue: If the To / Cc address contains the email address in the format "Test, SDP" <test@sdp.com> (containing "," character in the email address itself), then parsing of such addresses using Microsoft Graph fails in SDP. If such address is a support ...
                    • Block attachments from certain IP Range

                      Requirement: In few organisations, certain IP Ranges are refrained from creating requests with attachments. Steps to configure: Goto Admin > Developer Space > Request Custom Functions > Global function > New > Paste the content from the attachment ...