User Tools

Site Tools


en:dev:284:security

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:dev:284:security [24.03.2016 19:37] – [System Security] translate first sentence mrbasemanen:dev:284:security [24.03.2016 21:41] (current) – finished translation and removed fixme mrbaseman
Line 1: Line 1:
-FIXME **This page is not fully translated, yet. Please help completing the translation.**\\ //(remove this paragraph once the translation is finished)// 
- 
 ====== System Security ====== ====== System Security ======
 (A whole package of individual elements. From password encryption to measurements to protect against cross-site scripting.) (A whole package of individual elements. From password encryption to measurements to protect against cross-site scripting.)
-===== SecureTokens gegen CrossSiteScripting ===== +===== SecureTokens against CrossSiteScripting ===== 
-Ein wesentlicher Bestandteil zum Schutz gegen CrossSiteScripting ist der Einsatz von Tokens bei der Übermittlung von Formularen und sonstigen Änderungsanforderungen+An essential component to protect against cross-site scripting is the use of tokens in the submission of forms and other change requests
-WebsiteBaker stellt dafür die Klasse **S//ecureTokens//** zur VerfügungDiese Klasse wird grundsätzlich immer automatisch vom Kern geladen und stellt ihre Methoden zur Verfügung. Die Konfiguration der Klasse und auch der Einsatz der Methoden wurde so einfach wie möglich gehalten. +Website Baker is providing the class **S//ecureTokens//**. This class is always loaded automatically by the core and provides its methodsThe configuration of the class and the use of methods has been kept as simple as possible.
-==== Begriffserklärung ==== +
-**//FTAN//** => Dieser Begriff wurde in Anlehnung an die **T**rans**A**ktions**N**ummern beim Onlinebanking gewählt, da auch sie nur für eine einmalige Transaktion innerhalb eines festgelegten Zeitraums gültig sind.\\ +
-Im Unterschied zu der einfachen, 4-stelligen TAN jedoch besteht eine vollständige FTAN aus einem 16-stelligen, alphanumerischen Bezeichner sowie dem zugehörigen, ebenfalls 16-stelligen, alphanumerischen WertSowohl Bezeichner als auch der Wert ändern sich bei jedem Request auf Zufallsbasis+
  
-**//IDKEY//** => Das zweite Standbein der SicherungEr wird hauptsächlich eingesetztum die Datensatz-IDs in Formularen und anderen Requests zu verschleiern. Die ID wird dabei durch einen einmaligen, 16-stelligenalphanumerischen Wert ersetztWird ein gleicher Wert mehrmals verschlüsselt, so bekommt er **immer** einen anderen Ersatzwert. Für jeden Request, für jedes Formular können beliebig viele IDKEYs erzeugt werden. Der IDKEY verhindert z.B. zuverlässig, dass auf Clientseite in einem Änderungsformular die reale DatensatzId vor dem Absenden manipuliert werden kann und dadurch unzulässigerweise ein falscher Datensatz geändert oder gar gelöscht wird.+==== Explanation of terms ==== 
 +**//FTAN//** => This term was chosen based on the **T**rans**A**ctions**N**umbers known from online banking, as they are also valid only for a single transaction within a strictly defined period of time\\ 
 +In contrast to the simple4-digit TAN a full FTAN consists of a 16-digit alphanumeric identifier and the associatedalso 16-digitalphanumeric valueBoth identifiers and the value change at each request on a random basis.
  
-==== Feste Einstellungen ====+**//IDKEY//** =>  The second pillar of the security. It is mainly used to obscure the record IDs in forms and other requests. The ID will be replaced by a unique, 16-digit, alphanumeric value. If the same value is encrypted several times, it **always** obtains a different substitution value. For each request, for each form theoretically an infinite number of IDKEYs can be generated. The IDKEY reliably prevents for instance that on the client side in a change form the real Id of a record can be manipulated before sending and thereby illegally another record would be changed or even deleted.
  
