elc 2013 security: best practices for embedded systems · 2016. 7. 6. · overview • embedded...

17
mentor.com/embedded Android is a trademark of Google Inc. Use of this trademark is subject to Google Permissions. Linux is the registered trademark of Linus Torvalds in the U.S. and other countries. John Mehaffey Senior System Architect Embedded Systems Division ELC 2013 Security: Best Practices for Embedded Systems

Upload: others

Post on 30-Aug-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ELC 2013 Security: Best Practices for Embedded Systems · 2016. 7. 6. · Overview • Embedded system, not IT system • Physical security is NOT possible • You do not own the

mentor.com/embedded

Android is a trademark of Google Inc. Use of this trademark is subject to Google Permissions.Linux is the registered trademark of Linus Torvalds in the U.S. and other countries.

John Mehaffey

Senior System Architect

Embedded Systems Division

ELC 2013Security:

Best Practices forEmbedded Systems

Page 2: ELC 2013 Security: Best Practices for Embedded Systems · 2016. 7. 6. · Overview • Embedded system, not IT system • Physical security is NOT possible • You do not own the

About Me

• Mobilinux Architect for MontaVista

• Automotive Architect for MontaVista

• Security Lead for GENIVI System Infrastructure Expert Group

• Senior System Architect for Mentor Embedded

2

Page 3: ELC 2013 Security: Best Practices for Embedded Systems · 2016. 7. 6. · Overview • Embedded system, not IT system • Physical security is NOT possible • You do not own the

Overview

• Embedded system, not IT system• Physical security is NOT possible

• You do not own the device!

• It’s not Fort Knox• If you ARE protecting FK (e.g. ATM), you need to go through

MUCH more than is presented here• Common Criteria

• Hackers are generally lazy• Don’t be “Low Hanging Fruit”

3

Page 4: ELC 2013 Security: Best Practices for Embedded Systems · 2016. 7. 6. · Overview • Embedded system, not IT system • Physical security is NOT possible • You do not own the

You Don’t Have to Outrun the Bear!

4

Page 5: ELC 2013 Security: Best Practices for Embedded Systems · 2016. 7. 6. · Overview • Embedded system, not IT system • Physical security is NOT possible • You do not own the

Black Hats

• Script Kiddies

• Opportunists• Insiders

• Bots

• Grudge hackers

• Organized• “Hacktivist”

• Organized Crime

• Nation States (Government)

5

Page 6: ELC 2013 Security: Best Practices for Embedded Systems · 2016. 7. 6. · Overview • Embedded system, not IT system • Physical security is NOT possible • You do not own the

Design Best Practices• Root of trust

• Secure boot

• OTP

• Hardware Assisted Security

• Harden your hardware• Reduce Electromagnetic Emissions

• Limit access to Hardware• Potting

• Hardware crypto module

• Be wary of GPLv3• Update mechanism may need to accept unverified code• OTP “modified” flag inside crypto module

6

Page 7: ELC 2013 Security: Best Practices for Embedded Systems · 2016. 7. 6. · Overview • Embedded system, not IT system • Physical security is NOT possible • You do not own the

Design Best Practices (continued)• Linux Security Modules

• Design it in from the start

• SELinux• Most Complete, hardest to configure

• AppArmor• Path Based

• SMACK• “Simplified”

• Many more …

• Plan for field updates• Push vs Pull

7

Page 8: ELC 2013 Security: Best Practices for Embedded Systems · 2016. 7. 6. · Overview • Embedded system, not IT system • Physical security is NOT possible • You do not own the

Protect your Data

• Data at rest• Ecryptfs

• Data in motion• SSL, TLS

• IPsec

8

Page 9: ELC 2013 Security: Best Practices for Embedded Systems · 2016. 7. 6. · Overview • Embedded system, not IT system • Physical security is NOT possible • You do not own the

Development Best Practices

• Code Reviews

• Comments!

• Coding Standards

• Simplicity• “Constructs in programming languages that are difficult

to use properly can be a large source of vulnerabilities”

• Randomize!• PAX patches (ASLR, etc)

• Keep your entropy up• Enroll your IRQs

• Haveged

9

Page 10: ELC 2013 Security: Best Practices for Embedded Systems · 2016. 7. 6. · Overview • Embedded system, not IT system • Physical security is NOT possible • You do not own the

Static Analysis Tools

• Compiler • Wformat, Wformat-security, Wall, Werror, Wpedantic

• fstack-protector, fstack-protector-all

• D_FORTIFY_SOURCE=2• http://en.wikipedia.org/wiki/List_of_tools_for_static_code_analysis

• Lint, Jlint, Splint, PyLint, …

• Abash, Boon, Clang, Oink, RATS, UNO, Yasco, …

• Black Duck, Coverity, Klocwork, Rational, …

10

Page 11: ELC 2013 Security: Best Practices for Embedded Systems · 2016. 7. 6. · Overview • Embedded system, not IT system • Physical security is NOT possible • You do not own the

Testing Best Practices

• QA Plan

• Test error paths!

• Coverage analysis• gcov

11

Page 12: ELC 2013 Security: Best Practices for Embedded Systems · 2016. 7. 6. · Overview • Embedded system, not IT system • Physical security is NOT possible • You do not own the

Dynamic Analysis Tools

• Dmalloc, Electric Fence, mtrace, mpatrol, …

• Valgrind, …

• Avalanche, Glassbox, gperftools, jrat, …

• Purify, Rational, …

12

Page 13: ELC 2013 Security: Best Practices for Embedded Systems · 2016. 7. 6. · Overview • Embedded system, not IT system • Physical security is NOT possible • You do not own the

Pre-Deployment Best Practices

• Close your ports

• Limit access as much as possible

• Don’t assume obscurity will protect you

• Run hacker tools• nmap

• Metasploit/Armitage

• John the Ripper

• ………..

• Hire a professional for evaluation!• Penetration test

13

Page 14: ELC 2013 Security: Best Practices for Embedded Systems · 2016. 7. 6. · Overview • Embedded system, not IT system • Physical security is NOT possible • You do not own the

Obscurity is not a defense

This month (Feb 2013), security researchers found a critical vulnerability in the Tridium Niagara Industrial control system, allowing hackers to obtain administrator logins and passwords. The system is widely used by the military, hospitals and factories to control surveillance, alarms, door locks, …

Last year, the company said it believed attacks on its systems were unlikely because the systems were obscure and hackers didn’t traditionally target such systems.

14

Page 15: ELC 2013 Security: Best Practices for Embedded Systems · 2016. 7. 6. · Overview • Embedded system, not IT system • Physical security is NOT possible • You do not own the

Post-Deployment Best Practices

• Perfection is not possible• Follow the lists

• Deploy fixes

15

Page 16: ELC 2013 Security: Best Practices for Embedded Systems · 2016. 7. 6. · Overview • Embedded system, not IT system • Physical security is NOT possible • You do not own the

The Attacks

• Timing attacks

• Fault Attacks

• Power Analysis

• Port Scans

• DoS

• Escalation of privilege• rootkits

16

Page 17: ELC 2013 Security: Best Practices for Embedded Systems · 2016. 7. 6. · Overview • Embedded system, not IT system • Physical security is NOT possible • You do not own the

The Defense• Timing attacks

• Randomize

• Fault Attacks• Code review, test

• Power Analysis• Randomize inside Crypto module

• Port Scans• Close them

• DoS• Limit resource usage (cgroups)

• Escalation of Privilege• MAC

17