Captcha

Navigation:  »No topics above this level«

Captcha

Previous pageReturn to chapter overviewNext page

The CAPTCHA is a feature intended to distinguish human from machine input and protect websites from the spam and different types of automated abuse. Imunify360 uses reCAPTCHA service.

 

There are two layers in CAPTCHA behavior:

 

1. If a user of a website is added to the Grey List (the access is blocked), then the CAPTCHA allows him to unblock himself. When he tries to get to the website he is redirected to the Captcha Server by ipset, where he can see the protection page asking to confirm that he is not a robot by ticking a checkbox.

 

captcha

Note. The IP address on the screenshot above is given as an example.

 

If successful, a user is redirected to the website, which means that the access is unblocked and the IP address of this user is removed from the Grey List.

 

It is also possible to enable the invisible reCAPTCHA via the Imunify360 Settings page. With the invisible reCAPTCHA enabled, a human user is not required to go through human confirmation - the process will pass under the hood and a user will be redirected to the website. In case if invisible reCAPTCHA failed to detect if a user is a human or not, then visible reCAPTCHA appears.

 

2. The CAPTCHA is always on guard of the websites and checks the activity of each IP. With the help of reCAPTCHA it blocks bots and protects websites from spam and abuse. To learn more about reCAPTCHA follow the link.

 

The reCaptcha supports localization. Depending on user’s browser settings, reCaptcha will use the browser default language and allow to change it:

 

local

 

Captcha page customization

 

To modify footer, header or body of the CAPTCHA use the templates in /var/imunify360/www/captcha/templates/.

 

There are three files:

 

head.tpl - this file goes inside <head></head> tags. So you can add JavaScript, CSS styles, etc.

 

body.tpl - main template file, modify it as you wish. CAPTCHA goes above all the layers.

 

static: here you can place images, CSS, JavaScript, etc. and access these files as /static/<filename>.

 

To find information on supported browsers follow the link - https://support.google.com/recaptcha/answer/6223828.

 

Update Captcha localizations

 

[Custom Captcha localization is available since Imunify360 version 2.6.0 and later.]

 

To change the text of the Imunify360 Captcha and update a localizations text, please do the following:

 

1.Locate Captcha localization files by running:

 

ls /var/imunify360/www/captcha/translations/locale/*/LC_MESSAGES/messages.po

 

2. Update Captcha localization files by editing msgstr “my customization or translation” for appropriate msgid “original plain english text”.

 

Where msgstr contains text that is shown to user and msgid contains Captcha original English text.

 

For example:

 

#: templates/index.html:154

msgid ""

"We have noticed an unusual activity from your <b>IP {client_ip}</b> and "

"blocked access to this website."

msgstr ""

"Zauważyliśmy nietypową aktywność związaną z twoim adresem <b>IP "

"{client_ip}</b> i zablokowaliśmy dostęp do tej strony internetowej"

 

3. To add Polish translation edit text in the msgstr field. To change the text for default English translation, edit text in the msgid field.

4. Save files.

5. When translation in messages.po files is finished, run the following command to compile new catalogs to let Captcha use them.

 

imunify360-agent captcha compile-localizations

 

6. Block yourself (remove your IP from Imunify360 White List and try to log in to the server via ssh with wrong password until it blocks you). Then go to website and log in. Captcha should appear. Set Polish language and assert that new text is displayed.