Feedback

Correctness-by-Construction for Correct and Secure Software Systems

Ensuring the safety and security of software systems is more important today than ever before, as critical domains (such as automotive, aviation, or healthcare systems) become increasingly software-intensive. Typically, such critical software is exhaustively tested, but testing alone cannot guarantee correctness. Therefore, formal approaches are required to ensure safety and security of the developed software. For functional correctness, post-hoc verification is the state-of-the-art. By post-hoc verification, we mean that a program is implemented, specified with a pre-/postcondition contract, and then verified. However, this approach has the downside that it does not provide guidelines for developers how to write correct code. If a program developed without guidelines cannot be verified, it is often difficult to find the root causes. It may be a faulty implementation or an unsuitable specification of the program. As a result, it is costly to debug the program and to verify it again. In terms of security, it is important to ensure confidentiality and integrity of processed data. Here, static and dynamic taint analysis approaches are prevalent, where data is labeled with a security level to analyze whether there is a prohibited flow from a secure source to a public sink as defined by a security policy. This post-hoc analysis has the same disadvantage as post-hoc verification, an incorrect program must be debugged and then reanalyzed to ensure that the vulnerability is fixed.
The general drawback of post-hoc analysis and verification techniques is that they reveal problems in the code, but do not assist in correcting them.

Correctness-by-Construction (CbC) is an alternative program development approach in which a program is directly constructed to be correct. Starting with a specified, but abstract program, a set of refinement rules is applied to refine the program into a concrete implementation. Each applied refinement rule guarantees that the program under development satisfies the initial specification. Thus, the resulting program is correct by construction. It is argued that with the CbC approach, defects are discovered at an early stage of development and can be resolved more easily through a structured program development approach. Despite these benefits, CbC has not yet become an established development approach for safety- and security-critical software. We identified three main reasons/challenges: (1) lack of tool support, (2) rigid program development due to the fine-grained refinement rules that allow only one program statement to be added at a time, (3) and no CbC approach to ensure non-functional properties, such as information flow security.

In this thesis, we provide remedy to the aforementioned challenges by establishing and supporting a correct-by-construction program development approach for functionally correct and secure programs. In particular, we make the following four contributions in this thesis. As a first contribution, we implement \corc, tool support for CbC. We determine the requirements to enable CbC for correct program development and develop tool support accordingly. \corc ensures that the correctness of the program under development is ensured in each construction step.
In the second contribution, we conduct user studies to determine the comprehensibility and usability of \corc.
In the user studies, we are able to analyze how developers proceed to solve programming tasks, what mistakes they make, and how they like using the tool. We compare these results to state-of-the-art program development with post-hoc verification. As third contribution, we address the rigid program development approach of classic CbC by considering new approaches that allow for more flexible program construction. We introduce new refinement rules that condense the application of other refinement rules. We also propose a new trait-based CbC development approach that is based on program composition instead of refinement rules. Since CbC only considers functional correctness up to our work, we extend CbC to also ensure secure information flow in our fourth contribution. We develop refinement rules that ensure program conformance with information flow security policies. At each refinement step, the information flow is analyzed to allow only secure program statements. The refinement rules are integrated into \corc to provide tool support for the constructive development of secure software, and we demonstrate the feasibility of \corc by correctly constructing several case studies. In summary, our work enables the development of functionally correct and secure programs using correctness-by-construction. This foundation can be used to determine whether CbC is a viable alternative to post-hoc verification or post-hoc analysis.

Die Gewährleistung der Sicherheit (funktionale Sicherheit und Datensicherheit) von Softwaresystemen ist heute wichtiger denn je, da kritische Bereiche (wie in der Automobilindustrie, der Luftfahrt oder dem Gesundheitswesen) immer softwareintensiver werden. In der Regel wird solche kritische Software umfassend getestet, aber Tests allein können die Korrektheit nicht garantieren. Daher sind formale Ansätze erforderlich, um die Sicherheit der entwickelten Software zu gewährleisten. Für funktionale Korrektheit ist die Post-hoc-Verifikation der Stand der Technik. Unter Post-hoc-Verifikation verstehen wir, dass ein Programm implementiert, mit einem Vor-/Nachbedingungsvertrag spezifiziert und dann verifiziert wird. Dieser Ansatz hat jedoch den Nachteil, dass er den Entwicklern keinen Leitfaden für das Schreiben von korrektem Code bietet. Wenn ein ohne Leitfaden entwickeltes Programm nicht verifiziert werden kann, ist es oft schwierig, die Ursachen dafür zu finden. Es kann sich um eine fehlerhafte Implementierung oder eine ungeeignete Spezifikation des Programms handeln. Dies hat zur Folge, dass es kostspielig ist, das Programm zu debuggen und erneut zu verifizieren. Im Hinblick auf die Datensicherheit ist es wichtig, die Vertraulichkeit und Integrität der verarbeiteten Daten zu gewährleisten. Hier sind statische und dynamische Taint-Analysen üblich, bei denen die Daten mit einer Sicherheitsstufe versehen werden, um zu analysieren, ob es einen Fluss von einer sicheren Quelle zu einer öffentlichen Senke gibt, der durch eine Sicherheitsrichtlinie verboten wurde. Diese Post-hoc-Analyse hat denselben Nachteil wie die Post-hoc-Verifizierung: Ein fehlerhaftes Programm muss korrigiert und dann neu analysiert werden, um sicherzustellen, dass die Schwachstelle behoben ist. Der allgemeine Nachteil von Post-hoc-Analyse- und Verifizierungstechniken besteht darin, dass sie zwar Probleme im Code aufdecken, aber nicht bei deren Behebung helfen.