-^ Konstante      ^ Wert ^ Beschreibung                                               ^ +==== Fixed Settings ====
-^ LIFETIME_MIN   | 1800 | Minimale Lebensdauer eines Tokens in Sekunden              | +
-^ LIFETIME_MAX   | 7200 | Maximale Lebensdauer eines Tokens in Sekunden              | +
-^ LIFETIME_STEP  |  900 | Einstellbare Schrittweite zwischen MIN und MAX in Sekunden | +
-^ DEBUG_LIFETIME |  300 | Tokenlebensdauer in Sekunden im DEBUG-Modus                | +
-Die maximale Lebenszeit von Tokens ist auf eine vernünftige, sinnvolle Bearbeitungsdauer eingestellt und sollte auf keinen Fall verlängert werden. Grundsätzlich verfallen auch alle Tokens, wenn die aktuelle Session ihren Timeout erreicht.\\ +
-:!: Je länger die mögliche Bearbeitungszeit wird, desto grösser wird das Risiko einer erfolgreichen Attacke. +
-----+
  
 +^ constant      ^ value ^ description                                                ^
 +^ LIFETIME_MIN   | 1800 | Minimum lifetime of a token in seconds                     |
 +^ LIFETIME_MAX   | 7200 | Maximum lifetime of a token in seconds                     |
 +^ LIFETIME_STEP  |  900 | Adjustable pitch between MIN and MAX in seconds            |
 +^ DEBUG_LIFETIME |  300 | Token lifetime in seconds in DEBUG mode                    |
 +The maximum lifetime of the token is set to a sensible, reasonable processing time and should not be extended under any circumstances. Basically all tokens turn invalid when the current session times out. \\
 +:!: The longer the possible processing time is, the greater is the risk of a successful attack.
 +----
  
 ==== Registry-Settings ==== ==== Registry-Settings ====
-//(Variable Einstellmöglichkeiten)//\\ +//(Variable settings)//\\ 
-Diese vier Werte können im Backend unter //Settings-Sicherheit// eingestellt werden.+These four values can be set in the backend under //Settings security//.
  
 **SecTokenLifeTime**\\ **SecTokenLifeTime**\\
-Die 'Lebensdauervon Tokens kann in Schritten von LIFETIME_STEP-Sekunden von LIFETIME_MIN bis LIFETIME_MAX eingestellt werden.\\ +The 'life timeof tokens can be adjusted in increments of LIFETIME_STEP-seconds of LIFETIME_MIN to LIFETIME_MAX. \\ 
-Die Einstellung erfolgt durch einen entsprechenden Eintrag in der Registry mittels der Settings des Backends.\\ +The adjustment is made by a corresponding entry in the registry using the Settings of the backend. \\ 
-Wird ein negativer Wert (<0) eingegebenso wird der Debug-Modus mit einer Lebensdauer von DEBUG_LIFTIME-Sekunden aktiviert.+If a negative value (<0) is enteredthe debug mode is activated with a lifetime of DEBUG_LIFTIME-seconds.
  
 **SecTokenFingerprint**\\ **SecTokenFingerprint**\\
-Hiermit kann das Fingerprinting des Client vollständig eingeschaltet(**true**) oder ausgeschaltet(**false**) werden.\\ +Herewith the fingerprinting of the client can be turned completely on (**true**) or off (**false**). \\ 
-Die Abschaltung wird aus Sicherheitsgründen **nicht** empfohlen!+Turning it off for security reasons is **not** recommended!
  
 **SecTokenIpv4Netmask**\\ **SecTokenIpv4Netmask**\\
-Hiermit wird der zu überprüfende Netzanteil einer IPv4 Adresse festgelegtMöglich sind Netzmaskenlängen von 1-32 BitEine Länge von Bit setzt die IPv4-Überprüfung ausser Funktion.+Herewith the IPv4 address network share to verify is specifiedAllowed netmask lengths are 1-32 bitA length of bit logically disables IPv4 checking.
  
 **SecTokenIpv6Netmask**\\ **SecTokenIpv6Netmask**\\
-Hiermit wird der zu überprüfende Netzanteil einer IPv6 Adresse festgelegtMöglich sind Netzmaskenlängen von 1-128 BitEine Länge von Bit setzt die IPv6-Überprüfung ausser Funktion.+Herewith the IPv6 address network share to verify is specifiedAllowed netmask lengths are 1-128 bitA length of bit logically disables IPv6 checking.
 ---- ----
  
- +==== Available Methods ====
-==== Verfügbare Methoden ====+
 === ::getFTAN === === ::getFTAN ===
 **Prototype:** <php>mixed getFTAN(mixed $mMode = 'POST')</php>\\ **Prototype:** <php>mixed getFTAN(mixed $mMode = 'POST')</php>\\
