24
Software Architecture for Secure ECUs Rudolf Grave EB TechDay - June 2015

Software Architecture for Secure ECUs · Software Architecture for Secure ECUs Rudolf Grave EB TechDay-June 2015

Embed Size (px)

Citation preview

Page 1: Software Architecture for Secure ECUs · Software Architecture for Secure ECUs Rudolf Grave EB TechDay-June 2015

Software Architecture for Secure ECUs

Rudolf Grave

EB TechDay - June 2015

Page 2: Software Architecture for Secure ECUs · Software Architecture for Secure ECUs Rudolf Grave EB TechDay-June 2015

Agenda

© Elektrobit (EB), 2015 2

“No safety without security and vice versa”

Established Safety Concepts

Safety Analysis Methods for Security Analysis

Secure Software Architecture Extensions

Summary

Page 3: Software Architecture for Secure ECUs · Software Architecture for Secure ECUs Rudolf Grave EB TechDay-June 2015

The Car of the Future: Increased comfort – Increased potential for damage

• Autonomous Driving

‒ Highly safety-critical

‒ Requires latest data from the “cloud”

• Car-2-X Communication

‒ Communication with

• other cars

• infrastructure

• mobile phone or other devices

‒ ECUs have access to the on-board

network

“No safety without security and vice versa”

© Elektrobit (EB), 2015 3

Page 4: Software Architecture for Secure ECUs · Software Architecture for Secure ECUs Rudolf Grave EB TechDay-June 2015

“No safety without security and vice versa”

Recent security breaches

© Elektrobit (EB), 2015 4

Remote door unlock

• Attacker could open cars with fake SMS

• Various vulnerabilities:

‒ Partially unencrypted communication

‒ Provision of sensitive data

‒ Missing integrity checks

‒ Weak or identical encryption keys

‒ Replay attacks possible

OpenSSL “Heartbleed” vulnerability

• Sensitive data accessible via

maintenance function

• Encryption and maintenance functions

are technically unrelated

• Cause: implementation error

Page 5: Software Architecture for Secure ECUs · Software Architecture for Secure ECUs Rudolf Grave EB TechDay-June 2015

Agenda

© Elektrobit (EB), 2015 5

“No safety without security and vice versa”

Established Safety Concepts

Safety Analysis Methods for Security Analysis

Secure Software Architecture Extensions

Summary

Page 6: Software Architecture for Secure ECUs · Software Architecture for Secure ECUs Rudolf Grave EB TechDay-June 2015

Established Safety Concepts

Memory Partitioning

6© Elektrobit (EB), 2015

Safety OS

• Data Protection

• Stack Protection

• Context Protection

• OS Protection

• Hardware Error

management

Safety TimE Protection

• Alive supervision

• Deadline Monitoring

• Control flow monitoring

Safety E2E

Protection

MCAL (ASIL)

ASIL

CDD

QM

SW-Cs

BSW

MCAL

ASIL

SW-C

Safety

TimE

Protection

WdgMemory Partitions

AUTOSAR

OS

QM

Fu

nct

ion

s

Mic

roke

rne

l

Safety OS Safety RTE

OEM

modules

QM

CDD

Safety E2E

Protection

Safe communication

to other ECUs

Safety RTE

Protected

communication between

Memory Partitions

Page 7: Software Architecture for Secure ECUs · Software Architecture for Secure ECUs Rudolf Grave EB TechDay-June 2015

Established Safety Concepts

Time and Execution Protection

© Elektrobit (EB), 2015 7

Page 8: Software Architecture for Secure ECUs · Software Architecture for Secure ECUs Rudolf Grave EB TechDay-June 2015

Established Safety Concepts

Communication Protection

© Elektrobit (EB), 2015 8

Page 9: Software Architecture for Secure ECUs · Software Architecture for Secure ECUs Rudolf Grave EB TechDay-June 2015

Agenda

© Elektrobit (EB), 2015 9

“No safety without security and vice versa”

Established Safety Concepts

Safety Analysis Methods for Security Analysis

Secure Software Architecture Extensions

Summary

Page 10: Software Architecture for Secure ECUs · Software Architecture for Secure ECUs Rudolf Grave EB TechDay-June 2015

