SlideShare a Scribd company logo
1 of 63
Download to read offline
ID-kaardist 100%
             Tartu 2009
 Martin Paljak / martin.paljak.pri.ee




                                        1
ID-kaart ja selle infrastruktuur on kõige
odavam ja kõige turvalisem kohe kasutatav
    vahend Eesti IT lahenduste turvamisel.




                                               2
Kes?
• Vabavaralise kiipkaarditarkvara torkija
  aastast 2003
  • OpenSC - OSS Eesti ID-kaardi draiver
  • Pinpadi tugi OSS softis
• Võib sõimata, et mõnel platvormil kaart nii
  niglalt töötab või tänada, et mõnel üldse
  töötab.


                                                3
Millest jutt?
• “Mida peaks iga (ID-kaardi) tarkvara arendaja
  teadma ID-kaardi tarkvara komponentidest”
  • Mis on ID-kaardil
  • Kuidas kaardil olev jõuab rakendustesse
  • Mida tuntud ja vähemtuntud rakendused
    teevad
• Kuidas (vähemtuntud) tarkvara ID-kaardiga
  räägib

                                                  4
Mis on kaardil
• Isikuandmete fail (ebahuvitav)
•   2x kaardil genereeritud 1024b RSA salajast võtit
    “2346267345273468354127346981236459182213847619283469183764596723817263871623871263871638612387615”




• 2x X509 sertifikaati, Sertifitseerimiskeskusest
    Võti      “Martin Paljak, 38207162722, martin.paljak@eesti.ee”


• 2x PIN koodi (4/5..12 märki)
• 1x PUK kood (8..12 märki)
                                                                                                          5
ID-kaardiga saab ...




                       6
ID-kaardiga saab ...
• Brauseriga panka/e-riiki logida (SSL/TLS)




                                              6
ID-kaardiga saab ...
• Brauseriga panka/e-riiki logida (SSL/TLS)
• Dokumente ja makseid allkirjastada




                                              6
ID-kaardiga saab ...
• Brauseriga panka/e-riiki logida (SSL/TLS)
• Dokumente ja makseid allkirjastada
• Arvutisse logida



                                              6
ID-kaardiga saab ...
• Brauseriga panka/e-riiki logida (SSL/TLS)
• Dokumente ja makseid allkirjastada
• Arvutisse logida
• ...


                                              6
ID-kaardiga saab ...
• Brauseriga panka/e-riiki logida (SSL/TLS)
• Dokumente ja makseid allkirjastada
• Arvutisse logida
• ...
• OpenSSH

                                              6
ID-kaardiga saab ...
• Brauseriga panka/e-riiki logida (SSL/TLS)
• Dokumente ja makseid allkirjastada
• Arvutisse logida
• ...
• OpenSSH
• OpenVPN
                                              6
ID-kaardiga saab ...
• Brauseriga panka/e-riiki logida (SSL/TLS)
• Dokumente ja makseid allkirjastada
• Arvutisse logida
• ...
• OpenSSH
• OpenVPN
• GnuPGP
                                              6
“ID-kaardil olevaid RSA võtmeid on
  mõninga vaevaga võimalik kasutada
paljudes rakendustes, mis tegelevad RSA
    võtmetega ja sellega parandada
          süsteemi turvalisust”



                                          7
“Kuidas jõuab RSA allkiri rakendusse?”




                                     8
OpenSSL OpenVPN
   OpenSSH Veebis allkirjastamise pluginad
Outlook       DigiDoc client NSS
Internet Explorer FirefoxThunderbird
CryptoAPI PKCS#11 Keychain     CDSA
    Rakenduste krüptoliides Tokend
  OpenSC    BaseCSP minidriver
       ID-kaardi draiver
   PC/SC CT-API OpenCT
     Kaardilugeja raamistik
              Kaardilugeja draiver
        PCMCI        CCID
                    USB
          Kaardilugeja
          ID-kaart




                                             9
ID-kaardi tarkvara on ...
• Komponendid (platvormi) krüptoliidestele
 • CryptoAPI, PKCS#11, Tokend/CDSA
• Custom rakendustarkvara
 • ID-kaardi utiliit, DigiDoc client, DigiDoc
    crypto
