p Industrial case study: Zero defect secure software for ... · Zero defect secure software for the...

34
Copyright © Praxis High Integrity Systems Limited 2006 Slide 0 p Industrial case study: Zero defect secure software for the National Security Agency Martin Croxford CEng MBCS Praxis High Integrity Systems Bath, UK

Transcript of p Industrial case study: Zero defect secure software for ... · Zero defect secure software for the...

Page 1: p Industrial case study: Zero defect secure software for ... · Zero defect secure software for the National Security Agency ... “This project has provided further evidence for

Copyright © Praxis High Integrity Systems Limited 2006 Slide 0

p Industrial case study: Zero defect secure software for the National Security Agency

Martin Croxford CEng MBCS

Praxis High Integrity SystemsBath, UK

Page 2: p Industrial case study: Zero defect secure software for ... · Zero defect secure software for the National Security Agency ... “This project has provided further evidence for

Copyright © Praxis High Integrity Systems Limited 2006 Slide 1

p “Management summary”

• EAL5+ viewed as too difficult, too expensive or both. But EAL5+ standard applications increasingly in demand.

• NSA evaluated CbyC to determine its effectiveness at EAL5+

• NSA reported CbyC “Produces code more quickly and reliably and at lower cost than traditional methods”

• CbyC represents state of the art secure software engineering practice. CbyC can be learnt by competent engineers.

Page 3: p Industrial case study: Zero defect secure software for ... · Zero defect secure software for the National Security Agency ... “This project has provided further evidence for

Copyright © Praxis High Integrity Systems Limited 2006 Slide 2

p Agenda

• Project Goals• Tokeneer Identification System• What is Correctness by Construction?• CbyC applied to TIS• Feedback from NSA• Conclusions

Page 4: p Industrial case study: Zero defect secure software for ... · Zero defect secure software for the National Security Agency ... “This project has provided further evidence for

Copyright © Praxis High Integrity Systems Limited 2006 Slide 3

p Agenda

• Project Goals• Tokeneer Identification System• What is Correctness by Construction?• CbyC applied to TIS• Feedback from NSA• Conclusions

Page 5: p Industrial case study: Zero defect secure software for ... · Zero defect secure software for the National Security Agency ... “This project has provided further evidence for

Copyright © Praxis High Integrity Systems Limited 2006 Slide 4

p The MULTOS CA System

“This project has provided further evidence for the benefits of formality, in terms of rigour and predictability”

- MXI Head of Security

• System to support smart card security• Demanding requirements:

– Security: ITSEC Level E6 (EAL 7)– Availability: 6 months non-stop (24x7)– COTS h/w and s/w (eg NT) plus bespoke h/w and s/w

• Key metrics:– 0.04 defects/KSLOC; 28 SLOC/day; 1 year warranty

Page 6: p Industrial case study: Zero defect secure software for ... · Zero defect secure software for the National Security Agency ... “This project has provided further evidence for

Copyright © Praxis High Integrity Systems Limited 2006 Slide 5

p Project Goals

• Demonstrate that Common Criteria requirements for EAL5 are achievable in a cost effective manner

• Show how the Praxis “Correctness by Construction” approach matches up to EAL5.

• Measure productivity and defect rates under controlled conditions.

Page 7: p Industrial case study: Zero defect secure software for ... · Zero defect secure software for the National Security Agency ... “This project has provided further evidence for

Copyright © Praxis High Integrity Systems Limited 2006 Slide 6

p Agenda

• Project Goals• Tokeneer Identification System• What is Correctness by Construction?• CbyC applied to TIS• Feedback from NSA• Conclusions

Page 8: p Industrial case study: Zero defect secure software for ... · Zero defect secure software for the National Security Agency ... “This project has provided further evidence for

Copyright © Praxis High Integrity Systems Limited 2006 Slide 7

p Tokeneer Identification Station Background

• Tokeneer – originally developed by NSA– Demonstrates use of smart cards

and biometrics for access control• ID Station

– One component of Tokeneer– Provides user authentication

Page 9: p Industrial case study: Zero defect secure software for ... · Zero defect secure software for the National Security Agency ... “This project has provided further evidence for

