toc

1. Introduction

Secure coding is not simply getting behind it's keyboard and hack, it is real engineering.

Why do bridges support trains for hundreds of years ?

How could an Eiffel Tower swing several meters sideways in the wind and still welcome thousands of visitors per day, without harm ?

Well engineering is taken serious. First there is an architectural model, which will provide design plans (blueprints), only then construction can start.

Why shouldn't we adopt this procedure too ?

Well we should !

2. Architecture

A security architecture is the process of selecting design elements and principles to match a defined security need. This implies to know how secure the program should become !

A good security architecture can be applied many times, to many applications and should serve as a framework for secure design decisions. A good advice is to work with an architectural document, where the different ascpects are laid down.

Architectural Document

Principles of security architecture

"A good theory should be as simple as possible - but not simpler." Albert Einstein

Exercice

What architectural principles where violated due to the TCP SYN flood attack ?

3. Design

Good design is the basis for an efficient software development process, as it not only enables to build a good defensive basis into the software from the begining, but provides safe foundations for future extensions and maintenance.

Secure design has to be elaborated thoroughly, the following steps being typical efforts to perform.

Principles of security design

Some special design issues

Security design is an important part of software engineering, and the above practices cover the global picture well, or ? Well what about software you didn't design, third-party libraries, existing applications, that have to be secured ? The following three issues are good design practices for those kind of special issues.

Exercice

List the 802.11 WEP (Wired Equivalence Privacy) design flaws.

4. Implementation

Unfortunately (already known since Morris's Internet Worm in early 1988) the most common implementation flaw is still the buffer overflow. Here some good implementation practices to fight them and others (of course).

Principles of security implementation

Exercice

Write a little auth program (preferably in Java).

Input: username and password

Ouput: to be defined !

5. Operation

Traditionally in many companies, the development staff and the operational staff are seperate and even sometimes thorough competitors. As should have become clear till know this is a very bad approach. Development and operations are two sides of the same coin.

Security is everybody's problem !

The operational level security measures can be seen as a layered system of practices.

Principles of security implementation

For bad practices check out the BOFH : http://bofh.ntk.net/Bastard.html

6. Testing

About automation and testing, some useful automation tools to test the finalized applications.

Exercice

Categorize these tools according coding phases.

pdf version