• Custom veebilehitseja pluginad
 • Digiallkirjastamiseks
                                                10
Kust saab

• https://id.eesti.ee/trac - uus ja roosa;
  ametlik OSS
• http://installer.id.ee - vana ja kärav; ametlik
• http://ideelabor.ee/id-kaart - vana ja
  alternatiivne, OSS



                                                    11
Windows
                   Firefox               Explorer
                   Plugin                 Plugin

   Thunderbird



DigiDoc                   Outlook
                                                  Utiliit



            PKCS#11                 CryptoAPI
            OpenSC                  BaseCSP
                                    minidraiver             cardlib

                                     CT-API


                          PC/SC
                 CCID           IFDHandler


                 Reader              Reader




                                                                      12
Linux
                  Firefox
 Thunderbird      Plugin



DigiDoc                     Utiliit


               PKCS#11
                                         Cardlib
                OpenSC



                                CT-API


OpenCT                  PC/SC                  CT-API
               CCID         IFDHandler


Reader         Reader           Reader         Reader




                                                        13
Mac OS X
                    Firefox               Safari
                    Plugin                Plugin
   Thunderbird



DigiDoc               Mail.app             Utiliit



                                 CDSA
          PKCS#11
                              Securityd              Cardlib
          OpenSC
                                 Tokend




                          PC/SC
                 CCID            IFDHandler


                 Reader           Reader




                                                               14
Tähelepanekuid

• Windows ja Mac püüavad pakkuda
  kõrgemaid API-sid
• Ainus universaalne API on PKCS#11
• Iga veebilehe omanik võib enda
  allkirjastamise plugina välja mõelda



                                         15
Tähelepanekud 2

• Jalgratast pole mõtet leiutada, kasutada on
  krüpteteegid ja API-d
• Mitte kõikide teekide autorid pole mõelnud
  kiipkaardiga suhtlemisele (OpenSSL)




                                                16
“Milleks ja kuidas tarkvara
   ID-kaarti kasutab?”


                              17
Brauserid



            18
19
• Standard: autentimisvõtit SSL/TLS
  ühenduse autentimisel

 • Kehtib kogu brauseris realiseeritud X509
    ja PKI kupatus




                                              19
• Standard: autentimisvõtit SSL/TLS
  ühenduse autentimisel

 • Kehtib kogu brauseris realiseeritud X509
    ja PKI kupatus

• Custom: allkirjavõtit (mingi dokumendi)
  räsi allkirjastamiseks.

 • Tehniline vidin allkirja kätte saamiseks
    veebilehe kaudu


                                              19
• Internet Explorer: CryptoAPI
• Firefox: PKCS#11
• Safari: CDSA/Keychain
• Google Chrome: CryptoAPI ja ... ?
• Opera: tutkit

                                      20
Meilikliendid



                21
• Standard: S/MIME kaudu e-mailide
  krüpteerimisel ja signeerimisel
  autentimisvõtmega

 • See EI OLE digiallkiri
• Standard: SSL/TLS IMAP/POP3 jaoks
• Kah standard?: PGP abil e-mailide
  krüpteerimist ja signeerimist
  autentimisvõtmega


                                      22
• Outlook: CryptoAPI
• Thunderbird: PKCS#11
• Mail.app: CDSA/Keychain
• PGP pluginad: tutkit


                            23
SSH: Windows

• PuttySC PKCS#11 liidesega klient
• PuttySC “SSH agent” ja WinSCP
• http://www.risacher.org/putty-cac/putty.exe
• http://www.risacher.org/putty-cac/pageant.exe
• http://winscp.net/download/winscp425.exe

                                                  24
putty.exe




            25
26
27
SSH võtme lisamine
$ echo “ssh-rsa AAAX....” >> ~/.ssh/authorized_keys2


• kaks > märki
• ~/.ssh kataloogil õigused 700!
• authorized_keys2 faili lõpus newline!


                                                       28
29
30
pageant.exe




              31
32
winscp.exe




             33
34
34
34
35
36
SSH: Linux (Ubuntu)