-Gibt die FTAN des aktuellen Requests zurückBeim ersten Aufruf von getFTAN() innerhalb eines Requests wird eine neue FTAN erzeugtdie dann während des laufenden Requests beliebig oft abgerufen werden kann+Returns the FTAN for the current requestDuring the first call to getFTAN() within a request a new FTAN is generatedwhich can then be accessed during the current request several times
-Das Argument **//$mMode //** definiert das Rückgabeformat der Methode+The argument **//$mMode //** defines the return format of the method
-  * 'POST' liefert einen HTML Input Tag zurück ( //<input type="hidden" name="FTAN-name" value="FTAN-wert" title="">//+  * 'POST'  returns an HTML input tag ( //<input type="hidden" name="FTAN-name" value="FTAN-value" title="">//
-  * 'GET' liefert einen String, der in ein URL-Argument eingefügt werden kann ( //'FTAN-name=FTAN-wert'// ) +  * 'GET' returns a string that can be inserted in URL argument ( //'FTAN-name=FTAN-value'// ) 
-  * 'RAW' liefert ein Array zur Übergabe an eine Template-Enginewobei der Index '**name**' den //FTAN-name// und der Index '**value**' den //FTAN-wert// enthält. +  * 'RAW' returns an array to pass to a template enginein which the index '**name**' points to the //FTAN-name// and the index '**value**' points to the //FTAN-value//.
  
 === ::checkFtan === === ::checkFtan ===
 **Prototype:** <php>bool checkFTAN(mixed $mMode = 'POST', bool $bPreserve = false)</php>\\ **Prototype:** <php>bool checkFTAN(mixed $mMode = 'POST', bool $bPreserve = false)</php>\\
-Es wird überprüft, ob im aktuellen Request eine gültige FTAN übergeben wurdeDas Argument $mMode bestimmt, wo nach der FTAN gesucht werden sollPer default ist dies $_POST, bei jeder anderen Angabe $_GET, Jede gefundene, gültige FTAN wird danach sofort aus der Liste der aktiven FTANs gelöschtSie kann also grundsätzlich nur ein einziges Mal abgefragt werden+It is checked whether a valid FTAN was passed in the current requestThe argument $mMode determines where to look for the FTAN. By default this is $_POST, in any other case $_GET, each valid FTAN found will be immediately deleted from the list of active FTANs. So it can be interrogated strictly only once
-Bei gültiger FTAN ist der Rückgabewert TRUE andernfalls FALSE.+If the FTAN is valid the return value is TRUE or FALSE otherwise.
  
 === ::getIDKEY === === ::getIDKEY ===
 **Prototype:** <php>string getIDKEY(mixed $mValue)</php>\\ **Prototype:** <php>string getIDKEY(mixed $mValue)</php>\\
-Der an die Methode übergebene Wert wird gesichert und dafür ein einmaliger, 16-stelliger, alphanumerischer Schlüsselwert zurückgegeben+The value passed to the method is saved and instead a value for a one-time, 16-digit alphanumeric key is returned
-Es können folgende Datentypen übergeben werden: **//String//**, **//Integer//** und **//Array//**. Der zurückgegebene Schlüsselwert wird einfach anstatt des Originalwertes an den Client gesendet.+The following data types can be passed: **//String//**, **//Integer//** and **//Array//**. The returned key value is simply transmitted to the client instead of the original value.
  
 === ::checkIDKEY === === ::checkIDKEY ===
 **Prototype:** <php>mixed checkIDKEY(string $sFieldname, mixed $mDefault = 0, string $sRequest = 'POST'. bool $bPreserve = false)</php>\\ **Prototype:** <php>mixed checkIDKEY(string $sFieldname, mixed $mDefault = 0, string $sRequest = 'POST'. bool $bPreserve = false)</php>\\
-  * **//$sRequest//** Enthält dieses Argument den Wert '**//POST//** oder **//GET//**, so wird der Inhalt von **//$sFieldname//** als Bezeichner eines POST oder GET Elementesdessen Wert entschlüsselt werden soll, genutztEnthält es dagegen '**//RAW//**' so ist der Inhalt von **//$sFieldname//** selbst der zu decodierende Schlüsselwert+  * **//$sRequest//** If this argument contains the value '**//POST//** or **//GET//**, the content of  **//$sFieldname//** is used as an identifier of a POST or GET elementwhose value is to be decryptedIf it however contains '**//RAW//**' the content of **//$sFieldname//** directly contains the value to be decoded
-  * **//$mDefault//** ist der Wert, der zurückgegeben wird, falls der Schlüsselwert ungültig ist.+  * **//$mDefault//** is the value that is returned if the key value is invalid.
  
 === ::sanitizeLifeTime === === ::sanitizeLifeTime ===
 **Prototype:** <php>integer sanitizeLifeTime(integer $iLifeTime)</php>\\ **Prototype:** <php>integer sanitizeLifeTime(integer $iLifeTime)</php>\\
-Ein übergebener Integer-Wert wird auf eine verfügbare Intervallstufe zwischen LIFETIME_MIN und LIFETIME_MAX korrigiertEin negativer Wert bei aktiviertem DEBUG-Modus auf DEBUG_LIFETIME, ansonsten auf LIFETIME_MIN. Ein ungültiger Wert grundsätzlich auf LIFETIME_MIN. Der berechnete Wert wird zurückgegeben.+The supplied integer value is corrected to an available interval between LIFETIME_MIN and LIFETIME_MAX. A negative value when activated DEBUG mode is mapped on DEBUG_LIFETIME, otherwise on LIFETIME_MIN. An invalid value is mapped on LIFETIME_MIN. The calculated value is returned. 
 === ::getTokenLifeTime === === ::getTokenLifeTime ===
 **Prototype:** <php>array getTokenLifeTime(void)</php>\\ **Prototype:** <php>array getTokenLifeTime(void)</php>\\
-Gibt ein Array mit folgenden Schlüsseln zurück+Returns an array with the following keys
-^Schlüssel Beschreibung +^Key   Description                          
-| min  | minimale Lebensdauer in Sekunden     +| min  | minimum lifetime in seconds          
-| max  | maximale Lebensdauer in Sekunden     +| max  | maximum lifetime in seconds          
-| step | Schrittweite in Sekunden             +| step | Increment in seconds                 
-| value| Eingestellte Laufzeit in Sekunden    +| value| Set duration in seconds              
-Wozu werden diese Werte benötigtAn das Template übergebenlässt sich z.B. eine Fortschrittsanzeige realisieren, die optisch die Zeit bis zum Timeout anzeigt.+What are these values needed forTransfered to the templateone can for instance implement a progress bar that visually displays the time until timeout.
  
 ---- ----
-==== Anwendungsbeispiele ==== +==== Examples ==== 
-:!: **Achtung:** Requests müssen eindeutig seinDer 'action' Parameter eines **//form//** Tags darf keine zusätzlichen URL-Argumente ( //*.php?x=1//enthaltenEventuell notwendige Zusatzargumente müssen mit //<input type="hidden" …>// übergeben werden.+:!: **Warning** Requests must be uniqueThe 'action' parameter of a **//form//** tag must not contain any additional URL arguments ( //*.php?x=1// ). Any necessary additional arguments must be passed with //<input type="hidden" …>//.
  
-=== Formular ===+=== Form ===
 <PHP> <PHP>
 $sOutput = '<form method="post" action="index.php">' $sOutput = '<form method="post" action="index.php">'
Line 94: Line 91:
 echo $sOutput;     echo $sOutput;    
  
-// Auswertung+// Evaluation
  
-if ($oReg->App->checkFTAN('POST')) { /* alles OK */ }+if ($oReg->App->checkFTAN('POST')) { /* everythig OK */ }
  
 $iRecordId = $oReg->App->checkIDKEY('record_id', 0, 'POST'); $iRecordId = $oReg->App->checkIDKEY('record_id', 0, 'POST');
Line 106: Line 103:
 echo $sOutput;     echo $sOutput;    
  
-// Auswertung+// Evaluation
  
-if ($oReg->App->checkFTAN('GET')) { /* alles OK */ }+if ($oReg->App->checkFTAN('GET')) { /* everything OK */ }
  
 $iRecordId = $oReg->App->checkIDKEY('record_id', 0, 'GET'); $iRecordId = $oReg->App->checkIDKEY('record_id', 0, 'GET');
Line 123: Line 120:
 twig-template twig-template
  
-// Beispiel 1+// Example 1
  <form method="post" action="{{ TargetUrl }}">  <form method="post" action="{{ TargetUrl }}">
    <input type="hidden" name="{{ FTAN.name }}" value="{{ FTAN.value }}">    <input type="hidden" name="{{ FTAN.name }}" value="{{ FTAN.value }}">
Line 130: Line 127:
  </form>  </form>
  
-// Beispiel +// Example 
- <a href="{{ TargetUrl }}?{{ FTAN.name }}={{ FTAN.value }}&record_id={{ RecordId }}" title="xx">Tu was</a>+ <a href="{{ TargetUrl }}?{{ FTAN.name }}={{ FTAN.value }}&record_id={{ RecordId }}" title="xx">Do something</a>
 </PHP> </PHP>
 <PHP> <PHP>
 save-script save-script
  
-// Beispiel 1+// Example 1
 if ($oReg->App->checkFTAN()) { if ($oReg->App->checkFTAN()) {
     $record_id = $oReg->App->checkIDKEY('record_id');     $record_id = $oReg->App->checkIDKEY('record_id');
     [...]     [...]
 }    }   
-// Beispiel 2+// Example 2
 if ($oReg->App->checkFTAN('GET')) { if ($oReg->App->checkFTAN('GET')) {
     $record_id = $oReg->App->checkIDKEY('record_id', 0, 'GET');     $record_id = $oReg->App->checkIDKEY('record_id', 0, 'GET');
en/dev/284/security.1458848228.txt.gz · Last modified: 24.03.2016 19:37 by mrbaseman