Copyright © Praxis High Integrity Systems Limited 2006 Slide 8

p What is TOKENEER ?

Protected Enclave

ID Station(TIS)

FingerprintReader Display Token

Reader

EnrolmentStation

CertificateAuthority

(CA)

AttributeAuthority

(AA)

TokenReader

Work-station

Work-station

Work-station

Admin

Portal

Alarm

• Provides protection to secure information held on a network of workstations situated in a physically secure enclave.

• Demonstrates use of Smart Cards and Biometrics

Page 10: p Industrial case study: Zero defect secure software for ... · Zero defect secure software for the National Security Agency ... “This project has provided further evidence for

Copyright © Praxis High Integrity Systems Limited 2006 Slide 9

p Agenda

• Project Goals• Tokeneer Identification System• What is Correctness by Construction?• CbyC applied to TIS• Feedback from NSA• Conclusions

Page 11: p Industrial case study: Zero defect secure software for ... · Zero defect secure software for the National Security Agency ... “This project has provided further evidence for

Copyright © Praxis High Integrity Systems Limited 2006 Slide 10

p What is Correctness by Construction?

• A process, techniques and tools for developing high-integrity software– Has been applied by Praxis and its customers for fifteen

years, on projects in aerospace, defence, transportation, telecomms and finance

• Philosophy: make it difficult to introduce defects And: eliminate defects as early as possible

• Possible ONLY by introducing precision and logical reasoning about each step in the development of the software– Demonstrate correctness through the way it is

produced…– …not JUST on observing operational behaviour (or test

results)• Avoids the code/test/debug bottleneck• Consistent with SW01, ESARR 6, (00-55), (DO-178C),

Common Criteria EAL5+

Page 12: p Industrial case study: Zero defect secure software for ... · Zero defect secure software for the National Security Agency ... “This project has provided further evidence for

Copyright © Praxis High Integrity Systems Limited 2006 Slide 11

p The seven principles of CbyC

• Write right (use sound, formal notations)

• Step, don’t leap (small semantic steps)

• Say something once, why say it again? (avoid repetition)

• Check here before going there (verify early)

• Argue your corner (document justifications)

• Screws: use a screwdriver, not a hammer (use the tool appropriate for the job)

• Brains ‘R’ Us (don’t turn the handle)

• Generate evidence as you go

Page 13: p Industrial case study: Zero defect secure software for ... · Zero defect secure software for the National Security Agency ... “This project has provided further evidence for

Copyright © Praxis High Integrity Systems Limited 2006 Slide 12

p Summary of key aspects of Correctness by Construction

• Industrial strength requirements engineering (REVEAL)– Understand underlying business objectives– Understand domain: environment/context– Explicitly address conflict and change

• Cost-effective, pragmatic application of mathematical methods– Eg completeness of specification, proof of absence of

deadlock in design• Emphasis on static analysis

– Both tool-supported (SPARK) and manual– Eg proof of absence of run-time errors

Requirements

SoftwareSpec

HighLevel

Design

Code

Test Spec

SoftwareBuild

DetailedDesigns

ModuleSpec

Page 14: p Industrial case study: Zero defect secure software for ... · Zero defect secure software for the National Security Agency ... “This project has provided further evidence for

Copyright © Praxis High Integrity Systems Limited 2006 Slide 13

p Agenda

• Project Goals• Tokeneer Identification System• What is Correctness by Construction?• CbyC applied to TIS• Feedback from NSA• Conclusions

Page 15: p Industrial case study: Zero defect secure software for ... · Zero defect secure software for the National Security Agency ... “This project has provided further evidence for

Copyright © Praxis High Integrity Systems Limited 2006 Slide 14

p TIS Development Process

Page 16: p Industrial case study: Zero defect secure software for ... · Zero defect secure software for the National Security Agency ... “This project has provided further evidence for

Copyright © Praxis High Integrity Systems Limited 2006 Slide 15

p 1. Requirements Analysis

• Praxis REVEAL® Process– Identify system boundaries– Clarify dependencies on the

environment– Key scenarios identified

Page 17: p Industrial case study: Zero defect secure software for ... · Zero defect secure software for the National Security Agency ... “This project has provided further evidence for

