Difference between revisions of "Content modifier"
en>Srinivas12 |
|||
(5 intermediate revisions by 2 users not shown) | |||
Line 8: | Line 8: | ||
{| border="0" cellpadding="1" cellspacing="1" style="width: 100%" | {| border="0" cellpadding="1" cellspacing="1" style="width: 100%" | ||
|- | |- | ||
| style="width: 1003px" | | | style="width: 1003px" | | ||
= Enabling Content modifier section on SafeSquid User Interface = | = Enabling Content modifier section on SafeSquid User Interface = | ||
== <span class="mw-headline" id="Access_the_SafeSquid_interface">[ | == <span class="mw-headline" id="Access_the_SafeSquid_interface">[https://docs.safesquid.com/wiki/Access_The_SafeSquid_User_Interface Access the SafeSquid interface]</span> == | ||
| style="width: 261px" | | | style="width: 261px" | | ||
Line 135: | Line 135: | ||
*'''CLIENT :''' Rewrite the client header, this happens before Middleaman parses it so be careful not to remove any headers needed to handle the request properly. | *'''CLIENT :''' Rewrite the client header, this happens before Middleaman parses it so be careful not to remove any headers needed to handle the request properly. | ||
*'''SERVER : '''Rewrite the header from the remote web server, same conditions from client header apply. | *'''SERVER : '''Rewrite the header from the remote web server, same conditions from client header apply. | ||
*'''POST : '''Rewrite POST/PUT data sent when submitting a form or uploading a file. | *'''POST : '''Rewrite POST/PUT data sent when submitting a form or uploading a file. | ||
== Example == | |||
'''Rule#1''' | |||
I want to modify title tag of webpages which will indicate that it has been this webpage is inspected by SafeSquid. | |||
This rule is to be applied to every connection. | |||
To ensure the title tag is modified the chunked response needs to buffered. | |||
Using regex (Regular Expression) we can use pattern matching to select the title tag of webpages. | |||
Replace with the title tag Inspected by SafeSquid. | |||
[[File:Presentation1-cntInspection.png|left]] | |||
'''Rule#2''' | |||
We want to request PNG & JPG images instead of AVIF & WEBP from remote server. | |||
AVIF images and ignore by SafeSquid’s image analyzer. | |||
Using regex (Regular Expression) we can use pattern matching to select the header request sent from client to SafeSquid. | |||
Modify the header response and request for PNG & JPG image instead of AVIF & WEBP | |||
[[File:Slide2-cntInspection.png|left]] | |||
[[File:Slide3-cntInspection.png|left]] | |||
= Follow below link for more understanding = | = Follow below link for more understanding = |
Latest revision as of 19:22, 4 January 2023
Overview
Use 'Content modifier' to remove or modify contents like AcitveX, JavaScript, Cookies from selected websites.
It enables you to modify the contents of web pages, files, the client header, and server header in real time.
Enabling Content modifier section on SafeSquid User InterfaceAccess the SafeSquid interface |
|
Go to Configure Page |
|
Go to Real time content security |
|
Go to Content modifier section |
|
GlobalEnabledEnable or Disable this section.
|
|
|
|
Rewriting Policies |
|
List of regular expression substitutions to apply to matching files.
EnabledEnable or Disable this Entry.
CommentFor documentation, and future references, explainthe relevance of this entry with your policies. That is, by reading the policies, a future user can understand the purpose of that entry. ProfilesSpecify the Profiles applicable for this entry. This entry will be applicable only if the connection has any one of the specified profiles. Leave it Blank, to apply for all connections irrespective of any applied profile. To avoid application to a connection that has a profile, use negated profile (!profile). Mime typeSpecify regular expression matching the MIME-type's for which this entry is applicable. According to their nature and format, MIME-type is a way of identifying files on the Internet. It is highly advisable that you set this to some mime-type; otherwise all files will be checked. Example: text/html, ^image/, ^application/, application/x-shockwave-flash. PatternA regular expression pattern matching the area of text inside the file, 'to modify'. This may be trailed with a '/' followed by flag characters like in Perl to modify options used to compile the regular expression, and must be if a '/' is used anywhere else in the regular expression. ReplaceSpecify the replacement text to use in place of the area of text matching the pattern mentioned in the above field. It may contain back references to strings captured using parenthesis in the pattern. Applies toThis option is to select what the rewrite entry applies to.
ExampleRule#1 I want to modify title tag of webpages which will indicate that it has been this webpage is inspected by SafeSquid. This rule is to be applied to every connection. To ensure the title tag is modified the chunked response needs to buffered. Using regex (Regular Expression) we can use pattern matching to select the title tag of webpages. Replace with the title tag Inspected by SafeSquid. Rule#2 We want to request PNG & JPG images instead of AVIF & WEBP from remote server. AVIF images and ignore by SafeSquid’s image analyzer. Using regex (Regular Expression) we can use pattern matching to select the header request sent from client to SafeSquid. Modify the header response and request for PNG & JPG image instead of AVIF & WEBP Follow below link for more understandingHow to block particular user login to Facebook or Gmail |