SlideShare a Scribd company logo
1 of 40
Download to read offline
TURVALLINEN OHJELMOINTI
WHAT COULD POSSIBLY
GO WRONG?
Antti Virtanen, Software Architect
antti.virtanen@solita.fi,
Twitter: @Anakondantti
Yli
600ammattilaista
Toimimme
5paikkakunnalla
Liikevaihto
59milj. euroa v. 2016
Jo
20vuotta
Kasvua
18%vuonna 2016
Yli
1000projektia
SOLITA TÄNÄÄN
Vuoden työnantaja
1.vuonna 2017
Asiakkaistamme
94 %suosittelee meitä
When you play the game of
secure programming
You either win
Or you die.
PERIAATTEITA
› Koodin pitäisi olla yksinkertaista.
› Syöte on viallista. Jopa pahantahtoista.
• Huolehdi virhekäsittelystä.
• Käytä valmiita kirjastoja.
› Ohjelmoijien pitäisi opetella hakkerointia.
› Automaattitarkistimiapitäisi käyttää.
› Jos mahdollista, ohjelmointikielen pitäisi olla “turvallinen”.
› Käytä tarkistuslistoja.
There  are  two  ways  of  
constructing  a  software  
design:  
One  way  is  to  make  it  so  
simple  that  there  
are obviously no  
deficiencies,  and  the  other  
way  is  to  make  it  so  
complicated  that  there  are  
no obvious deficiencies.  
The  first  method  is  far  more  
difficult.
C.A.R. Hoare, Turing Award lecture 1980
IN ORACLE JAVA WE TRUST ?
SUN.SECURITY.SSL.SUNX509KEYMANAGERIMPL
OPENSSL? (HEARTBLEEDIN JÄLKEEN)
HTTPS://GITHUB.COM/OPENSSL/OPENSSL/BLOB/MASTER/SSL/SSL_CERT.C
283 ISSUES, 110 PULL REQUESTS..
.. HE OVATKIN
AMMATTILAISIA..
ENTÄS ME?
Right..
2000-­LUKU SOITTI JA HALUAA JSP-­
SIVUNSA TAKAISIN
HTTPS://DOCS.ORACLE.COM/CD/A97336_01/BUSLOG.102/A83726/BASICS7.HTM
https://xkcd.com/327/
MIKÄ VOISI MENNÄ PIELEEN..
EI IHAN TEOREETTINEN TILANNE..
KOODAAJILLA ON TAIKAVOIMIA
Kuva:ModeemiRy.
2017 SPRING BOOT+JAVA = TAIKAA
REST magic
Deps magic
HTTP magic
DB + ORM magic
HTTP magic
REST magic
KENELTÄ SINÄ OLET
TAIKAVOIMASI
SAANUT?
http://blog.npmjs.org/post/163723642530/crossenv-malware-on-the-npm-registry
WAT ?
https://www.theregister.co.uk/2016/03/23/npm_left_pad_chaos
NPM, YOUR STAFF IS BROKEN
RIIPPUVUUKSIA RIITTÄÄ
PERIAATTEET, STATUS
PERIAATTEITA
› Koodin pitäisi olla yksinkertaista.
› Syöte on viallista. Jopa pahantahtoista.
• Huolehdi virhekäsittelystä.
• Käytä valmiita kirjastoja.
› Ohjelmoijien pitäisi opetella hakkerointia.
› Automaattitarkistimiapitäisi käyttää.
› Jos mahdollista, ohjelmointikielen pitäisi olla “turvallinen”.
› Käytä tarkistuslistoja.
SULLE SALAISUUDEN KERTOA MÄ
VOISIN
YKSINKERTAISIA VIRHEITÄ..
.. LÖYTYISI STAATTISELLA
ANALYYSILLÄ
Koodiesimerkkieräästäsemitärkeästäprojektista2017vuodelta..
PERIAATTEET, STATUS
PERIAATTEITA
› Koodin pitäisi olla yksinkertaista.
› Syöte on viallista. Jopa pahantahtoista.
• Huolehdi virhekäsittelystä.
• Käytä valmiita kirjastoja.
› Ohjelmoijien pitäisi opetella hakkerointia.
› Automaattitarkistimiapitäisi käyttää.
› Jos mahdollista, ohjelmointikielen pitäisi olla “turvallinen”.
› Käytä tarkistuslistoja.
GRACE HOPPER..
OHJELMOINTIKIELI!
MAINIO AJATUS!
OHJELMOINTIKIELET TARJOAVAT..
› Abstraktioita: Funktiot, moduulit, oliot, luokat
› Funktionaalinen ohjelmointi
• Higher-order funktiot
• Lambdat
› Käännösaikainen ohjelmointi
• Template meta-ohjelmointi + constraints ? (C++ & Boost)
• Lisp makrot
› Tyypitys?
• Staattinen, jopaHindley-Milner ?
• Valinnainen, clojure.spec tyyliin?
”Indeed, it is becoming
increasingly clear, that for modern
programs correctness rather than
speed is the paramount concern.”
Crafting a compiler with C, 1991
.. JAVASCRIPT.. ..
TARKISTUSLISTAT
› Parhaimmillaan erittäin toimiva
› Mutta miten saada ihmiset käyttämään näitä?
Solitanchecklist HTTP headereista..
PERIAATTEET, STATUS
PERIAATTEITA
› Koodin pitäisi olla yksinkertaista.
› Syöte on viallista. Jopa pahantahtoista.
• Huolehdi virhekäsittelystä.
• Käytä valmiita kirjastoja.
› Ohjelmoijien pitäisi opetella hakkerointia.
› Automaattitarkistimiapitäisi käyttää.
› Jos mahdollista, ohjelmointikielen pitäisi olla “turvallinen”.
› Käytä tarkistuslistoja.
MITEN ASIAT VOISIVAT
OLLA....
AUTOMAATTITESTIEN
ULOTTUVUUS..
OHJELMIEN TODISTAMINEN
HTTPS://BLOG.MOZILLA.ORG/SECURITY/2017/09/13/VERIFIED-­CRYPTOGRAPHY-­FIREFOX-­57/
ABSTRAKTIOIDEN VOIMA..
KORTTITALON RAKENTAMINEN
Periaatteet: yksinkertainen, automaattitarkistettu, virhekäsittely
Oikeat työkalut
(tarvittaessa itse
tehdään lisää)
Koulutus ja ohjeet
Asenne ja halu
Jakaminen ja
kehitys
Valmiit palat
(tarvittaessa itse
tehdään lisää)
Testaus
(fuzz, hakkeritestaus, normaali testaus..
TTY turvallinen ohjelmointi 2017

More Related Content

Featured

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

TTY turvallinen ohjelmointi 2017