Correctness-by-Construction (CbC) ist ein alternativer Ansatz zur Programmentwicklung, bei dem ein Programm direkt so konstruiert wird, dass es korrekt ist. Ausgehend von einem spezifizierten, aber abstrakten Programm wird eine Reihe von Verfeinerungsregeln angewendet, um das Programm in eine konkrete Implementierung zu verfeinern. Jede angewandte Verfeinerungsregel garantiert, dass das zu entwickelnde Programm die ursprüngliche Spezifikation erfüllt. Somit ist das resultierende Programm konstruktionsbedingt korrekt. Es wird argumentiert, dass mit dem CbC-Ansatz Fehler in einem frühen Stadium der Entwicklung entdeckt werden und durch einen strukturierten Programmentwicklungsansatz leichter behoben werden können. Trotz dieser Vorteile hat sich CbC noch nicht als Entwicklungsansatz für sicherheitskritische Software durchgesetzt. Wir haben drei Hauptgründe beziehungsweise Herausforderungen identifiziert: (1) fehlende Werkzeugunterstützung, (2) starre Programmentwicklung aufgrund der feinkörnigen Verfeinerungsregeln, die jeweils nur eine Programmanweisung hinzufügen (3) und fehlen eines CbC-Ansatzes zur Sicherstellung nicht-funktionaler Eigenschaften, wie z.B. der Informationsflusssicherheit.

In dieser Arbeit werden die zuvor genannten Herausforderungen adressiert, indem wir einen Correct-by-Construction-Programmentwicklungsansatz für funktional korrekte und datensichere Programme etablieren und unterstützen.
Insbesondere werden in dieser Arbeit die folgenden vier Beiträge geleistet. Als ersten Beitrag implementieren wir \corc, eine Werkzeugunterstützung für CbC. Wir bestimmen die Anforderungen, um eine korrekte Programmentwicklung mit CbC zu ermöglichen, und entwickeln eine entsprechende Werkzeugunterstützung. \corc stellt sicher, dass die Korrektheit des zu entwickelnden Programms in jedem Konstruktionsschritt gewährleistet ist.
Im zweiten Beitrag führen wir Benutzerstudien durch, um die Verständlichkeit und Benutzbarkeit von \corc zu ermitteln. In den Nutzerstudien können wir analysieren, wie Entwickler bei der Lösung von Programmieraufgaben vorgehen, welche Fehler sie machen und wie gerne sie das Werkzeug nutzen. Diese Ergebnisse werden mit der Programmentwicklung mit Post-hoc-Verifikation verglichen. Als dritten Beitrag adressieren wir den starren Programmentwicklungsansatz des klassischen CbC, indem wir neue Ansätze berücksichtigen, die eine flexiblere Programmkonstruktion ermöglichen. Wir führen neue Verfeinerungsregeln ein, die die Anwendung anderer Verfeinerungsregeln bündeln. Außerdem schlagen wir einen neuen Trait-basierten CbC-Entwicklungsansatz vor, der auf Programmkomposition anstelle von Verfeinerungsregeln basiert. Da CbC bis zu unserer Arbeit nur funktionale Korrektheit berücksichtigt hat, erweitern wir CbC in unserem vierten Beitrag, um auch einen sicheren Informationsfluss zu gewährleisten. Wir entwickeln Verfeinerungsregeln, die die Konformität des Programms mit den Informationsflusssicherheitsrichtlinien gewährleisten. Bei jedem Verfeinerungsschritt wird der Informationsfluss analysiert, um nur sichere Programmanweisungen zuzulassen. Die Verfeinerungsregeln werden in \corc integriert, um Werkzeugunterstützung für die konstruktive Entwicklung sicherer Software zu bieten, und wir demonstrieren die Praktikabilität von \corc, indem wir mehrere Fallstudien korrekt konstruieren. Insgesamt ermöglicht unsere Arbeit die Entwicklung von funktional korrekten und datensicheren Programmen mit Hilfe von Correctness-by-Construction. Auf dieser Grundlage kann festgestellt werden, ob CbC eine wirkliche Alternative zur Post-hoc-Verifikation oder Post-hoc-Analyse ist.

Preview

Cite

Citation style:
Could not load citation form.

Access Statistic

Total:
Downloads:
Abtractviews:
Last 12 Month:
Downloads:
Abtractviews:

Rights

License Holder: Die Lizenz gilt nicht für die angehängten Artikel, außer sie sind explizit gekennzeichnet

Use and reproduction: