Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Getting Started

This is a crisp and precise integration guide that will facilitate the integration of ShieldSquare - Real-time Bot Management Solution for Web Apps, Mobile & APIs at the application level using our Ruby on Rails SDK. Please login and download the connectors from here

Info

Prerequisites

Ruby version >=2.0andRails>=3

Integrating ShieldSquare in Monitor Mode

...

Example :If your server is located in the US, config.ss2_domain = 'ss_scus.shieldsquare.net';

Info

Note

: Add the below line to the above configuration file for backward compatibility. If you are a new customer, ignore this line.
config.js_url='/getData'

...

Parameter

Description

Type

Required

_sid

This holds the subscriber id of the user , and can be obtained by clicking on the Subscriber id details link on the dashboard. Choose Sandbox Id as you are integrating for the very first time

Important Note: Sandbox ID is meant for only testing and verification purposes and requests sent using this ID will not be persisted by ShieldSquare Service.

Alphanumeric

Yes

_mode

Sets the mode of the operation depending on the mode of activation. Set value to ‘Monitor’ in this case.

String

Yes

_async_http_post

This Boolean parameter is used to post the data asynchronously. In the Monitor mode, this has to be set as ‘true’.

Boolean

Yes

_timeout_value

This parameter indicates the time limit after which an API call has to be timed out. No synchronous API call would block for more than the value specified to this parameter.

Important Note: To know the optimum value to be set as timeout, run this jar file on your server and note the value. Refer to the guide for detailed steps to achieve the same.Download the ‘jar’ file.The jar may take about 15 minutes to run before it gives an output.

A numeric value (measured in milliseconds)

Yes

_ipaddress

This is set to the HTTP header which indicates the IP address of the user. The default value is “auto”.

String

Yes

_js_url

Set the _js_url to relative URL at which the “getData” file has been placed on the site. This file will collect the JavaScript data send it to the ShieldSquare site. You can find the getData file in the downloaded connector folder.

Quick Tip: TheRelative path of “www.example.com/ShieldSquare/getData” is “/ShieldSquare/getData”. The simplest solution to work around this complexity is to place all the connector files in the root folder and set the _js_url parameter to “/getData”.

Important Note: This parameter is only used for backward compatibility. Kindly ignore.

String

Yes

_ss2_domain

Select the ShieldSquare server closest to the website’s website's server and assign it to the _ss2_domain property. Available options are:

US – ss_scus.shieldsquare.net

Quick Tip:To help you find out our nearest servers use thisJar file.For other locations, refer to this Link.For further assistance, please reach us at support@shieldsquare botmanager_support@radware.com

String

Yes

_domain_cache_file

This parameter is the path to a cache file which stores the resolved IP of the _ss2_domain. The default path is "/tmp/"

Important Note: To use this feature your application server [Apache/Nginx] should have write access to the folder specified above.

String

No

_domain_ttl

This parameter indicates the time after which _domain_cache_file is reloaded. The default time is 3600 seconds

Important Note: To disable the caching feature, set the value as -1

Numeric value (measured in seconds)

No

_deployment_number

Identifier denoting different families of configuration settings in your servers

String

Yes

...

0

This indicates that the request should be allowed.This is the default response for monitor mode.

-1

Indicates that the ShieldSquare service is facing issues . The request should be allowed in case this response code is received. For eg. this response code will be returned in case a timeout occurs.

Info

Note

A response code of -1 is usually received when a server timeout occurs.

...

  • Go to 'Download Connectors' page and switch to 'JS Tag' tab to find your customized JS.

  • Integrate the JS in the starting of head section of web pages protected by ShieldSquare to ensure JS Tag executes immediately after the page loads. This will facilitate ShieldSquare to catch sophisticated bots. 

Info

Note

Both the aforementioned code snippets (API & JS) need to be executed from the every page of the website. It is therefore mandatory to include both the snippets in the common header file.

Verify Integration

Visit the verify integration page in the ShieldSquare Admin Portal and green check marks for "API Data - IP Details" & "API Data - Session Details" will indicate the successful integration of ShieldSquare with your website. A minimum of 5 requests have to be made from the same machine using the same browser for the check marks to appear as an indication to the status of integration. In the event of a Red check mark, it indicates that a particular step might have been executed incorrectly.

Info

Note

The verification will only be successful when the Sandbox ID is assigned in the ss2_config.rb file. Post successful verification, it is strongly recommended that you share the ss2_config.rb file with ShieldSquare Support

...

Code Block
languageruby
config.sid = “Your Production ID”
config.mode = “Monitor”
config.async_http_post = true
config.timeout_value = 100
config._ipaddr = "auto"
config.ss2_domain = 'ss_sa.shieldsquare.net'
config.domain_ttl = 3600
config.domain_cache_file = '/tmp/'
config.deployment_number = '1234'
Info

Note

: The ShieldSquare Dashboard will not populate data if the Sandbox ID is used.

...