Copyright © Praxis High Integrity Systems Limited 2006 Slide 16

p 2. Security Analysis

• Security Target and Security Policy Model using Protection Profile

• Identify key properties to ensure security• Specify security properties using Z

Page 18: p Industrial case study: Zero defect secure software for ... · Zero defect secure software for the National Security Agency ... “This project has provided further evidence for

Copyright © Praxis High Integrity Systems Limited 2006 Slide 17

p 3. Specification

• Abstract Model of System using Z Notation– Defines and documents functional

requirements– includes interfaces and observable behaviour– excludes internal detail (such as what was

audited and format of certificates)• Assurance

– Customer feedback– validation that specification meets security

properties– rigorous checks on initial state and operation

preconditions

Page 19: p Industrial case study: Zero defect secure software for ... · Zero defect secure software for the National Security Agency ... “This project has provided further evidence for

Copyright © Praxis High Integrity Systems Limited 2006 Slide 18

p 4. Design (Formal)

• Concrete Model of System using Z Notation– Refinement of Formal Specification– Introduces internal detail– Concrete model of certificates and audit log– Resolved all non-determinism in Spec

• Assurance– Sample of Refinement proofs (inc. audit log)

Page 20: p Industrial case study: Zero defect secure software for ... · Zero defect secure software for the National Security Agency ... “This project has provided further evidence for

Copyright © Praxis High Integrity Systems Limited 2006 Slide 19

p 4. Design (INFORMED)

• Defines structure of implementation modules• Identify and locate state, types and operations

– Relates Abstract SPARK state to Z state– Relates SPARK types to Z types– Relates SPARK Ops to Z operation Schemas

• Other Design issues– Constraints not modelled in Z– Detailed file formats

Page 21: p Industrial case study: Zero defect secure software for ... · Zero defect secure software for the National Security Agency ... “This project has provided further evidence for

Copyright © Praxis High Integrity Systems Limited 2006 Slide 20

p 5. Implementation

• SPARK Ada for core– Static analysis using SPARK Examiner

•Flow and proof annotations •Data-Flow / Information-Flow Analysis •Run-time Error checking •done before code review

• Thin layer of Ada interfacing to support software• Assurance

– Proof of some security properties– 93% VCs discharged automatically

Page 22: p Industrial case study: Zero defect secure software for ... · Zero defect secure software for the National Security Agency ... “This project has provided further evidence for

Copyright © Praxis High Integrity Systems Limited 2006 Slide 21

p 6. System Testing

• System Testing only– Incremental builds with increasing

functionality– Tests derived from refined specification– Specified as test scenarios with expected

results (visual and audited events)– Coverage analysis

•100% statement coverage•100% branch coverage

• Static analysis removes need for expensive module testing

Page 23: p Industrial case study: Zero defect secure software for ... · Zero defect secure software for the National Security Agency ... “This project has provided further evidence for

Copyright © Praxis High Integrity Systems Limited 2006 Slide 22

p Assurance process

SPARKImplementation

INFORMEDDesign

Formal Design

FormalSpecification

SecurityProperties

Proof of SecurityProperties

(Z)

Proof of FormalSpecification

(Z)

Refinement Proofof Formal Design

(Z)

Proof of SecurityProperties

(SPARK Proof)

Proof ofFunctionalProperties

(SPARK Proof)

Static Analysis

AssuranceActivity

KeySystem Test

System TestSpecification

Page 24: p Industrial case study: Zero defect secure software for ... · Zero defect secure software for the National Security Agency ... “This project has provided further evidence for

Copyright © Praxis High Integrity Systems Limited 2006 Slide 23

p Development Statistics

881822,2403,697Support

3820316,5649,939Core

LOC/day overall

LOC/daycoding

SPARKAda Source Lines

• Total effort - 260 man days

• Team - 3 people part-time

• Total schedule - 9 months elapsed

Page 25: p Industrial case study: Zero defect secure software for ... · Zero defect secure software for the National Security Agency ... “This project has provided further evidence for

Copyright © Praxis High Integrity Systems Limited 2006 Slide 24

p Independent Assessment

• Performed by SPRE Inc.• Developed Reliability Requirements• Automated test Environment simulated 1-year’s

activity.• Analysis of Results

