eigene Templates anlegen

Ein Forum für Leitfäden rund um Securepoint und verwandte Themen. Beachten Sie, dass dies kein Support-Forum ist.

Moderator: Securepoint

Antworten
philipp
Beiträge: 119
Registriert: Mi 07.02.2007, 15:44
Kontaktdaten:

eigene Templates anlegen

Beitrag von philipp »

Wenn man bestimmte Dateien abändern möchte, diese jedoch noch nicht als Template existieren, können auch eigene Templates angelegt werden. Als Beispiel wird hier die Änderung einer "Errorseite" vom Squid gezeigt.

Die Webseite, die der Squid anzeigt, wenn eine Seite über die URL gesperrt wurde generiert das Programm aus der Datei /etc/squid/errors/ERR_ACCESS_DENIED
Für diese Datei legen wir nun ein Template an:

Code: Alles auswählen

add extc_template http_proxy /etc/squid/errors/ERR_ACCESS_DENIED
danach wird das Template einfach eingefügt:

Code: Alles auswählen

#HDR:APP http_proxy
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <title>Securepoint Error Message - Cache Access Denied</title>
  <style type="text/css">
* {
        margin: 0;
        padding: 0;
}

  body             {font-weight:normal; font-size:10px; color:#000000; font-family:Verdana, Arial, sans-serif}


  .normal          {font-weight:normal; font-size:10px; color:#000000; font-family:Verdana, Arial, sans-serif}
  .normalbold      {font-weight:bold; font-size:10px; color:#000000; font-family:Verdana, Arial, sans-serif}
  .normalboldred   {font-weight:bold; font-size:10px; color:#ff0000; font-family:Verdana, Arial, sans-serif}
  .denied          {font-weight:bold; font-size:28px; color:red; font-family:Verdana, Arial, sans-serif}

  </style>

</head>
<body bgcolor=#ffffff marginheight=0 marginwidth=0 topmargin=0 leftmargin=0>
<center>




<table border=0 cellspacing=0 cellpadding=0 width=700>
<tr>
  <td bgcolor=#FFFACD height=1 align=center class=normal><hr></td>
</tr>
<tr>
  <td bgcolor=#FEA700 height=100 align=center class=denied>ERROR: Access Denied</td>
</tr>
<tr>
  <td bgcolor=#FFFACD height=1 align=center class=normal><hr></td>
</tr>
<tr>
  <td bgcolor=#FFFACD height=20 align=center class=normal></td>
</tr>
<tr>
  <td bgcolor=#FFFACD height=40 align=center class=normal>While trying to retrieve the URL:</td>
</tr>
<tr>
  <td bgcolor=#FFFACD height=40 align=center class=normal><a href="%U" target="_blank" class=normalboldred>%U</a></td>
</tr>
<tr>
  <td bgcolor=#FFFACD height=40 align=center class=normal>The following error was encountered:</td>
</tr>
<tr>
  <td bgcolor=#FFFACD height=40 align=center class=normalbold>Access Denied</td>
</tr>
<tr>
  <td bgcolor=#FFFACD height=100 align=center class=normal>
    Access control configuration prevents your request from being allowed at this time. 
Please contact your service provider if you feel this is incorrect.
    Your cache administrator is <a href="mailto:%w" class=normalbold>%w</a>.
        


  </td>
</tr>
<tr>
  <td bgcolor=#FFFACD height=1 align=center class=normal><hr></td>
</tr>
<tr>
  <td bgcolor=#DDDDDD align=center class=normal>
Securepoint GmbH, Salzstrasse 1, 21335 Lueneburg, Germany,
 Email: <a href="mailto:info@securepoint.cc" class=normal>info@securepoint.cc</a>,
 Internet: <a href="http://www.securepoint.cc/" target=_blank class=normal>http://www.securepoint.cc/</a>

</td>
  </tr>
<tr>
  <td bgcolor=#FFFACD height=1 align=center class=normal><hr></td>
</tr>
</table>




mit der Eingabe von "**" wird das Template gespeichert. Um das Template zu aktivieren, muss der HTTP_Proxy neu gestartet werden.

Code: Alles auswählen

restart application SERVICE_HTTP_PROXY
Genauso kann z.B. auch mit den Templates vom Dansguardian umgegangen werden.

Das Speichern der Konfiguration nicht vergessen!
Zuletzt geändert von philipp am So 31.01.2010, 11:21, insgesamt 1-mal geändert.

carsten
Beiträge: 644
Registriert: Fr 05.10.2007, 12:56

Beitrag von carsten »

Um alle Fehlermeldungen im Squid zu ändern, müssen auch Anpassungen an allen Fehlermeldungen vorgenommen werden.

Dazu wird ein root Account benötigt

Code: Alles auswählen

ls -l /etc/squid/errors

Code: Alles auswählen

total 120
-rw-r--r-- 1 root root 2623 Feb  5 10:50 ERR_ACCESS_DENIED
-rw-r--r-- 1 root root 2887 Feb  4 09:53 ERR_CACHE_ACCESS_DENIED
-rw-r--r-- 1 root root 3011 Feb  4 09:53 ERR_CACHE_MGR_ACCESS_DENIED
-rw-r--r-- 1 root root 2947 Feb  4 09:53 ERR_CANNOT_FORWARD
-rw-r--r-- 1 root root 2708 Feb  4 09:53 ERR_CONNECT_FAIL
-rw-r--r-- 1 root root 2775 Feb  4 09:53 ERR_DNS_FAIL
-rw-r--r-- 1 root root 2745 Feb  4 09:53 ERR_FORWARDING_DENIED
-rw-r--r-- 1 root root 2611 Feb  4 09:53 ERR_FTP_DISABLED
-rw-r--r-- 1 root root 2653 Feb  4 09:53 ERR_FTP_FAILURE
-rw-r--r-- 1 root root 2630 Feb  4 09:53 ERR_FTP_FORBIDDEN
-rw-r--r-- 1 root root 2798 Feb  4 09:53 ERR_FTP_NOT_FOUND
-rw-r--r-- 1 root root 2284 Feb  4 09:53 ERR_FTP_PUT_CREATED
-rw-r--r-- 1 root root 2790 Feb  4 09:53 ERR_FTP_PUT_ERROR
-rw-r--r-- 1 root root 2284 Feb  4 09:53 ERR_FTP_PUT_MODIFIED
-rw-r--r-- 1 root root 2548 Feb  4 09:53 ERR_FTP_UNAVAILABLE
-rw-r--r-- 1 root root 2851 Feb  4 09:53 ERR_INVALID_REQ
-rw-r--r-- 1 root root 2853 Feb  4 09:53 ERR_INVALID_RESP
-rw-r--r-- 1 root root 2868 Feb  4 09:53 ERR_INVALID_URL
-rw-r--r-- 1 root root 2701 Feb  4 09:53 ERR_LIFETIME_EXP
-rw-r--r-- 1 root root 2629 Feb  4 09:53 ERR_NO_RELAY
-rw-r--r-- 1 root root 2910 Feb  4 09:53 ERR_ONLY_IF_CACHED_MISS
-rw-r--r-- 1 root root 2706 Feb  4 09:53 ERR_READ_ERROR
-rw-r--r-- 1 root root 2757 Feb  4 09:53 ERR_READ_TIMEOUT
-rw-r--r-- 1 root root 2611 Feb  4 09:53 ERR_SHUTTING_DOWN
-rw-r--r-- 1 root root 2730 Feb  4 09:53 ERR_SOCKET_FAILURE
-rw-r--r-- 1 root root 2973 Feb  4 09:53 ERR_TOO_BIG
-rw-r--r-- 1 root root 2749 Feb  4 09:53 ERR_UNSUP_REQ
-rw-r--r-- 1 root root 2624 Feb  4 09:53 ERR_URN_RESOLVE
-rw-r--r-- 1 root root 2693 Feb  4 09:53 ERR_WRITE_ERROR
-rw-r--r-- 1 root root 2642 Feb  4 09:53 ERR_ZERO_SIZE_OBJECT
Über den Befehl "cat dateiname" können Sie sich den Inhalt anzeigen lassen, dann in ein Texteditor kopieren und bearbeiten. Um alle Seiten anzupassen verfahren Sie wie Oben!
Zuletzt geändert von carsten am Di 05.02.2008, 15:15, insgesamt 1-mal geändert.
There are 10 types of people in the world... those who understand binary and those who don\'t.

carsten
Beiträge: 644
Registriert: Fr 05.10.2007, 12:56

Beitrag von carsten »

Der Squid arbeitet eng mit dem Dasguardian zusammen. Beide erfüllen unterschiedliche Aufgaben und geben auch unterschiedliche Fehlermeldungen zurück!

Um auch die Fehlermeldungen im dansguardian zu ändern führen Sie bitte das Folgende aus:

Code: Alles auswählen

add extc_template http_proxy /etc/dansguardian/languages/ukenglish/template.html 
Fügen Sie ihr Template ein z.B.:

Code: Alles auswählen

<html>
<head>
  <title>Securepoint - Access Denied</title>
  <style type="text/css">
* {
	margin: 0;
	padding: 0;
}

  .normal          {font-weight:normal; font-size:10px; color:#000000; font-family:Verdana, Arial, sans-serif}
  .normalbold      {font-weight:bold; font-size:10px; color:#000000; font-family:Verdana, Arial, sans-serif}
  .normalboldred   {font-weight:bold; font-size:10px; color:#ff0000; font-family:Verdana, Arial, sans-serif}
  .denied          {font-weight:bold; font-size:28px; color:red; font-family:Verdana, Arial, sans-serif}

  </style>

</head>
<body bgcolor=#ffffff marginheight=0 marginwidth=0 topmargin=0 leftmargin=0>
<center>




<table border=0 cellspacing=0 cellpadding=0 width=700>
<tr>
  <td bgcolor=#FFFACD height=1 align=center class=normal><hr></td>
</tr>
<tr>
  <td bgcolor=#FEA700 height=100 align=center class=denied>Access has been Denied!</td>
</tr>
<tr>
  <td bgcolor=#FFFACD height=1 align=center class=normal><hr></td>
</tr>
<tr>
  <td bgcolor=#FFFACD height=20 align=center class=normal></td>
</tr>
<tr>
  <td bgcolor=#FFFACD height=40 align=center class=normalbold>-USER- </td>
</tr>
<tr>
  <td bgcolor=#FFFACD height=40 align=center class=normal>Access to the page:</td>
</tr>
<tr>
  <td bgcolor=#FFFACD height=40 align=center class=normal><a href="-URL-" target="_blank" class=normalboldred>-URL-</a></td>
</tr>
<tr>
  <td bgcolor=#FFFACD height=40 align=center class=normal>... has been denied for the following reason:</td>
</tr>
<tr>
  <td bgcolor=#FFFACD height=40 align=center class=normalbold>-REASONGIVEN-</td>
</tr>
<tr>
  <td bgcolor=#FFFACD height=100 align=center class=normal>
	You are seeing this error because what you attempted to access appears to contain,
	or is labeled as containing, material that has been deemed inappropriate.
	


	If you have any queries contact your Network Manager or Administrator.
	


  </td>
</tr>
<tr>
  <td bgcolor=#FFFACD height=1 align=center class=normal><hr></td>
</tr>
<tr>
  <td bgcolor=#DDDDDD align=center class=normal>
Securepoint GmbH, Salzstrasse 1, 21335 Lueneburg, Germany,
 Email: <a href="mailto:info@securepoint.cc" class=normal>info@securepoint.cc</a>
, Internet: <a href="http://www.securepoint.cc/" target=_blank class=normal>http://www.securepoint.cc/</a>

</td>
</tr>
<tr>
  <td bgcolor=#FFFACD height=1 align=center class=normal><hr></td>
</tr>
</table>
</center>
</body>
</html>
Aktion abschließen: "return" "**" "return"

Jetzt können Sie noch die Fehlermeldungen Anpassen!

Code: Alles auswählen

add extc_template http_proxy /etc/dansguardian/languages/ukenglish/messages
Fügen Sie das Template wieder ein:

Code: Alles auswählen

# DansGuardian 2.8 messages file in UK English

"1","Access Denied"

"100","Your IP address is not allowed to web browse: "
"101","Your IP address is not allowed to web browse."
"102","Your username is not allowed to web browse: "

"200","The requested URL is malformed."

"300","Banned Phrase found: "
"301","Banned phrase found."

"400","Banned combination phrase found: "
"401","Banned combination phrase found."
"402","Weighted phrase limit of "
"403","Weighted phrase limit exceeded."

"500","Banned site: "
"501","Banned URL: "
"502","Blanket Block is active and that site is not on the white or grey list."
"503","Banned Regular Expression URL: "
"504","Banned Regular Expression URL found."
"505","Blanket IP Block is active and that address is an IP only address."

"600","Exception client IP match."
"601","Exception client user match."
"602","Exception site match."
"603","Exception URL match."
"604","Exception phrase found: "
"605","Combination exception phrase found: "
"606","Bypass URL exception."
"607","Bypass cookie exception."

"700","Web upload is banned."
"701","Web upload limit exceeded."

"800","Banned MIME Type: "

"900","Banned extension: "

"1000","PICS labeling level exceeded on the above site."

"1100","Virus infected content found."
Aktion abschließen: "return" "**" "return"

Danach den Proxy neustarten und Speichern (siehe Oben)!
Zuletzt geändert von carsten am So 31.01.2010, 11:20, insgesamt 1-mal geändert.
There are 10 types of people in the world... those who understand binary and those who don\'t.

derandre
Beiträge: 2
Registriert: Fr 24.04.2009, 16:33

Beitrag von derandre »

ein freundliches Hallo,

ich habe folgendes Problem mit dem Anlegen der templates, genauer mit denen des dansguardian

wenn ich da was lt. Eurer Anleitung (siehe zeitlich zweites Posting von Carsten) ändern möchte erhalte ich folgenden Fehler
No such application or template name not unique
Stimmt da vielleicht der pfad /ect/dansguardian/languages/ukenglish nicht (mehr) ?

Beim Anlegen des Template für den Squid gab es keine Probleme


Desweiteren erhalte ich beim Aufruf von ls (siehe zeitlich erstes Posting von Carsten) "Befehl `ls`nicht gefunden"

carsten
Beiträge: 644
Registriert: Fr 05.10.2007, 12:56

Beitrag von carsten »

derandre hat geschrieben: erhalte ich folgenden Fehler
No such application or template name not unique
Hallo,
scheinbar scheint mir da ein kleiner Fehler unterlaufen zu sein und zwar muss die Anwendung natürlich mit angegeben werden:

Code: Alles auswählen

add extc_template http_proxy /etc/pfad_zu_der datei
Haben Sie das "ls" unter dem Benutzer root ausgeführt?
Zuletzt geändert von carsten am Mi 15.07.2009, 17:21, insgesamt 1-mal geändert.
There are 10 types of people in the world... those who understand binary and those who don\'t.

derandre
Beiträge: 2
Registriert: Fr 24.04.2009, 16:33

Beitrag von derandre »

Hallo,

vielen Dank für die prompte Rückmeldung...

ja, kaum macht man´s richtig, schon funktioniert´s :-)
also das mit den templates ist jetz ok

wegen "ls" also ich bin als admin

mfg
der andré

carsten
Beiträge: 644
Registriert: Fr 05.10.2007, 12:56

Beitrag von carsten »

"ls" funktioniert natürlich nur als root unter dem linux nicht als admin auf der cli.
Zuletzt geändert von carsten am Do 16.07.2009, 10:58, insgesamt 1-mal geändert.
There are 10 types of people in the world... those who understand binary and those who don\'t.

N1con
Beiträge: 5
Registriert: Mo 11.01.2010, 22:55

Beitrag von N1con »

TIPP:
wem das in der Konsole zuviel wird kann sich auch per FTP (z.b. FileZilla) auf Port 22(SFTP) mit der Büchse verbinden und dann normal wie FTP down und uploaden und die Dateien im Editor oder sonstwo bearbeiten. Auch hier ist der Root-User Voraussetzung.
Zuletzt geändert von N1con am Sa 30.01.2010, 12:38, insgesamt 1-mal geändert.

Benutzeravatar
Erik
Securepoint
Beiträge: 1480
Registriert: Fr 07.11.2008, 11:50

Beitrag von Erik »

Nur überleben die Änderungen dann keinen Reboot. Dazu müssen Sie entweder die Dateien in /etc.orig ersetzen oder eben die Templates wie oben beschrieben anlegen.

Antworten