Safety Analysis Methods for Security Analysis

Static vs. Dynamic Threat Model

© Elektrobit (EB) 2015 10

Security: dynamic threat modelSafety: static threat model

• Threats are known at system design

• Threats are internal, e.g. random or

systematic faults

• Iterations improve existing model

with new knowledge

• New threats can emerge during

system operation

• Threats are external

• Intelligent opponent has to be

considered

Page 11: Software Architecture for Secure ECUs · Software Architecture for Secure ECUs Rudolf Grave EB TechDay-June 2015

Safety Analysis Methods for Security Analysis

Extending Safety Analysis to Security Analysis

• Safety and security rely on risk

models

• It´s crucial to recognize and use

synergies

• Extend hazard and risk analysis

with malicious attacker

‒ Attacker has access to all

communication channels

‒ Extend safety requirements with

security requirements

© Elektrobit (EB) 2015 11

Searching for security vulnerabilities

brings new safety exposures to light

and vice versa

SecuritySafety

Page 12: Software Architecture for Secure ECUs · Software Architecture for Secure ECUs Rudolf Grave EB TechDay-June 2015

Agenda

© Elektrobit (EB), 2015 12

“No safety without security and vice versa”

Established Safety Concepts

Safety Analysis Methods for Security Analysis

Secure Software Architecture Extensions

Summary

Page 13: Software Architecture for Secure ECUs · Software Architecture for Secure ECUs Rudolf Grave EB TechDay-June 2015

Secure Software Architecture Extensions

Using Partitioning to Protect Data

13

• Memory Partitioning

‒ Read protection

‒ Execution protection

⇒ Allow access to sensitive data

only for authorized tasks

• Stack Protection

‒ Stack protected via MPU

⇒ Prevention against

stack-overflow attacks

Security-Task

Stack

�Sensitive

Data

© Elektrobit (EB) 2015

Page 14: Software Architecture for Secure ECUs · Software Architecture for Secure ECUs Rudolf Grave EB TechDay-June 2015

Secure Software Architecture Extensions

Message Integrity

© Elektrobit (EB) 2015 14

Countermeasures

1. Encryption

‒ Unauthorized read, modification,

Impersonation of other user

2. Signatures

‒ Modification, Impersonation of other user

3. Integrity Checksums

‒ Modification

4. Message counters and timestamps

‒ Replay, Delay

Threats

1. Unauthorized message access

‒ Read, Modify, Delete

2. Impersonate other user

‒ Initiate communication

3. Temporal attacks

‒ Replay, Delay

MACs containing signatures and freshness values eliminate most threads

Page 15: Software Architecture for Secure ECUs · Software Architecture for Secure ECUs Rudolf Grave EB TechDay-June 2015

Secure Software Architecture Extensions

Message Authentication

© Elektrobit (EB) 2015 15

• MAC with key K

is appended to

message M

• Key is known to

sender and receiver

• Alterations from Eve

are detected by Bob

Alice

MACMAC

Eve

Message M

MAC (M,K)MAC (M,K)

M

Key K

MACMACM*

Bob

M