• PKCS#11 patch OpenSSH jaoks
• Originaal http://www.openssh.org
•   Patch:
    http://sites.google.com/site/alonbarlev/openssh-pkcs11

•   Combo:
    http://martin.paljak.pri.ee/download/openssh-pkcs11.tar.gz




                                                                 37
Paigaldamine:
$ sudo apt-get install libpkcs11-helper1-dev libssl-dev build-essential
$ wget http://martin.paljak.pri.ee/download/openssh-pkcs11.tar.gz
$ tar xzvf openssh-pkcs11.tar.gz
$ ./configure --with-pkcs11 && make && sudo make install
### OpenSSH konfimisel on palju teisi võtmeid samuti




                                                                          38
Kasutamine
$ ssh -# /usr/lib/onepin-opensc-pkcs11.so martin@paljak.pri.ee




$ ssh-keygen -K /usr/lib/onepin-opensc-pkcs11.so
$ ssh-add -K /usr/lib/onepin-opensc-pkcs11.so -I ‘XX’



                                                                 39
Avaliku võtme lugemine
$ ssh-keygen -K /usr/lib/onepin-opensc-pkcs11.so | grep ssh-rsa




$ pkcs15-tool --read-ssh-key 1 | tail -1




                                                                  40
Tähelepanekud

• SSH protokoll ei ole SSL
• SSH ei sõltu sertifikaatidest vaid ligipääsust
  privaatvõtmele
  • Kõik näited tehtud aegunud kaartidega


                                                  41
SSH kokkuvõtteks
• Serveris lubada ainult RSA võtmetega
  autentimine
  • RSAAuthentication yes
    PasswordAuthentication no
• “SSH on vaese mehe VPN”
 • tunnelid, SOCKS proxy
• Võtmed ei lähe jalutama ja ligipääsu annad
  inimesele, mitte võtmele
                                               42
PKCS#11 moodulid

• C:WINDOWSsystem32onepin-opensc-pkcs11.dll
• /usr/lib/onepin-opensc-pkcs11.so
• /Library/OpenSC/lib/onepin-opensc-pkcs11.so


                                                 43
TrueCrypt

• http://www.truecrypt.com
• “TrueCrypt supports PKCS#11 tokens”
 • PKCS#11 pole liides mälupulgale


                                        44
Ära krüpti ID-kaardiga

• Kui kaarti ei saa kasutada, ei saa andmetele
  ligi
• Krüptimiseks kasutada varundatavaid
  võtmeid




                                                 45
OpenVPN


• OpenVPN toetab PKCS#11 mooduleid
 • Võimalusi on väga palju.
•   $ openvpn --show-pkcs11-ids /usr/lib/onepin-opensc-pkcs11.so




                                                                   46
Veel tarkvara
• engine_pkcs11 - võimalik oelmasolev
  OpenSSL tarkvara panna kasutama ID-
  kaardi võtmeid väikese vaevaga
• pam_pkcs11 - võimalik ligipääsu Linux
  masinatele kontrollida ID-kaardi võtmetega
• gnupg-pkcs11-scd - võimalik PKCS#11
  kaudu kasutada ID-kaardi võtmeid GnuPG
  PGP lahenduses


                                               47
Stunnel

• http://www.stunnel.org
• Üldine SSL/TLS tunneldaja
• engine_pkcs11 + stunnel = ID-kaardiga
  tunnelid




                                          48
Veel tarkvara 2

• GnuTLS - PKCS#11 toega teek.
• cURL - ID-kaardi toega; arendajatele
• Hea allikas:
  http://sites.google.com/site/alonbarlev/open-source

•   Alon Bar-Lev, OpenSC dev




                                                        49
reklaam: OpenID.ee
• Võimalik kasutajaid identifitseerida ja
  autentida ID-kaardi ja mobiil-ID kaudu ilma
  HTTPS-ita, ilma paroolideta.
• 80/20 reegel: kapakohila koerafoorum ja
  veel 80% veebidest ei vaja HTTPS-i ega
  jaksa realiseerida mID tuge
• OpenID tugi paljudes veebilahendustes
  kohe olemas: Wordpress, Drupal, Joomla jne


                                                50
Küsimusi?


