Jump to content

Qualitätssicherung Digitale/Web Projekte: Difference between revisions

From Parasol
No edit summary
No edit summary
Line 91: Line 91:
Please refrain from hard-coding the year value within the copyright notice; instead, please utilize auto-updating functionality. For example, with PHP, you could perform the following:
Please refrain from hard-coding the year value within the copyright notice; instead, please utilize auto-updating functionality. For example, with PHP, you could perform the following:


* © <?php date("Y"); ?> {Firmenname}. Alle Rechte vorbehalten.
© <?php date("Y"); ?> {Firmenname}. Alle Rechte vorbehalten.


=== Search Engine Optimization (SEO) ===
After all of the hard work that you have invested in your code, it is very much recommended for you, when you have finished your project, to double-check that your website has a working, up-to-date sitemap so that your hard work is not negatively affected by badly-performing SEO performance.


Additionally, it is recommended to manually submit the URL of your website to Google via http://www.google.com/addurl/?continue=/addurl even if your website is already listed in Google SERPs.


=Meta Angaben und Informationen=
As a developer, it is often quite easy to overlook the markup hierarchy of a page. Therefore, it is recommended for you to perform a post-development examination of all important tag usages. For example, ensure that heading tags (<h1>, <h2> etc.) have been used in a sensible manner.


* Existiert ein Fav Icon und ist dies richtig eingebunden? (Sample Code)
==== Google Webmaster Tools ====
<nowiki>
Please ensure that your website has been correctly setup and configured with Google Webmaster Tools and that the access to this account has been shared with the Project Manager of your project.
<head>
<link rel="icon" href="http://www.{Domain.Endung}/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="http://www.{Domain.Endung}/favicon.ico" type="image/x-icon" />
</head>
</nowiki>


* Webpage Icons
=== Error Pages ===
<link rel="apple-touch-startup-image" href="/startup.png 320 x 460 px">
Please ensure that your website is correctly configured, and tested, to produce relevant error pages and codes for situations such as 404s and 401s. In absolutely no circumstances should the user be presented with a blank, white page.
<link rel="apple-touch-icon-{precomposed}" href="touch-icon-iphone.png" />
<link rel="apple-touch-icon-{precomposed}" sizes="72x72" href="touch-icon-ipad.png" />
<link rel="apple-touch-icon-{precomposed}" sizes="114x114" href="touch-icon-iphone-retina.png" />
<link rel="apple-touch-icon-{precomposed}" sizes="144x144" href="touch-icon-ipad-retina.png" />


* Existieren die Basis Meta Angaben?
=== Privacy ===
<title>{Titel}</title>
Almost all websites should be operable via an SSL, encrypted, connection. If your website is not utilizing an SSL certificate and you are obtaining information from your visitors, please speak with your Project Manager to discuss a plan to fix this as '''all''' private and confidential user information '''must''' be transmitted safely and securely.
<meta name="description" content="{Beschreibung}">
<meta name="keywords" content="{Keyword1}, {Keyword2}, ...">
<meta name="revisit-after" content="5days">
<meta name="robots" content=" follow">


* Existiert ein Impressum und sind die Pflichtabgaben hinterlegt?
=== Open Source Rules! ===
'''Die Pflichtabgaben sind in der deutsche Fassung:'''
At Parasol Island, we truly believe in the open source movement and, as such, follow what we like to call, ''The Open Source Rule''. This rule depicts that all frontend-related tools be free of charge and available for everyone to use.
{Firmenname und Rechtsform}
{Strasse}
{Land}-{PLZ} {Ort}
Amtsgericht {Stadt}, HRB {Nummer} (Verpflichtend, wenn ein Handelsregistereintrag vorliegt)
Ust-ID Nr.: DE{Nummer}
Telefon: +49 ({Vorwahl}) {Telefon}
E-Mail: {eMail Adresse}
Geschäftsführer und inhaltlich Verantwortlicher gemäß § 55 Abs. 2 RStV: {Name/n Geschäftsführer}


'''Auf Englisch:'''
If, under very special circumstances, you find yourself needing to use a paid tool or service, you must ensure that the license is applicable to both yourself and Parasol Island (at no extra cost). If this is not possible, please speak to your Project Manager as a matter of urgency.
{Firmenname und Rechtsform}
{Strasse}
{Land}-{PLZ} {Ort}
Local Court of {Stadt}, HRB {Nummer} (Verpflichtend, wenn ein Handelsregistereintrag vorliegt)
VAT ID No.: DE{Nummer}
Telephone: +49 ({Vorwahl}) {Telefon}
E-Mail: {eMail Adresse}
Managing Director and responsible under Sec. 55 para. (2) RStV: {Name/n Geschäftsführer}


* Copyright
== Backend Code Guidelines ==
  © <?php date("Y"); ?> {Firmenname}. Alle Rechte vorbehalten.


