Measuring the Security of Web Applications - OWASP Foundation · 2020-01-17 · OWASP 3 OWASP...
Transcript of Measuring the Security of Web Applications - OWASP Foundation · 2020-01-17 · OWASP 3 OWASP...
![Page 1: Measuring the Security of Web Applications - OWASP Foundation · 2020-01-17 · OWASP 3 OWASP Germany 2008 Conference Measuring the Security of Web Applications – Sebastian Schinzel](https://reader033.fdocuments.in/reader033/viewer/2022042915/5f51d1b88d22c02d4a0cde38/html5/thumbnails/1.jpg)
Copyright © The OWASP FoundationPermission is granted to copy, distribute and/or modify this documentunder the terms of the OWASP License.
The OWASP Foundation
OWASP
http://www.owasp.org
http://www.owasp.org/index.php/GermanyOWASP Germany 2008 Conference
Frankfurt, 25.11.08
Measuring the Security of WebApplications
Sebastian Schinzel
Virtual Forge GmbH
+49 622 1 868 900
![Page 2: Measuring the Security of Web Applications - OWASP Foundation · 2020-01-17 · OWASP 3 OWASP Germany 2008 Conference Measuring the Security of Web Applications – Sebastian Schinzel](https://reader033.fdocuments.in/reader033/viewer/2022042915/5f51d1b88d22c02d4a0cde38/html5/thumbnails/2.jpg)
2OWASPOWASP Germany 2008 ConferenceMeasuring the Security of Web Applications – Sebastian Schinzel
Daten im Internet
![Page 3: Measuring the Security of Web Applications - OWASP Foundation · 2020-01-17 · OWASP 3 OWASP Germany 2008 Conference Measuring the Security of Web Applications – Sebastian Schinzel](https://reader033.fdocuments.in/reader033/viewer/2022042915/5f51d1b88d22c02d4a0cde38/html5/thumbnails/3.jpg)
3OWASPOWASP Germany 2008 ConferenceMeasuring the Security of Web Applications – Sebastian Schinzel
Lord Kelvin 1824 - 1907 "If you can not measure it,you can not improve it."
“I often say that when you can measure what you are speaking about, and express it in numbers, you know something about it;”
“but when you cannot express it in numbers,your knowledge is of a meagreand unsatisfactory kind;“
“it may be the beginning of knowledge,but you have scarcely, in your thoughts,advanced to the stage of science,whatever the matter may be.”
http://en.wikiquote.org/wiki/William_Thomson,_1st_Baron_Kelvin
![Page 4: Measuring the Security of Web Applications - OWASP Foundation · 2020-01-17 · OWASP 3 OWASP Germany 2008 Conference Measuring the Security of Web Applications – Sebastian Schinzel](https://reader033.fdocuments.in/reader033/viewer/2022042915/5f51d1b88d22c02d4a0cde38/html5/thumbnails/4.jpg)
4OWASPOWASP Germany 2008 ConferenceMeasuring the Security of Web Applications – Sebastian Schinzel
Software ist...
trivial / komplex stabil / buggy
günstig / teuer langsam / performant
gut / schlecht
sicher / unsicher
gut schlecht
Software
![Page 5: Measuring the Security of Web Applications - OWASP Foundation · 2020-01-17 · OWASP 3 OWASP Germany 2008 Conference Measuring the Security of Web Applications – Sebastian Schinzel](https://reader033.fdocuments.in/reader033/viewer/2022042915/5f51d1b88d22c02d4a0cde38/html5/thumbnails/5.jpg)
5OWASPOWASP Germany 2008 ConferenceMeasuring the Security of Web Applications – Sebastian Schinzel
“Mein Apfel ist besser als Dein Fenster”
Was ist sicherer?
?
unsicher sicher
![Page 6: Measuring the Security of Web Applications - OWASP Foundation · 2020-01-17 · OWASP 3 OWASP Germany 2008 Conference Measuring the Security of Web Applications – Sebastian Schinzel](https://reader033.fdocuments.in/reader033/viewer/2022042915/5f51d1b88d22c02d4a0cde38/html5/thumbnails/6.jpg)
6OWASPOWASP Germany 2008 ConferenceMeasuring the Security of Web Applications – Sebastian Schinzel
“Von null auf hundert in 25.000€”
Studie:“Apfel X ist etwa doppelt so sicher wie Birne Y.”
Betriebssystem ist “Unbreakable”!
“Sicherheit über Nacht mit PowerSecure tm!”
![Page 7: Measuring the Security of Web Applications - OWASP Foundation · 2020-01-17 · OWASP 3 OWASP Germany 2008 Conference Measuring the Security of Web Applications – Sebastian Schinzel](https://reader033.fdocuments.in/reader033/viewer/2022042915/5f51d1b88d22c02d4a0cde38/html5/thumbnails/7.jpg)
7OWASPOWASP Germany 2008 ConferenceMeasuring the Security of Web Applications – Sebastian Schinzel
COTS vs. IndividualsoftwareIndividual-Software: Geschäfts-Applikationen, z.B.
Web-Shops E-Recruiting
Web-Applikationen! Wartung oft unklar Enthält oft kritische und trivial findbare
Sicherheits-Lücken
Individual-Software
Commercialoff-the-shelf
(COTS)
COTS: Betriebssystem (Win, Mac, Linux, ...) Web-Server (Apache, IIS, ...) Wartung durch Hersteller Prozesse zur sicheren Entwicklung oft
vorhanden
![Page 8: Measuring the Security of Web Applications - OWASP Foundation · 2020-01-17 · OWASP 3 OWASP Germany 2008 Conference Measuring the Security of Web Applications – Sebastian Schinzel](https://reader033.fdocuments.in/reader033/viewer/2022042915/5f51d1b88d22c02d4a0cde38/html5/thumbnails/8.jpg)
8OWASPOWASP Germany 2008 ConferenceMeasuring the Security of Web Applications – Sebastian Schinzel
Zwischenstand
Daten im Internet müssen geschützt werden
Sicherheit ist kontra-intuitiv (Marketing hatleichtes Spiel)
Web-Applikationen haben besondereAnforderungen an Sicherheit
![Page 9: Measuring the Security of Web Applications - OWASP Foundation · 2020-01-17 · OWASP 3 OWASP Germany 2008 Conference Measuring the Security of Web Applications – Sebastian Schinzel](https://reader033.fdocuments.in/reader033/viewer/2022042915/5f51d1b88d22c02d4a0cde38/html5/thumbnails/9.jpg)
9OWASPOWASP Germany 2008 ConferenceMeasuring the Security of Web Applications – Sebastian Schinzel
Messen von Software-Eigenschaften
Stabilität Sicherheit
![Page 10: Measuring the Security of Web Applications - OWASP Foundation · 2020-01-17 · OWASP 3 OWASP Germany 2008 Conference Measuring the Security of Web Applications – Sebastian Schinzel](https://reader033.fdocuments.in/reader033/viewer/2022042915/5f51d1b88d22c02d4a0cde38/html5/thumbnails/10.jpg)
10OWASPOWASP Germany 2008 ConferenceMeasuring the Security of Web Applications – Sebastian Schinzel
Wie messe ich Sicherheit?
Retrospektive
ZeitStatus Quo Prognose
Owasp FFM
Überlegung: Zählen von Schwachstellen
![Page 11: Measuring the Security of Web Applications - OWASP Foundation · 2020-01-17 · OWASP 3 OWASP Germany 2008 Conference Measuring the Security of Web Applications – Sebastian Schinzel](https://reader033.fdocuments.in/reader033/viewer/2022042915/5f51d1b88d22c02d4a0cde38/html5/thumbnails/11.jpg)
11OWASPOWASP Germany 2008 ConferenceMeasuring the Security of Web Applications – Sebastian Schinzel
Wie messe ich Sicherheit retrospektiv?
Daten von Bugtraq, Full-Disclosure, CVE, ...Annahme: Anzahl veröffentlichter Schwachstellen
sei anti-proportional zur Sicherheit
# Schwach-stellen
Sicherheit
0
![Page 12: Measuring the Security of Web Applications - OWASP Foundation · 2020-01-17 · OWASP 3 OWASP Germany 2008 Conference Measuring the Security of Web Applications – Sebastian Schinzel](https://reader033.fdocuments.in/reader033/viewer/2022042915/5f51d1b88d22c02d4a0cde38/html5/thumbnails/12.jpg)
12OWASPOWASP Germany 2008 ConferenceMeasuring the Security of Web Applications – Sebastian Schinzel
Wie messe ich Sicherheit retrospektiv?
Problem: Veröffentlichung von Sicherheitslückenhat strategischen WertForscher veröffentlicht Schwachstelle nichtHersteller/Berater veröffentlicht Schwachstelle nichtHacker veröffentlicht Schwachstelle nichtZeitpunkt der Veröffentlichung != Zeitpunkt der
Entdeckung
![Page 13: Measuring the Security of Web Applications - OWASP Foundation · 2020-01-17 · OWASP 3 OWASP Germany 2008 Conference Measuring the Security of Web Applications – Sebastian Schinzel](https://reader033.fdocuments.in/reader033/viewer/2022042915/5f51d1b88d22c02d4a0cde38/html5/thumbnails/13.jpg)
13OWASPOWASP Germany 2008 ConferenceMeasuring the Security of Web Applications – Sebastian Schinzel
Wie messe ich Sicherheit im Status Quo?
Penetrationstest oder Code Audit:“Ist ein bestehendes Software-System unsicher?”
“Ja”oder
“Keine Ahnung”
Sicherheit
# Schwach-stellen
0
![Page 14: Measuring the Security of Web Applications - OWASP Foundation · 2020-01-17 · OWASP 3 OWASP Germany 2008 Conference Measuring the Security of Web Applications – Sebastian Schinzel](https://reader033.fdocuments.in/reader033/viewer/2022042915/5f51d1b88d22c02d4a0cde38/html5/thumbnails/14.jpg)
14OWASPOWASP Germany 2008 ConferenceMeasuring the Security of Web Applications – Sebastian Schinzel
Wie messe ich Sicherheit im Status Quo?
Probleme von Penetrationstests:
Reproduzierbarkeit?
Abdeckung?
Aussage?
![Page 15: Measuring the Security of Web Applications - OWASP Foundation · 2020-01-17 · OWASP 3 OWASP Germany 2008 Conference Measuring the Security of Web Applications – Sebastian Schinzel](https://reader033.fdocuments.in/reader033/viewer/2022042915/5f51d1b88d22c02d4a0cde38/html5/thumbnails/15.jpg)
15OWASPOWASP Germany 2008 ConferenceMeasuring the Security of Web Applications – Sebastian Schinzel
Wie messe ich Sicherheit prognostizierend?
Nutzlos wenn:• # Sicherheitslücken unbekannt
• Popularität gering• Verbreitung gering (Geschäfts-Applikationen?)
Alhazmi et al.
![Page 16: Measuring the Security of Web Applications - OWASP Foundation · 2020-01-17 · OWASP 3 OWASP Germany 2008 Conference Measuring the Security of Web Applications – Sebastian Schinzel](https://reader033.fdocuments.in/reader033/viewer/2022042915/5f51d1b88d22c02d4a0cde38/html5/thumbnails/16.jpg)
16OWASPOWASP Germany 2008 ConferenceMeasuring the Security of Web Applications – Sebastian Schinzel
Zählen von Schwachstellen...
Schwachstellen werden nicht immer publiziertIndividuelle Web-Applikationen haben keine
aussagekräftigen Daten über vergangeneSchwachstellen
Messen von Sicherheit schwieriger zu messen alsz.B. Stabilität
Zählen von Schwachstellen hat nur wenigAussagekraft über Sicherheit von Web-
Applikationen
![Page 17: Measuring the Security of Web Applications - OWASP Foundation · 2020-01-17 · OWASP 3 OWASP Germany 2008 Conference Measuring the Security of Web Applications – Sebastian Schinzel](https://reader033.fdocuments.in/reader033/viewer/2022042915/5f51d1b88d22c02d4a0cde38/html5/thumbnails/17.jpg)
17OWASPOWASP Germany 2008 ConferenceMeasuring the Security of Web Applications – Sebastian Schinzel
Neuer Versuch:
Suche nach Ursprung typischer Schwachstellen
Zähle Vorkommen dieser Anti-Patterns
![Page 18: Measuring the Security of Web Applications - OWASP Foundation · 2020-01-17 · OWASP 3 OWASP Germany 2008 Conference Measuring the Security of Web Applications – Sebastian Schinzel](https://reader033.fdocuments.in/reader033/viewer/2022042915/5f51d1b88d22c02d4a0cde38/html5/thumbnails/18.jpg)
18OWASPOWASP Germany 2008 ConferenceMeasuring the Security of Web Applications – Sebastian Schinzel
Software-Sicherheit: Wie messen?
Eingabevalidierung: Kreditkartennummer sollte
validiert werden “Ist das eine semantisch
korrekte Kreditkarten-Nummer?”
“Darf ein Vorname das Zeichen‘<‘ enthalten?”
Filtern, Löschen, Ablehnen?
Enkodierung von Datenausgaben: Daten müssen als Daten
markiert werden Ausgaben in HTML:
<b> --> <b&gr; Ausgaben in JavaScript
O’Neil --> O\’Neil Ausgaben in URL
Ja/Nein --> Ja%2fNein
Ursprung von Cross-Site-Scripting-Schwachstelle?
Keine ausreichende Trennung zwischen Benutzer-
Daten und HTML- oder JavaScript-Kommandos
![Page 19: Measuring the Security of Web Applications - OWASP Foundation · 2020-01-17 · OWASP 3 OWASP Germany 2008 Conference Measuring the Security of Web Applications – Sebastian Schinzel](https://reader033.fdocuments.in/reader033/viewer/2022042915/5f51d1b88d22c02d4a0cde38/html5/thumbnails/19.jpg)
19OWASPOWASP Germany 2008 ConferenceMeasuring the Security of Web Applications – Sebastian Schinzel
Software-Sicherheit: Wie messen?
Sicherheit soll Entscheidungungsgrundlage fürProduktwahl sein:“Ist Applikation A, oder Applikation B sicherer?”
Sicherheit verschiedener Systeme kann nur verglichenwerden, wenn Sicherheitsanforderungen gleich sind
Sicherheit kann nur im Vergleich mitSicherheitsanforderung bewertet werden
![Page 20: Measuring the Security of Web Applications - OWASP Foundation · 2020-01-17 · OWASP 3 OWASP Germany 2008 Conference Measuring the Security of Web Applications – Sebastian Schinzel](https://reader033.fdocuments.in/reader033/viewer/2022042915/5f51d1b88d22c02d4a0cde38/html5/thumbnails/20.jpg)
20OWASPOWASP Germany 2008 ConferenceMeasuring the Security of Web Applications – Sebastian Schinzel
Software-Sicherheit: Wie messen?
Beispiel (1): Sicherheitsanforderung: “Trennung vonBenutzerdaten und Kommandos bei HTML-Ausgabe”
Konzept: Definition einer Enkodierungs-Funktion f, dieBenutzereingaben A in HTML-Daten B überführt
Validierung: Ist f korrekt und vollständig? → Audit der
Implementierung von f Wurden alle HTML-Ausgaben bedacht? → “Anteil der
HTML-Ausgaben ohne Enkodierung durch f” Approximierung: Aufruf von f muss innerhalb von 5
Zeilen vor HTML-Ausgabe erfolgen Suche kann mit Source-Code-Scanner automatisiert
werden
![Page 21: Measuring the Security of Web Applications - OWASP Foundation · 2020-01-17 · OWASP 3 OWASP Germany 2008 Conference Measuring the Security of Web Applications – Sebastian Schinzel](https://reader033.fdocuments.in/reader033/viewer/2022042915/5f51d1b88d22c02d4a0cde38/html5/thumbnails/21.jpg)
21OWASPOWASP Germany 2008 ConferenceMeasuring the Security of Web Applications – Sebastian Schinzel
Software-Sicherheit: Wie messen?
Beispiel:OK:String str = request.getParam(“x”);str = f(str);response.write(“<b>” + str + ”</b>”);
Nicht OK:String str = request.getParam(“x”);response.write(“<b>” + str + ”</b>”);
![Page 22: Measuring the Security of Web Applications - OWASP Foundation · 2020-01-17 · OWASP 3 OWASP Germany 2008 Conference Measuring the Security of Web Applications – Sebastian Schinzel](https://reader033.fdocuments.in/reader033/viewer/2022042915/5f51d1b88d22c02d4a0cde38/html5/thumbnails/22.jpg)
22OWASPOWASP Germany 2008 ConferenceMeasuring the Security of Web Applications – Sebastian Schinzel
Software-Sicherheit: Wie messen?
Beispiel:Nicht OK:String str = request.getParam(“x”);
...
if(immer_wahr) {str = f(str);
}
...
response.write(“<b>” + str + ”</b>”);
![Page 23: Measuring the Security of Web Applications - OWASP Foundation · 2020-01-17 · OWASP 3 OWASP Germany 2008 Conference Measuring the Security of Web Applications – Sebastian Schinzel](https://reader033.fdocuments.in/reader033/viewer/2022042915/5f51d1b88d22c02d4a0cde38/html5/thumbnails/23.jpg)
23OWASPOWASP Germany 2008 ConferenceMeasuring the Security of Web Applications – Sebastian Schinzel
Software-Sicherheit: Wie messen?
Applikation A:100 HTML-Ausgaben
ohne Aufruf von f:CA1=100*0,1h=10h
1 Fehler in f: CA2=8hCA=CA1+CA2=18h
Applikation B:1000 HTML-Ausgaben
ohne Aufruf von f:CB1=1000*0,1h=100h
0 Fehler in f: CB2=0hCB=CB1+CB2=100h
Aufwand um Sicherheitsanforderung zu erfüllen?Entwickler benötigt 0,1 Stunden, um HTML-
Ausgabe mit Aufruf von f zu versehen
![Page 24: Measuring the Security of Web Applications - OWASP Foundation · 2020-01-17 · OWASP 3 OWASP Germany 2008 Conference Measuring the Security of Web Applications – Sebastian Schinzel](https://reader033.fdocuments.in/reader033/viewer/2022042915/5f51d1b88d22c02d4a0cde38/html5/thumbnails/24.jpg)
24OWASPOWASP Germany 2008 ConferenceMeasuring the Security of Web Applications – Sebastian Schinzel
Software-Sicherheit: Wie messen?
“Um Applikation A sicher gemäß derSicherheitsanforderung zu machen, ist einAufwand von 18 Entwicklerstunden nötig.”
“Um Applikation B sicher gemäß derSicherheitsanforderung zu machen, ist einAufwand von 100 Entwicklerstunden nötig.”
→ Gemäß der Sicherheitsanforderung istApplikation A zu bevorzugen
![Page 25: Measuring the Security of Web Applications - OWASP Foundation · 2020-01-17 · OWASP 3 OWASP Germany 2008 Conference Measuring the Security of Web Applications – Sebastian Schinzel](https://reader033.fdocuments.in/reader033/viewer/2022042915/5f51d1b88d22c02d4a0cde38/html5/thumbnails/25.jpg)
25OWASPOWASP Germany 2008 ConferenceMeasuring the Security of Web Applications – Sebastian Schinzel
Zusammenfassung
Software-Sicherheit im Web ist kritisch
Sicherheit ist kontra-intuitiv. Man muss messen, umwirklich verbessern zu können
Zählen von Schwachstellen hat nur wenigAussagekraft bei Web-Applikationen
Möglicher Weg: Leicht messbare Software-Qualitäts-Anforderungen mit direktem Einfluß auf
Software-Sicherheit
![Page 26: Measuring the Security of Web Applications - OWASP Foundation · 2020-01-17 · OWASP 3 OWASP Germany 2008 Conference Measuring the Security of Web Applications – Sebastian Schinzel](https://reader033.fdocuments.in/reader033/viewer/2022042915/5f51d1b88d22c02d4a0cde38/html5/thumbnails/26.jpg)
26OWASPOWASP Germany 2008 ConferenceMeasuring the Security of Web Applications – Sebastian Schinzel