• On veel tarkvara, mis võiks kasutada ID-
  kaarti?




                                             51
Aitäh!



         52

More Related Content

Featured

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 HubspotMarius Sescu
 
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 ChatGPTExpeed Software
 
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 EngineeringsPixeldarts
 
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 HealthThinkNow
 
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.pdfmarketingartwork
 
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 2024Neil Kimberley
 
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)contently
 
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 2024Albert Qian
 
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 InsightsKurio // The Social Media Age(ncy)
 
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 2024Search Engine Journal
 
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 summarySpeakerHub
 
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 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 Tessa Mero
 
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 IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
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 managementMindGenius
 
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...RachelPearson36
 

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...
 

ID-kaardist 100%

  • 1. ID-kaardist 100% Tartu 2009 Martin Paljak / martin.paljak.pri.ee 1
  • 2. ID-kaart ja selle infrastruktuur on kõige odavam ja kõige turvalisem kohe kasutatav vahend Eesti IT lahenduste turvamisel. 2
  • 3. Kes? • Vabavaralise kiipkaarditarkvara torkija aastast 2003 • OpenSC - OSS Eesti ID-kaardi draiver • Pinpadi tugi OSS softis • Võib sõimata, et mõnel platvormil kaart nii niglalt töötab või tänada, et mõnel üldse töötab. 3
  • 4. Millest jutt? • “Mida peaks iga (ID-kaardi) tarkvara arendaja teadma ID-kaardi tarkvara komponentidest” • Mis on ID-kaardil • Kuidas kaardil olev jõuab rakendustesse • Mida tuntud ja vähemtuntud rakendused teevad • Kuidas (vähemtuntud) tarkvara ID-kaardiga räägib 4
  • 5. Mis on kaardil • Isikuandmete fail (ebahuvitav) • 2x kaardil genereeritud 1024b RSA salajast võtit “2346267345273468354127346981236459182213847619283469183764596723817263871623871263871638612387615” • 2x X509 sertifikaati, Sertifitseerimiskeskusest Võti “Martin Paljak, 38207162722, martin.paljak@eesti.ee” • 2x PIN koodi (4/5..12 märki) • 1x PUK kood (8..12 märki) 5
  • 7. ID-kaardiga saab ... • Brauseriga panka/e-riiki logida (SSL/TLS) 6
  • 8. ID-kaardiga saab ... • Brauseriga panka/e-riiki logida (SSL/TLS) • Dokumente ja makseid allkirjastada 6
  • 9. ID-kaardiga saab ... • Brauseriga panka/e-riiki logida (SSL/TLS) • Dokumente ja makseid allkirjastada • Arvutisse logida 6
  • 10. ID-kaardiga saab ... • Brauseriga panka/e-riiki logida (SSL/TLS) • Dokumente ja makseid allkirjastada • Arvutisse logida • ... 6
  • 11. ID-kaardiga saab ... • Brauseriga panka/e-riiki logida (SSL/TLS) • Dokumente ja makseid allkirjastada • Arvutisse logida • ... • OpenSSH 6
  • 12. ID-kaardiga saab ... • Brauseriga panka/e-riiki logida (SSL/TLS) • Dokumente ja makseid allkirjastada • Arvutisse logida • ... • OpenSSH • OpenVPN 6
  • 13. ID-kaardiga saab ... • Brauseriga panka/e-riiki logida (SSL/TLS) • Dokumente ja makseid allkirjastada • Arvutisse logida • ... • OpenSSH • OpenVPN • GnuPGP 6
  • 14. “ID-kaardil olevaid RSA võtmeid on mõninga vaevaga võimalik kasutada paljudes rakendustes, mis tegelevad RSA võtmetega ja sellega parandada süsteemi turvalisust” 7
  • 15. “Kuidas jõuab RSA allkiri rakendusse?” 8
  • 16. OpenSSL OpenVPN OpenSSH Veebis allkirjastamise pluginad Outlook DigiDoc client NSS Internet Explorer FirefoxThunderbird CryptoAPI PKCS#11 Keychain CDSA Rakenduste krüptoliides Tokend OpenSC BaseCSP minidriver ID-kaardi draiver PC/SC CT-API OpenCT Kaardilugeja raamistik Kaardilugeja draiver PCMCI CCID USB Kaardilugeja ID-kaart 9
  • 17. ID-kaardi tarkvara on ... • Komponendid (platvormi) krüptoliidestele • CryptoAPI, PKCS#11, Tokend/CDSA • Custom rakendustarkvara • ID-kaardi utiliit, DigiDoc client, DigiDoc crypto • Custom veebilehitseja pluginad • Digiallkirjastamiseks 10
  • 18. Kust saab • https://id.eesti.ee/trac - uus ja roosa; ametlik OSS • http://installer.id.ee - vana ja kärav; ametlik • http://ideelabor.ee/id-kaart - vana ja alternatiivne, OSS 11
  • 19. Windows Firefox Explorer Plugin Plugin Thunderbird DigiDoc Outlook Utiliit PKCS#11 CryptoAPI OpenSC BaseCSP minidraiver cardlib CT-API PC/SC CCID IFDHandler Reader Reader 12
  • 20. Linux Firefox Thunderbird Plugin DigiDoc Utiliit PKCS#11 Cardlib OpenSC CT-API OpenCT PC/SC CT-API CCID IFDHandler Reader Reader Reader Reader 13
  • 21. Mac OS X Firefox Safari Plugin Plugin Thunderbird DigiDoc Mail.app Utiliit CDSA PKCS#11 Securityd Cardlib OpenSC Tokend PC/SC CCID IFDHandler Reader Reader 14
  • 22. Tähelepanekuid • Windows ja Mac püüavad pakkuda kõrgemaid API-sid • Ainus universaalne API on PKCS#11 • Iga veebilehe omanik võib enda allkirjastamise plugina välja mõelda 15
  • 23. Tähelepanekud 2 • Jalgratast pole mõtet leiutada, kasutada on krüpteteegid ja API-d • Mitte kõikide teekide autorid pole mõelnud kiipkaardiga suhtlemisele (OpenSSL) 16
  • 24. “Milleks ja kuidas tarkvara ID-kaarti kasutab?” 17
  • 25. Brauserid 18
  • 26. 19
  • 27. • Standard: autentimisvõtit SSL/TLS ühenduse autentimisel • Kehtib kogu brauseris realiseeritud X509 ja PKI kupatus 19
  • 28. • Standard: autentimisvõtit SSL/TLS ühenduse autentimisel • Kehtib kogu brauseris realiseeritud X509 ja PKI kupatus • Custom: allkirjavõtit (mingi dokumendi) räsi allkirjastamiseks. • Tehniline vidin allkirja kätte saamiseks veebilehe kaudu 19
  • 29. • Internet Explorer: CryptoAPI • Firefox: PKCS#11 • Safari: CDSA/Keychain • Google Chrome: CryptoAPI ja ... ? • Opera: tutkit 20
  • 31. • Standard: S/MIME kaudu e-mailide krüpteerimisel ja signeerimisel autentimisvõtmega • See EI OLE digiallkiri • Standard: SSL/TLS IMAP/POP3 jaoks • Kah standard?: PGP abil e-mailide krüpteerimist ja signeerimist autentimisvõtmega 22
  • 32. • Outlook: CryptoAPI • Thunderbird: PKCS#11 • Mail.app: CDSA/Keychain • PGP pluginad: tutkit 23
  • 33. SSH: Windows • PuttySC PKCS#11 liidesega klient • PuttySC “SSH agent” ja WinSCP • http://www.risacher.org/putty-cac/putty.exe • http://www.risacher.org/putty-cac/pageant.exe • http://winscp.net/download/winscp425.exe 24
  • 34. putty.exe 25
  • 35. 26
  • 36. 27
  • 37. SSH võtme lisamine $ echo “ssh-rsa AAAX....” >> ~/.ssh/authorized_keys2 • kaks > märki • ~/.ssh kataloogil õigused 700! • authorized_keys2 faili lõpus newline! 28
  • 38. 29
  • 39. 30
  • 41. 32
  • 43. 34
  • 44. 34
  • 45. 34
  • 46. 35
  • 47. 36
  • 48. SSH: Linux (Ubuntu) • PKCS#11 patch OpenSSH jaoks • Originaal http://www.openssh.org • Patch: http://sites.google.com/site/alonbarlev/openssh-pkcs11 • Combo: http://martin.paljak.pri.ee/download/openssh-pkcs11.tar.gz 37
  • 49. Paigaldamine: $ sudo apt-get install libpkcs11-helper1-dev libssl-dev build-essential $ wget http://martin.paljak.pri.ee/download/openssh-pkcs11.tar.gz $ tar xzvf openssh-pkcs11.tar.gz $ ./configure --with-pkcs11 && make && sudo make install ### OpenSSH konfimisel on palju teisi võtmeid samuti 38
  • 50. Kasutamine $ ssh -# /usr/lib/onepin-opensc-pkcs11.so martin@paljak.pri.ee $ ssh-keygen -K /usr/lib/onepin-opensc-pkcs11.so $ ssh-add -K /usr/lib/onepin-opensc-pkcs11.so -I ‘XX’ 39
  • 51. Avaliku võtme lugemine $ ssh-keygen -K /usr/lib/onepin-opensc-pkcs11.so | grep ssh-rsa $ pkcs15-tool --read-ssh-key 1 | tail -1 40
  • 52. Tähelepanekud • SSH protokoll ei ole SSL • SSH ei sõltu sertifikaatidest vaid ligipääsust privaatvõtmele • Kõik näited tehtud aegunud kaartidega 41
  • 53. SSH kokkuvõtteks • Serveris lubada ainult RSA võtmetega autentimine • RSAAuthentication yes PasswordAuthentication no • “SSH on vaese mehe VPN” • tunnelid, SOCKS proxy • Võtmed ei lähe jalutama ja ligipääsu annad inimesele, mitte võtmele 42
  • 54. PKCS#11 moodulid • C:WINDOWSsystem32onepin-opensc-pkcs11.dll • /usr/lib/onepin-opensc-pkcs11.so • /Library/OpenSC/lib/onepin-opensc-pkcs11.so 43
  • 55. TrueCrypt • http://www.truecrypt.com • “TrueCrypt supports PKCS#11 tokens” • PKCS#11 pole liides mälupulgale 44
  • 56. Ära krüpti ID-kaardiga • Kui kaarti ei saa kasutada, ei saa andmetele ligi • Krüptimiseks kasutada varundatavaid võtmeid 45
  • 57. OpenVPN • OpenVPN toetab PKCS#11 mooduleid • Võimalusi on väga palju. • $ openvpn --show-pkcs11-ids /usr/lib/onepin-opensc-pkcs11.so 46
  • 58. Veel tarkvara • engine_pkcs11 - võimalik oelmasolev OpenSSL tarkvara panna kasutama ID- kaardi võtmeid väikese vaevaga • pam_pkcs11 - võimalik ligipääsu Linux masinatele kontrollida ID-kaardi võtmetega • gnupg-pkcs11-scd - võimalik PKCS#11 kaudu kasutada ID-kaardi võtmeid GnuPG PGP lahenduses 47
  • 59. Stunnel • http://www.stunnel.org • Üldine SSL/TLS tunneldaja • engine_pkcs11 + stunnel = ID-kaardiga tunnelid 48
  • 60. Veel tarkvara 2 • GnuTLS - PKCS#11 toega teek. • cURL - ID-kaardi toega; arendajatele • Hea allikas: http://sites.google.com/site/alonbarlev/open-source • Alon Bar-Lev, OpenSC dev 49
  • 61. reklaam: OpenID.ee • Võimalik kasutajaid identifitseerida ja autentida ID-kaardi ja mobiil-ID kaudu ilma HTTPS-ita, ilma paroolideta. • 80/20 reegel: kapakohila koerafoorum ja veel 80% veebidest ei vaja HTTPS-i ega jaksa realiseerida mID tuge • OpenID tugi paljudes veebilahendustes kohe olemas: Wordpress, Drupal, Joomla jne 50
  • 62. Küsimusi? • On veel tarkvara, mis võiks kasutada ID- kaarti? 51
  • 63. Aitäh! 52