=Google=
=== Wordpress Admin / phpMyAdmin / Other Administrative Control Panels ===
* Existiert eine Goole Sitemap?
If your website is utilizing the ever-popular phpMyAdmin software or any other limited-access, administrative control panels (be it for databases, users, content etc.), please ensure that the path to such a feature does not include keywords that are commonly used across the internet. Usage of such common keywords will negatively impact the safety and security of your website.
[http://support.google.com/webmasters/bin/topic.py?hl=de&topic=8476 http://support.google.com/webmasters/bin/topic.py?hl=de&topic=8476]
[http://www.xml-sitemaps.com http://www.xml-sitemaps.com]


* Wurde die Seite bei Google angemeldet?
For example, it is never acceptable to use the following keywords in the URL:
[http://www.google.com/addurl/?continue=/addurl http://www.google.com/addurl/?continue=/addurl]


TODO: Suggest WordPress plugin
# phpMyAdmin
# admin
# administration
# wp-admin
# secure


=Fehlerseiten=
It is highly recommended that you utilize random, complex strings for accessing security-sensitive areas of your website.


*Fehlerseiten
Additionally, it is recommended for all security-sensitive directories to utilize .htaccess/.htpasswd files to integrate a two-step verification process.
Jede Parasol Website hat individuelle Fehlerseiten, für den Fall, das eine Seite nicht gefunden wird, nicht mehr verfügbar ist oder der User darauf keinen Zugriff hat. Die abgefangenen Fehler lauten wie folgt:
Fehlercode Statustext Beschreibung


401 Unauthorized Der Benutzer benötigt eine Autorisierung, ohne die er keinen Zugriff hat.
=== Web Servers ===
403 Forbidden Nicht öffentlicher Bereich, auf den der Benutzer keinen Zugriff hat.
404 Not Found Die Ressource wurde unter dem angegebenen URI nicht gefunden.


Die Fehlerseiten bestehen ausschließlich aus HTML und sind klar als Fehlerseiten erkennbar. Die Fehlermeldung ist verständlich dargestellt und beschrieben. Der User hat die Option per Link auf die Homepage zurück zu kommen und wird zusätzlich nach 10 Sekunden automatisch mit folgendem Code per Forward auf die Homepage weitergeleitet.
==== General ====
NGINX or LightHTTPD is very much preferred with only ports 80 and 443 open by default; all other ports should be closed. Please also ensure that FTP access is disabled.


<head>
==== SSL ====
<meta http-equiv="refresh" content="10; URL=http://www.{Domain.Endung}/">
All personally-identifiable and confidential information obtained from visitors (via any means) must be transmitted through a correctly-configured SSL connection using a validated and active SSL Certificate.
</head>


=Basis Suchmaschinen Optimierung=
==== Database Encryption & Decryption ====
*h1
All identifiable information that is to be stored in a database (or any other method of storage) must be encrypted at source and decrypted when needed.  
*robots.txt
user-agent:*
disallow: {Verzeichnisse, die nicht indiziert werden sollen, wie z.B. /images, /cgi-bin oder /private}
disallow: ...


TODO: Suggest reading modes for H1, H2 etc. (iOS Safari - Read Mode, Evernote Read Mode etc.)
==== Multiviews ====
Multiviews '''must''' always be disabled.


=Kompatibilität=
=== Database Servers ===
Wir testen wenn nicht anders aktiv vereinbart auf
Where possible, a project should utilize a dedicated database server which has a very tightly controlled firewall configured. Ideally, the firewall would only permit connections to be made to the database server from your project’s web server, thus making the database server inaccessible to the rest of the world.
* IE ab Version 9
* Safari Mac ab Version {Aktuelle Version -1 Versionsnummer}
* Safari PC ab Version {Aktuelle Version -1 Versionsnummer}
* Chrome Mac ab Version {Aktuelle Version}
* Chrome PC ab Version {Aktuelle Version}
* Firefox Mac ab Version {Aktuelle Version}
* Firefox PC ab Version {Aktuelle Version}


Zur Vereinfachung des Testens haben wir einen Account bei [https://crossbrowsertesting.com https://crossbrowsertesting.com], der Login liegt in der Passwortdatenbank.
=== PHP ===


=Google Accounts=
==== Environment ====
By default, PHP should be operating in Safe Mode and allow_url_fopen should be Off. Additionally, passwords should not be stored in cleartext within the PHP files containing business-logic. Passwords and other security-centric data should be stored in an external configuration file and stored in a non publicly-available location (outside of the server’s web-root).


Für jeden Kunden legen wir ein Google Konto (z.B. GoogleMail(Konto erstellen) nach dem an Muster<br />
==== User Input, Sanitization and XSS ====
<br />
Any information obtained from visitors must be sanitized and stored securely. Under the vast majority of circumstances, you should strip all tags from visitor input. Where possible, the visitor’s inputted data should not be entered directly into the database (or any other method of storage). For example, if you have a gender <select> element where only Mr, Mrs and Miss are the potential options, it is recommended that you compare the visitor’s input and then store your own value into the database. This approach of comparing and accepting, results in much safer input handling as you are able to better govern acceptable user values.
{kunde}.parasolisland@googlemail.com<br />
<br />
an. Das Passwort muss stark sein und wird in der Passwort Datenbank gespeichert.<br />


Additionally, it is critical that you only utilize user-sourced data within contained and controlled environments. For example, if you are running a competition to guess the number of balloons in a box, not only should you check that the user’s submitted guess is of numerical value '''before''' storing it in a database and that the accommodating database field is of an integer-based field type, but you should also '''force''' any future variables which handle the guess data to be of an integer-based type, too.


==Google Analytics==
This two-staged governance approach provides much more protection against dangerous XSS attacks than simply accepting and using any type of data.
<br />
URL: [http://www.google.com/analytics/ http://www.google.com/analytics/]<br />
<br />
Analytics Account für jede Webseite einrichten. Für jede neue Aktion ein eigenes Profil einrichten. Unter diesem Profil dann die produzierten Webseiten einrichten.


==== CSRF (Cross-Site Request Forgery / “Session Riding”) Attacks ====
If your websites accepts data or actions from its visitors, you must protect against CSRF attacks by utilizing CSRF session tokens or cookies (or both). If you are not familiar with CSRF attacks, here is a simple example that illustrates the danger of such attacks:


==Google Webmaster Tools==
===== CSRF Example =====
<br />
Imagine your website requires its visitors to create a premium (paid) account in order to access special content. As the developer, you have created a file named delete-account.php because, quite rightly, you are aware that users of your website should always have the option of deleting their own accounts. This sort of innocent functionality can easily be abused by an CSRF attack if you do not protect against it.
URL: [https://www.google.com/webmasters/tools/ https://www.google.com/webmasters/tools/]<br />
<br />
Zum Setup des Webmaster Tools Account muss eine HTML Seite in den Webspace geladen werden. Beim Setup des Profils wird diese zum Download angeboten.


How? Quite simply, an attacker could create a link on a popular forum, that many of your visitors use, that links to your delete-account.php page and once the user clicks on the unsuspicious forum link, they suddenly find themselves with a deleted account on your website.


=Facebook=
===== Protection Against CSRF Attacks =====
<meta property="og:image" content="{path to 500x500 Pixel, JPEG/PNG}"/>
The simplest and easiest way to protect your website against a CSRF attack is to create a unique session variable when your visitor first visits your website and whenever they want to perform an account (such as creating or deleting an account), you send this unique identifier along with their request (be it via a hidden input, query string value etc.) which you can compare against the value stored in their session variable. If the two values match, go ahead and process their request. If they do not, do not process the request.
<meta property="og:title" content="{Titel}"/>
<meta property="og:description" content="{Description}" />
<meta property="og:url" content="{canonical address}"/>


TODO: Recommend using Facebook Debugger: https://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fwww.parasol-island.com
If we go back to our previous example (with our delete-account.php file), we can see that by requiring the CSRF token to be passed with the call (e.g. delete-account.php?csrfToken=5ghfido943zqs95akopq19gfsa), any forged link on a forum would not actually be able to delete the user’s account as it would not be able to pass the correct CSRF token. Additionally, by storing the CSRF token in the user’s session, they will receive a new token when their session expires.


=Datenschutz=
=== Load Testing ===
Sobald personenbezogene Daten erhoben werden (Dies geschieht in der Regel schon in einem Kontaktformular oder eine Analysesoftware wie Google Analytics) muss die Webseite eine Datenschutzerklärung aufweisen.
We recommend using the following service to load-test your website/application: https://app.loadimpact.com
Dazu ist eine Verschlüsselung der Datenübertragung mithilfe eines SSL Zertifikates notwendig (https://).


TODO: Suggest speaking to Peter re: SSL
=== Open Source Rules! ===
At Parasol Island, we truly believe in the open source movement and, as such, follow what we like to call, The Open Source Rule. This rule depicts that all frontend-related tools be free of charge and available for everyone to use.


=Anwendungs-Sicherheit=
If, under very special circumstances, you find yourself needing to use a paid tool or service, you must ensure that the license is applicable to both yourself and Parasol Island (at no extra cost). If this is not possible, please speak to your Project Manager as a matter of urgency.
 
* SySS Input aus Toom Projekt
 
=Server Sicherheit=
 
==Server Konfiguration==
 
Best Practice Setup ist die Server Konfiguration wie HE psl-srv02.
 
==Host==
Den Host Zugriff auf den Root Server beschränken. Keine eigenen SSH Zugänge in die vServer. SSH Port auf 24480 verstellen und mit IP Table einschränken. Sehr Starkes Passwort (200bit) für root User. Zugriff weiterer User auf den localhost beschränken.
 
===Datenbank Server===
Den Datenbank vServer nur innerhalb des Root Servers verfügbar machen. Sehr starke (200bit) PW Datenbank Passwörter verwenden. Der DB Server hat keine eigene, nur eine interne IP.
 
====Datenbank & Datenbank Design====
=====phpMyAdmin=====
phpMyAdmin vollständig inkl. der nötigen Sicherheitsbibliotheken installieren. phpMyAdmin "verstecken" (bsp. website.de/IofkLU2PhA5QN3i8YyxXREapC/) und im Produktivbetrieb aus dem webroot verschieben. phpMyAdmin ausschliesslich auf die Produktiv Datenbank, nie auf den root User konfigurieren. phpMyAdmin per .htaccess (Username und Userpasswort stark, bsp. User: KM9f6ZzPVDuLToavCphqUGwmJ / Pas: F17WzDAghjnGUSTOE0pKBVx9L) und auf unsere/die des Kunden IP Adressen beschränken.
 
Immer so wenig Daten wie möglich speichern. Besondere Aufmerksamkeit bei personenbezogenen Daten
([http://de.wikipedia.org/wiki/Personenbezogene_Daten http://de.wikipedia.org/wiki/Personenbezogene_Daten])
 
=====Datenbank Tabelle verschlüsseln (Sonderaufwand, zusätzlicher Kalkulationsbestandteil)=====
Datenbank/Datenbanken Spalten mit personenbezogenen oder sensiblen Daten mit "mCrypt" & "Triple DES (56 Bit)" als "BASE 64" encodieren.  
 
{| class="collapsible collapsed wikitable"
|-
! Ausführliches Beispiel
|-
|
 
ideas` (`id`, `created`, `modified`, `title`, `name`, `lastname`, `email`, `street`, `zip`, `city`, `descr`, `push`, `materials`, `category_id`, `approved`, `active`, `views`, `votes`, `deleted`, `winner`)
VALUES
(4659, '2011-08-12 15:01:43', '2011-08-12 15:01:43', 'Titel', 'X8UrUA8ug8U=', 'X8UrUA8ug8U=', 'g5RuiljQfDKpxxj1LXoK4qQg4Tya6udb', 'pN4NBpnRrO6PFfDxkZNQl7pwjbSLMoXG/ORmcyYGe6UupbTqIl8JUa2CAKuLgKAf', 12345, 'U5JBgt9zuiiSXB2uw9g0Pw==', 'Wie', 'Idee', '', 5, 0, 0, 0, 0, 0, 0);
 
|}
 
===Webserver===
NGINX oder lighthttpd bevorzugt.
 
====Ports====
Port 80 und 443 öffnen, restliche Ports schliessen. Kein! Dateizugriff auf den Webserver per ftp. File- und Wartungszugriff ausschliesslich über Hostsystem.
 
====https====
Sobald Daten (und sei es nur ein Kontaktformular) übertragen werden, komplette Seite verpflichtend in https laufen lassen. Ein gültiges Zertifikat ist hierfür erforderlich.
 
====Informationen über Webserver unterbinden====
=====Produktnamen=====
Ausgabe des Webserver Produktnamen unterbinden. Bsp.
{| class="collapsible collapsed wikitable"
|-
! Ausführliches Beispiel
|-
|
Unverschlüsselter Verbindungsaufbau über Port 80:
nc 92.51.175.186 80
OPTIONS / HTTP/1.0
HTTP/1.1 200 OK
Date: Fri, 12 Aug 2011 16:10:43 GMT
Server: Apache
Set-Cookie: PHPSESSID=tq57fvr7dgcra4q8lvbh2qndq3; path=/
P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"
Vary: Accept-Encoding
Connection: close
Content-Type: text/html; charset=UTF-8
Verschlüsselter Verbindungsaufbau über Port 443:
openssl s_client -connect 92.51.175.186:443 -quiet
(...)
OPTIONS / HTTP/1.0
HTTP/1.1 200 OK
Date: Fri, 12 Aug 2011 16:13:02 GMT
Server: Apache
Set-Cookie: PHPSESSID=ufr7ac6abir77chv02sjp86o67; path=/; secure
P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"
Vary: Accept-Encoding
Connection: close
Content-Type: text/html; charset=UTF-8
 
|}
 
=====Apache Icons=====
Deinstallation Apache Icons (/icons/)
 
=====Multiviews=====
Deaktivieren der Funktion Apache Multiviews
 
{| class="collapsible collapsed wikitable"
|-
! Ausführliches Beispiel
|-
|
 
Es wurde festgestellt, dass über den nachfolgenden exemplarischen Aufruf das Raten von
Dateinamen begünstigt wird. Durch Raten von Dateinamen wird durch die aktivierte Funktion
Multiviews werden selbst bei nicht exakten Tre�ern alternative Dateinamen vorschlagen, die
einem Angreifer unter Umst¨anden hilfreich sein können.
nc 92.51.175.186 80
GET /index HTTP/1.1
Accept: foobar
Host: 92.51.175.186
HTTP/1.1 406 Not Acceptable
Date: Thu, 11 Aug 2011 07:57:12 GMT
Server: Apache
Alternates: "index.php" 1 type application/x-httpd-php
Vary: negotiate,Accept-Encoding
TCN: list
Content-Length: 361
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
 
<html><head>
<title>406 Not Acceptable</title>
</head><body>
<h1>Not Acceptable</h1>
<p>An appropriate representation of the requested resource /index could not be found on'
this server.</p>
Available variants:
<ul>
<li><a href="index.php">index.php</a> , type application/x-httpd-php</li>
</ul>
</body></html>
 
|}
 
====TCP Timestamp Requests unterbinden====
 
Das System antwortet auf TCP Timestamp Requests. Dadurch kann die Laufzeit des Systems
ermittelt werden. Aufgrund langer Systemlaufzeiten lassen sich R¨ uckschl ¨ usse auf nicht installierte
Kernel-Patches ziehen, da diese mit einem Neustart des Systems verbunden sind. Die
SySS GmbH empfiehlt, das Beantworten derartiger Anfragen zu unterbinden1.
Nachweis auf Port 80:
hping2 -S -p 80 -c 2 --tcp-timestamp 92.51.175.186
HPING 92.51.175.186 (eth0 92.51.175.186): S set, 40 headers + 0 data bytes
len=56 ip=92.51.175.186 ttl=58 DF id=0 sport=80 flags=SA seq=0 win=5792 rtt=17.3 ms
TCP timestamp: tcpts=56786332
len=56 ip=92.51.175.186 ttl=58 DF id=0 sport=80 flags=SA seq=1 win=5792 rtt=14.9 ms
TCP timestamp: tcpts=56786582
HZ seems hz=100
System uptime seems: 6 days, 13 hours, 44 minutes, 25 seconds
Nachweis auf Port 443:
hping2 -S -p 443 -c 2 --tcp-timestamp 92.51.175.186
HPING 92.51.175.186 (eth0 92.51.175.186): S set, 40 headers + 0 data bytes
len=56 ip=92.51.175.186 ttl=58 DF id=0 sport=443 flags=SA seq=0 win=5792 rtt=14.3 ms
TCP timestamp: tcpts=57236359
len=56 ip=92.51.175.186 ttl=58 DF id=0 sport=443 flags=SA seq=1 win=5792 rtt=14.2 ms
TCP timestamp: tcpts=57236609
HZ seems hz=100
System uptime seems: 6 days, 14 hours, 59 minutes, 26 seconds
 
 
====Denial of Service-Angriff auf Webserver-Dienst erschweren====
W¨ahrend des Projektzeitraumes wurde erkannt, dass der eingesetzte Apache-Webserver f ¨ ur
Denial of Service-Angri�e verwundbar ist.
Konkret konnte derWebserver innerhalb von drei Sekunden nach Beginn des Angri�s mit dem
Tool Slowloris2 lahm gelegt werden, indem er (auf beiden TCP-Ports) nicht mehr erreichbar
war. Sobald der Angri� eingestellt wird, ist derWebserver umgehend wieder erreichbar.
Das Problem hierbei ist in dergew¨ahlten Software-Architektur innerhalb desApache-Webservers
begr ¨ undet.
Die SySS GmbH empfiehlt, ein anderes Software-Produkt alsWebserver-Dienst zu verwenden.
slowloris.pl --dns 92.51.175.186
Welcome to Slowloris - the low bandwidth, yet greedy and poisonous HTTP client
Defaulting to port 80.
Defaulting to a 5 second tcp connection timeout.
Defaulting to a 100 second re-try timeout.
Defaulting to 1000 connections.
Multithreading enabled.
Connecting to 92.51.175.186:80 every 100 seconds with 1000 sockets:
Building sockets.
Building sockets.
Building sockets.
Building sockets.
Building sockets.
Building sockets.
Building sockets.
Building sockets.
Building sockets.
Building sockets.
Building sockets.
Building sockets.
Building sockets.
Building sockets.
Building sockets.
Building sockets.
Building sockets.
Building sockets.
Building sockets.
Building sockets.
 
2http://ha.ckers.org/slowloris/
 
 
 
===PHP===
"safe_mode = On"<br />
"allow_url_fopen = Off" <br />
 
Verpflichtend. Sofern allow_url_fopen gebraucht wird, dies durch bsp. libcurl anpassen.
 
 
TODO: Explain "No-Password" Rule - only public certificates.
 
=Webapp=
 
- XSS unterbinden (<script>alert(XXS)</script>)
 
TODO: Bigger focus on XSS (CSRF tokens etc.)
 
==CMS==
 
===Ausgabe des Framework-/Produkt-Name des CMS vermeiden===
 
Auf der Login-Seite https://92.51.175.186/admin/users/login ist ein Schriftzug von Cake-
PHP zu sehen. Dies gibt den Namen des verwendeten PHP-Frameworks preis.
 
 
- Keine Usernamen wie "admin" oder "root" verwenden.
- Passwortrichtlinie/starke Passwörter erzwingen
- Autocomplete im Login ist ausgeschaltet.
- Default user ist nicht löschbar
- https: erzwingen
- CAL/IP Tables einsetzten
 
 
==Frontend==
 
 
 
https://92.51.175.186/ideas/add280b7"><script>alert(1)</script>
 
 
HTTPS Caching wir für das Backend unterbunden.
Session Fixation ist nicht mehr möglich.
 
Cross-Site Request Forgery ist nicht mehr möglich.
 
 
IP-Adresse 92.51.175.186:
Webserver-Dienst ist anf¨allig f ¨ ur
Denial of Service-Angri�e
Anderes
Webserver-Produkt
einsetzen
Hoch 2.5
Seite 14
I1.1 IP-Adresse 92.51.175.186:
Webserver-Banner gibt
Produktnamen Apache preis
(TCP-Port 80/443)
Dieses Verhalten
unterbinden
Info 2.2.1
Seite 10
I1.2 IP-Adresse 92.51.175.186:
Installierte Apache-Icons
erm¨oglichen R¨ uckschluss auf
eingesetztesWebserver-Produkt
Apache-Icons vom
System entfernen
Info 2.2.2
Seite 11
I1.3 IP-Adresse 92.51.175.186:
Installierte Apache-Modul
beg ¨ unstigt einfacheres Raten von
Dateinamen
Multiviews-Funktion
deaktivieren
Info 2.2.3
Seite 11
I1.4 IP-Adresse 92.51.175.186:
Das System antwortet auf TCP
Timestamp Requests, wodurch die
Uptime des Systems ausgelesen
werden kann
Deaktivierung dieses
Verhaltens
Login-Formular ohne
autocomplete-Tag
autocomplete-Tag
verwenden
Niedrig
(behoben)
3.2
Seite 19
L2.2 IP-Adresse 92.51.175.186:
Verschiedene Cookies verwenden
das secure-Attribut nicht
secure-Attribut setzen Niedrig 3.3.1.1
Seite 19
L2.3 IP-Adresse 92.51.175.186:
Alle Cookies verwenden das
httpOnly-Attribut nicht
httpOnly-Attribut setzen Niedrig 3.3.1.2
Seite 20
L2.4 IP-Adresse 92.51.175.186:
Session Token PHPSESSID wird
nach korrekter Anmeldung nicht
erneuert
Session Token erneuern
und bisheriges
serverseitig invalidieren
Niedrig 3.3.3
Seite 21
L2.5 IP-Adresse 92.51.175.186:
Inkorrekt eingestellte
Caching-Direktiven erm¨oglichen
Einsicht in zuvor aufgerufene
Daten/Webseiten
Ver¨anderung der
Caching-Direktiven
Niedrig 3.3.4
Seite 21
L2.6 IP-Adresse 92.51.175.186:
Applikation ist anf¨allig f ¨ ur Session
Fixation-Angri�e
Nicht vom System
ausgegebene Session
Tokens verwerfen
Niedrig 3.3.5
Seite 21
I2.1 IP-Adresse 92.51.175.186:
Fehlermeldungen geben aktuellen
Dateisystem-Pfad preis
Derartige Informationen
innerhalb von
Fehlermeldungen nicht
ausgeben
Info 3.1.1
Seite 16
Version 1.0 8
dies ist eine Kopie des gedruckten Dokuments, welches insgesamt 47 Seiten umfasst
Sicherheitstest toom Baumarkt GmbH
# Feststellung Empfehlung Risiko Referenz
I2.2 IP-Adresse 92.51.175.186:
E-Mail-Header gibt eingesetztes
PHP-Framework preis
Optionale Headerzeile
X-Mailer entfernen
Info 3.1.2
Seite 17
I2.3 IP-Adresse 92.51.175.186:
CakePHP-Schriftzug gibt
PHP-Framework preis
Schriftzug entfernen
 
 
 
robots.txt
 
=Loadtest=
https://app.loadimpact.com
 
Immer auf Produktivsystem entwicklen.

Revision as of 06:31, 17 June 2015

Frontend Code Guidelines

Indentations

For all languages, regardless of complexity or age, it is recommended that soft tabs are used. Soft tabs are where space characters are used rather than tab characters and upon hitting the tab key, your editor of choice should insert four spaces.

Cross-Browser Support and Testing

Generally, it is expected for you to support the following internet browsers (for desktops, tablets and mobiles - where possible):

  • Google Chrome (current version plus 1 previous version)
  • Mozilla Firefox (current version plus 1 previous version)
  • Safari (current version plus 1 previous version)
  • Internet Explorer 9+

Please note that the above browsers must be tested on both Microsoft Windows and Apple OS X. Special consideration for Linux machines is not mandatory, however if time permits, is also encouraged.

HTML5

Markup code should adhere to the W3C Standards (http://www.w3.org/TR/html5/) and should be able to pass, at least 90%, validation by the W3C Validation Service (https://validator.w3.org/). We do not strive for 100% as cross-browser compatibility is more important than passing validation tests. It is acceptable for you to write a non-standards chunk of code if the result is beneficial to the goal of supporting different browsers and devices.

CSS

All CSS should be included within each page of your website from an external stylesheet and should never be delivered via inline CSS. Additionally, it is recommended that Print CSS styles are given sufficient attention, especially for content-heavy websites.

It is never acceptable to have inline JavaScript embedded within the href attribute of an anchor tag. The negative impact of such inline JavaScript is great and there are no circumstances where it would be acceptable to use it.

Performance Testing in General

All websites and apps should be performance tested before being considered finished. For websites, it is expected that all developers will perform a Page Speed Insights test (https://developers.google.com/speed/pagespeed/insights/) and a GTmetrix Performance Test (http://gtmetrix.com/) and, at a minimum, the website will pass with a score/grade in the top 15%. Thus a score of 85% and a grade of A for the Google-powered and GTmetrix-powered tests respectively are required.

More information can be found here: https://wiki.parasol-island.com/Performance_of_Webpages

Performance Testing of CSS and JavaScript

All CSS and JavaScript code should be written with performance in mind. It is highly recommended to follow the Yahoo Developer Performance Guidelines for Best Practices (https://developer.yahoo.com/performance/).

Images Sprites

Where possible, it is recommended that sprites are to be used for small, similar assets (e.g. icons) to help reduce the overall page weight and lower the number of HTTP requests, thus rendering the page quicker.

Certain meta tags are not only important for SEO purposes but are of the utmost importance for many disabled internet users, therefore it is highly recommended that you pay close attention to your usage of meta tags. Please refer to the upcoming section titled “Accessibility” for more meta tag-related recommendations.

Often Forgotten or Misused Tags

The following tags are often forgotten or misused, therefore it is recommended that you periodically double-check that you are, in fact, using such tags correctly.

  1. Favicon
  2. Web Icons (for mobile devices)
  3. Basic fundamental tags (Title, Description, Keywords, Robots etc.)

Before going live with a website, it is recommended that you triple-check any usages of the robots meta tag to ensure that you have not configured the attribute to be negative towards SEO.

Facebook / Open Graph Tags

Please ensure that you have not forgotten to include, at least, the following four Open Graph tags in your code:

  1. OG:Image
  2. OG:Title
  3. OG:Description
  4. OG:URL

Accessibility

The W3C organization runs the Web Accessibility Initiative (WAI) (http://www.w3.org/WAI/) and it is very much recommended for you to familiarize yourself with this initiative as it will empower you to write code that is beneficial and usable by all internet users, including those with disabilities.

Viewports

For the viewport meta tag, it is very important that you do not set maximum-scale to 1.0 (thus rendering the zoom functionality of the mobile browser inoperable) because you will be inadvertently inflicting undeserved difficulty upon visitors of your website whom may have visual problems.

Fantastic Resources for Improving Accessibility

W3C Checklist of Checkpoints for Web Content Accessibility Guidelines (http://www.w3.org/TR/WCAG10/full-checklist.html)

The following legal information is compulsory for the vast majority of websites, including some microsites (e.g. Facebook Tab apps).

In English, the compulsory legal information can be presented like so:

{Firmenname und Rechtsform} {Strasse} {Land}-{PLZ} {Ort} Local Court of {Stadt}, HRB {Nummer} (Verpflichtend, wenn ein Handelsregistereintrag vorliegt) VAT ID No.: DE{Nummer} Telephone: +49 ({Vorwahl}) {Telefon} E-Mail: {eMail Adresse} Managing Director and responsible under Sec. 55 para. (2) RStV: {Name/n Geschäftsführer}

Similarly, in German, the compulsory legal information can be presented like so:

{Firmenname und Rechtsform} {Strasse} {Land}-{PLZ} {Ort} Amtsgericht {Stadt}, HRB {Nummer} (Verpflichtend, wenn ein Handelsregistereintrag vorliegt) Ust-ID Nr.: DE{Nummer} Telefon: +49 ({Vorwahl}) {Telefon} E-Mail: {eMail Adresse} Geschäftsführer und inhaltlich Verantwortlicher gemäß § 55 Abs. 2 RStV: {Name/n Geschäftsführer}

Please refrain from hard-coding the year value within the copyright notice; instead, please utilize auto-updating functionality. For example, with PHP, you could perform the following:

© <?php date("Y"); ?> {Firmenname}. Alle Rechte vorbehalten.

Search Engine Optimization (SEO)

After all of the hard work that you have invested in your code, it is very much recommended for you, when you have finished your project, to double-check that your website has a working, up-to-date sitemap so that your hard work is not negatively affected by badly-performing SEO performance.

Additionally, it is recommended to manually submit the URL of your website to Google via http://www.google.com/addurl/?continue=/addurl even if your website is already listed in Google SERPs.

As a developer, it is often quite easy to overlook the markup hierarchy of a page. Therefore, it is recommended for you to perform a post-development examination of all important tag usages. For example, ensure that heading tags (

,

etc.) have been used in a sensible manner.

Google Webmaster Tools

Please ensure that your website has been correctly setup and configured with Google Webmaster Tools and that the access to this account has been shared with the Project Manager of your project.

Error Pages

Please ensure that your website is correctly configured, and tested, to produce relevant error pages and codes for situations such as 404s and 401s. In absolutely no circumstances should the user be presented with a blank, white page.

Privacy

Almost all websites should be operable via an SSL, encrypted, connection. If your website is not utilizing an SSL certificate and you are obtaining information from your visitors, please speak with your Project Manager to discuss a plan to fix this as all private and confidential user information must be transmitted safely and securely.

Open Source Rules!

At Parasol Island, we truly believe in the open source movement and, as such, follow what we like to call, The Open Source Rule. This rule depicts that all frontend-related tools be free of charge and available for everyone to use.

If, under very special circumstances, you find yourself needing to use a paid tool or service, you must ensure that the license is applicable to both yourself and Parasol Island (at no extra cost). If this is not possible, please speak to your Project Manager as a matter of urgency.

Backend Code Guidelines

Wordpress Admin / phpMyAdmin / Other Administrative Control Panels

If your website is utilizing the ever-popular phpMyAdmin software or any other limited-access, administrative control panels (be it for databases, users, content etc.), please ensure that the path to such a feature does not include keywords that are commonly used across the internet. Usage of such common keywords will negatively impact the safety and security of your website.

For example, it is never acceptable to use the following keywords in the URL:

  1. phpMyAdmin
  2. admin
  3. administration
  4. wp-admin
  5. secure

It is highly recommended that you utilize random, complex strings for accessing security-sensitive areas of your website.

Additionally, it is recommended for all security-sensitive directories to utilize .htaccess/.htpasswd files to integrate a two-step verification process.

Web Servers

General

NGINX or LightHTTPD is very much preferred with only ports 80 and 443 open by default; all other ports should be closed. Please also ensure that FTP access is disabled.

SSL

All personally-identifiable and confidential information obtained from visitors (via any means) must be transmitted through a correctly-configured SSL connection using a validated and active SSL Certificate.

Database Encryption & Decryption

All identifiable information that is to be stored in a database (or any other method of storage) must be encrypted at source and decrypted when needed.

Multiviews

Multiviews must always be disabled.

Database Servers

Where possible, a project should utilize a dedicated database server which has a very tightly controlled firewall configured. Ideally, the firewall would only permit connections to be made to the database server from your project’s web server, thus making the database server inaccessible to the rest of the world.

PHP

Environment

By default, PHP should be operating in Safe Mode and allow_url_fopen should be Off. Additionally, passwords should not be stored in cleartext within the PHP files containing business-logic. Passwords and other security-centric data should be stored in an external configuration file and stored in a non publicly-available location (outside of the server’s web-root).

User Input, Sanitization and XSS

Any information obtained from visitors must be sanitized and stored securely. Under the vast majority of circumstances, you should strip all tags from visitor input. Where possible, the visitor’s inputted data should not be entered directly into the database (or any other method of storage). For example, if you have a gender <select> element where only Mr, Mrs and Miss are the potential options, it is recommended that you compare the visitor’s input and then store your own value into the database. This approach of comparing and accepting, results in much safer input handling as you are able to better govern acceptable user values.

Additionally, it is critical that you only utilize user-sourced data within contained and controlled environments. For example, if you are running a competition to guess the number of balloons in a box, not only should you check that the user’s submitted guess is of numerical value before storing it in a database and that the accommodating database field is of an integer-based field type, but you should also force any future variables which handle the guess data to be of an integer-based type, too.

This two-staged governance approach provides much more protection against dangerous XSS attacks than simply accepting and using any type of data.

CSRF (Cross-Site Request Forgery / “Session Riding”) Attacks

If your websites accepts data or actions from its visitors, you must protect against CSRF attacks by utilizing CSRF session tokens or cookies (or both). If you are not familiar with CSRF attacks, here is a simple example that illustrates the danger of such attacks:

CSRF Example

Imagine your website requires its visitors to create a premium (paid) account in order to access special content. As the developer, you have created a file named delete-account.php because, quite rightly, you are aware that users of your website should always have the option of deleting their own accounts. This sort of innocent functionality can easily be abused by an CSRF attack if you do not protect against it.

How? Quite simply, an attacker could create a link on a popular forum, that many of your visitors use, that links to your delete-account.php page and once the user clicks on the unsuspicious forum link, they suddenly find themselves with a deleted account on your website.

Protection Against CSRF Attacks

The simplest and easiest way to protect your website against a CSRF attack is to create a unique session variable when your visitor first visits your website and whenever they want to perform an account (such as creating or deleting an account), you send this unique identifier along with their request (be it via a hidden input, query string value etc.) which you can compare against the value stored in their session variable. If the two values match, go ahead and process their request. If they do not, do not process the request.

If we go back to our previous example (with our delete-account.php file), we can see that by requiring the CSRF token to be passed with the call (e.g. delete-account.php?csrfToken=5ghfido943zqs95akopq19gfsa), any forged link on a forum would not actually be able to delete the user’s account as it would not be able to pass the correct CSRF token. Additionally, by storing the CSRF token in the user’s session, they will receive a new token when their session expires.

Load Testing

We recommend using the following service to load-test your website/application: https://app.loadimpact.com

Open Source Rules!

At Parasol Island, we truly believe in the open source movement and, as such, follow what we like to call, The Open Source Rule. This rule depicts that all frontend-related tools be free of charge and available for everyone to use.

If, under very special circumstances, you find yourself needing to use a paid tool or service, you must ensure that the license is applicable to both yourself and Parasol Island (at no extra cost). If this is not possible, please speak to your Project Manager as a matter of urgency.