MAC`MAC`M`

MAC (M´,K)MAC

(M´,K)

K

?

Page 16: Software Architecture for Secure ECUs · Software Architecture for Secure ECUs Rudolf Grave EB TechDay-June 2015

Secure Software Architecture Extensions

AUTOSAR: E2E and SecOC

© Elektrobit (EB) 2015 16

Sender

• Unsafe channel between application

and SecOC module

‒ Protect message with CRC from E2E in

application

‒ Safe transport between ECUs

• SecOC transforms CRC to MAC

‒ Safe and secure transport between

ECUs

Receiver

• SecOC transforms MAC to CRC

• Application checks CRC

Page 17: Software Architecture for Secure ECUs · Software Architecture for Secure ECUs Rudolf Grave EB TechDay-June 2015

Secure Software Architecture Extensions

End-to-end protection with SecOC

© Elektrobit (EB) 2015 17

Single SecOC approach

• Use MAC algorithm also for message

integrity

• Place ASIL developed SecOC in

highest AUTOSAR layer

• Omit overhead for additional end-to-

end protection

Page 18: Software Architecture for Secure ECUs · Software Architecture for Secure ECUs Rudolf Grave EB TechDay-June 2015

Secure Software Architecture Extensions

AUTOSAR safety and security architecture

© Elektrobit (EB) 2015 18

• Safety OS

‒ Memory write (safety), read and execution

(security) protection

• TimE Protection

‒ Control flow monitoring (safety)

• E2E protection and SecOC

‒ Data integrity (safety, security)

‒ Authentication (security)

• Csm, CryShe

‒ Data encryption (security)

Page 19: Software Architecture for Secure ECUs · Software Architecture for Secure ECUs Rudolf Grave EB TechDay-June 2015

Secure Software Architecture Extensions

Csm, Cry, CryShe, Cal, Cpl,…

• AUTOSAR defines two sets of crypto routines

‒ Crypto service manager (CSM/CRY)

‒ Crypto abstraction library (CAL/CPL)

• Both AUTOSAR specifications subdivide crypto modules into two layers

‒ Interface layerSERVICES

‒ Implementation layerPRIMITIVES

• Only the interface layer is properly specified in AUTOSAR

‒ This layer is completely standardized

• Contents of the implementation layer are left open for customer options

‒ This layer implements customer specific solutions with a standardized interface to the interface layer

© Elektrobit (EB) 2015 19

Implementation layer

CRY

CSM CAL

Implementation layer

CPL

Interface layer

CSM

Interface layer

CAL

Page 20: Software Architecture for Secure ECUs · Software Architecture for Secure ECUs Rudolf Grave EB TechDay-June 2015

CryShe

Secure Software Architecture Extensions

Use case examples – Secure Hardware Extension

• Attainable security level in software is limited.

• New automotive ECUs offer a ‘Secure Hardware Extension (SHE)’ module.

‒ E.g. freescale Bolero 3M/Calypso, Infineon TC179x, Fujitsu Atlas-L family, Renesas RH850

• EB integrates the new hardware module with standard software.

• Development of drivers for SHE.

• Integration with AUTOSAR cryptographic module (Csm/CryShe).

• Tool driven configuration.

• We enable customers to easily switch between cryptographic routines in software and hardware.

© Elektrobit (EB), 2015 20

Application

AUTOSAR Csm

{

data = “42mil/h”;

key = 0x1234;

secure(data, key);

}

HardwareSHE module

Software implementation

Implementation layer

Cry

Interface layer

Csm

Page 21: Software Architecture for Secure ECUs · Software Architecture for Secure ECUs Rudolf Grave EB TechDay-June 2015

Secure Software Architecture Extensions

Outlook: Hypervisor setup

© Elektrobit (EB) 2015 21

Core1 Core2 Core3 Core4

QM

SWCs

Linux-

Application

Linux

ASIL

SWC

Autosar

Secure Hypervisor

HardwareHardware Security

Module (HSM)

SecOCCSM

CryHSM

E2E Lib

Inter OS communication

Page 22: Software Architecture for Secure ECUs · Software Architecture for Secure ECUs Rudolf Grave EB TechDay-June 2015

Agenda

© Elektrobit (EB), 2015 / Confidential 22

“No safety without security and vice versa”

Established Safety Concepts

Safety Analysis Methods for Security Analysis

Secure Software Architecture Extensions

Summary

Page 23: Software Architecture for Secure ECUs · Software Architecture for Secure ECUs Rudolf Grave EB TechDay-June 2015

Summary

Summary

• Extend safety analyses with security aspects

‒ Safety and security complement each other

‒ Employed methods are quite similar

• Safe and secure software architectures

‒ Use partitioning mechanisms for protection mechanisms

‒ Use secure authentication and integrity mechanisms for safe communication

• Hypervisors combines two worlds

‒ Access to board net via AUTOSAR

‒ Applications on e.g. Linux

‒ Protected communication through Firewall

© Elektrobit (EB) 2015 23

Page 24: Software Architecture for Secure ECUs · Software Architecture for Secure ECUs Rudolf Grave EB TechDay-June 2015

Thank you!

[email protected]

automotive.elektrobit.com