Page 26: p Industrial case study: Zero defect secure software for ... · Zero defect secure software for the National Security Agency ... “This project has provided further evidence for

Copyright © Praxis High Integrity Systems Limited 2006 Slide 25

p Reliability Demonstration Chart(minor failures)

• Reliability objectives for TIS were met– 2 minor failures in user documentation.– No major or critical failures (i.e. zero defects)

Page 27: p Industrial case study: Zero defect secure software for ... · Zero defect secure software for the National Security Agency ... “This project has provided further evidence for

Copyright © Praxis High Integrity Systems Limited 2006 Slide 26

p Agenda

• Project Goals• Tokeneer Identification System• What is Correctness by Construction?• CbyC applied to TIS• Feedback from NSA• Conclusions

Page 28: p Industrial case study: Zero defect secure software for ... · Zero defect secure software for the National Security Agency ... “This project has provided further evidence for

Copyright © Praxis High Integrity Systems Limited 2006 Slide 27

p Customer’s View – Using Z

• Early step from English to Z is crucial part of process

• Customer must validate that this step has been achieved correctly

• Experience indicates that with good instruction a reading knowledge of Z can be acquired in a few days.– Good explanatory English important– Plan access to a Z expert

Page 29: p Industrial case study: Zero defect secure software for ... · Zero defect secure software for the National Security Agency ... “This project has provided further evidence for

Copyright © Praxis High Integrity Systems Limited 2006 Slide 28

p Customer’s View – Other steps

• Review of later development output simplified by:– small steps taken at each stage– preservation of structure

• Required SPARK expertise– Need a reading knowledge of SPARK– Familiarity with SPARK tools to

perform spot-checking of proofs.

Page 30: p Industrial case study: Zero defect secure software for ... · Zero defect secure software for the National Security Agency ... “This project has provided further evidence for

Copyright © Praxis High Integrity Systems Limited 2006 Slide 29

p NSA on Correctness by Construction

“Produces code more quickly and reliably and at lower cost than traditional methods”

“Reasonable learning curve”

“Correctness by Construction is proven and practical”

Randolph Johnson, National Security Agency

Page 31: p Industrial case study: Zero defect secure software for ... · Zero defect secure software for the National Security Agency ... “This project has provided further evidence for

Copyright © Praxis High Integrity Systems Limited 2006 Slide 30

p Agenda

• Project Goals• Tokeneer Identification System• What is Correctness by Construction?• CbyC applied to TIS• Feedback from NSA• Conclusions

Page 32: p Industrial case study: Zero defect secure software for ... · Zero defect secure software for the National Security Agency ... “This project has provided further evidence for

Copyright © Praxis High Integrity Systems Limited 2006 Slide 31

p National Cyber Security Partnership - Secure software task force report

• Formed in response to the White House National Strategy to Secure Cyberspace

• A primary cause of security problems is software with vulnerabilities caused by defects

• Practices leading to low-defect software are to be encouraged

• Only three effective practices identified:– Praxis’s Correctness by Construction– Team Software Process– Cleanroom

• www.cyberpartnership.org/SDLCFULL.pdf

Page 33: p Industrial case study: Zero defect secure software for ... · Zero defect secure software for the National Security Agency ... “This project has provided further evidence for

Copyright © Praxis High Integrity Systems Limited 2006 Slide 32

p Conclusions from NSA case study

• CbyC – Produces high quality, low defect software – Is cost effective– Conforms to Common Criteria EAL5+ – Can be learnt quickly and effectively

• EAL5 and above is achievable and cost effective using current best practice software engineering

• There is no longer any excuse for avoiding EAL5+

Page 34: p Industrial case study: Zero defect secure software for ... · Zero defect secure software for the National Security Agency ... “This project has provided further evidence for

Copyright © Praxis High Integrity Systems Limited 2006 Slide 33

p

Praxis High Integrity Systems Limited20 Manvers StreetBath BA1 1PXUnited Kingdom

Martin Croxford CEng MBCSBusiness ManagerEmail: [email protected]: +44 (0) 7881 516750

Telephone: +44 (0) 1225 8237941Facsimile: +44 (0) 1225 469006Website: www.praxis-his.com