dnssec keys in smartcardhsm
play

DNSSEC Keys in SmartcardHSM OpenSC on Mac OS Luis D Espinoza - PowerPoint PPT Presentation

DNSSEC Keys in SmartcardHSM OpenSC on Mac OS Luis D Espinoza Sanchez & Eberhard W Lisse University of Costa Rica & Namibian Network Information Centre 2015-02-09 Espinoza & Lisse (NA-NiC) SmartcardHSM 2015-02-09 1 / 19


  1. DNSSEC Keys in SmartcardHSM OpenSC on Mac OS Luis D Espinoza Sanchez & Eberhard W Lisse University of Costa Rica & Namibian Network Information Centre 2015-02-09 Espinoza & Lisse (NA-NiC) SmartcardHSM 2015-02-09 1 / 19

  2. Introduction DNSSEC is Easy! Is it Secure? Secure DNSSEC is Expensive! Is it really? So, what were we looking for? An easy, secure and cheap DNSSEC solution for .NA; for demonstration purposes; for fun (see slide 19) Espinoza & Lisse (NA-NiC) SmartcardHSM 2015-02-09 2 / 19

  3. Introduction Registry System without DNSSEC Espinoza & Lisse (NA-NiC) SmartcardHSM 2015-02-09 3 / 19

  4. Introduction Registry System with DNSSEC Espinoza & Lisse (NA-NiC) SmartcardHSM 2015-02-09 4 / 19

  5. Introduction Hardware Keys Espinoza & Lisse (NA-NiC) SmartcardHSM 2015-02-09 5 / 19

  6. Introduction Why Mac? SmartcardHSM Different Brands Smartcard Readers Different Brands Open Source Sofware OpenSC BIND 9 Homebrew MacPorts Virtual Box Centos 6 OS X 10.10.2 Native Drivers for the Readers Espinoza & Lisse (NA-NiC) SmartcardHSM 2015-02-09 6 / 19

  7. Proof of Concept Not Production Grade. Yet. Why Mac? Name Servers usually don’t run on Netbooks BSD Ubuntu Centos It’s fun (see slide 19) No auditing (Ceremony) Can be added later from Richard Lamb’s Ceremony documentation Key in Hardware adds some security Physical Access to Server is required Servers are usually in secure data center Espinoza & Lisse (NA-NiC) SmartcardHSM 2015-02-09 7 / 19

  8. Implementation Bash Consolidate Richard Lamb’s Ceremony Scripts into 1 single script 50 lines dialog to display/modify Environment Variables Espinoza & Lisse (NA-NiC) SmartcardHSM 2015-02-09 8 / 19

  9. Set Environment Variables Bash DATE=‘date -u +%Y%m%d%H%M%S‘ DOMAIN=na PASSWORD=RichardLamb PATH=~/Downloads/dccom:$PATH PIN1=123456 PKCS11_LIBRARY_PATH=/Library/OpenSC/lib/opensc- pkcs11.so SOPIN="3537363231383830" CKALABEL="ksk.""$DOMAIN"".""$DATE" Espinoza & Lisse (NA-NiC) SmartcardHSM 2015-02-09 9 / 19

  10. Initialization Prepare the Card sc-hsm-tool –initialize –so-pin $SOPIN \ –pin $PIN1 Erase the Card sc-hsm-tool –initialize –so-pin $SOPIN \ –pin $PIN1 –dkek-shares 2 Device Key Encryption Key (DKEK) shares are used to derive the actual keys Espinoza & Lisse (NA-NiC) SmartcardHSM 2015-02-09 10 / 19

  11. Create 2 DKEK Shares sc-hsm-tool –create-dkek-share dkek-share-1.pbe \ –so-pin $SOPIN –pin $PIN1 \ –password $PASSWORD sc-hsm-tool –create-dkek-share dkek-share-2.pbe \ –so-pin $SOPIN –pin $PIN1 \ –password $PASSWORD Espinoza & Lisse (NA-NiC) SmartcardHSM 2015-02-09 11 / 19

  12. Import the DKEK Shares sc-hsm-tool –import-dkek-share dkek-share-1.pbe \ –so-pin $SOPIN –pin $PIN1 \ –password $PASSWORD sc-hsm-tool –import-dkek-share dkek-share-2.pbe \ –so-pin $SOPIN –pin $PIN1 \ –password $PASSWORD Espinoza & Lisse (NA-NiC) SmartcardHSM 2015-02-09 12 / 19

  13. Generate 2 ZSKs Why 2? dnssec-keygen -r /dev/random -a 8 -b 1024 \ $DOMAIN. dnssec-keygen -r /dev/random -a 8 -b 1024 \ $DOMAIN. Espinoza & Lisse (NA-NiC) SmartcardHSM 2015-02-09 13 / 19

  14. Generate KSK Inside the Card pkcs11-tool –module $PKCS11_LIBRARY_PATH \ -l –pin $PIN1 –keypairgen –key-type rsa:2048 \ –read-object –type pubkey \ –output-file "$CKALABEL"".pub" \ –label "$CKALABEL" Espinoza & Lisse (NA-NiC) SmartcardHSM 2015-02-09 14 / 19

  15. Verification Dump the Card pkcs15-tool -D Espinoza & Lisse (NA-NiC) SmartcardHSM 2015-02-09 15 / 19

  16. Wrap the Key Export and encrypt (wrapped with shares) copy of the private key sc-hsm-tool –wrap-key "$CKALABEL"".wrap" \ –key-reference 1 –pin $PIN1 Espinoza & Lisse (NA-NiC) SmartcardHSM 2015-02-09 16 / 19

  17. hcardsign (Bash script) Generate pre-KSK-signed DNSKEY RRsets for future use relies on pkcs11-backup -f$CKALABEL:8:257:$DOMAIN. \ -S 0 -P $PIN1 Open Source (Richard Lamb) Doesn’t currently compile on the Mac Will do so RSN Not an issue Works on Linux Not required in production Less Safe Demonstrated here only to show functionality Espinoza & Lisse (NA-NiC) SmartcardHSM 2015-02-09 17 / 19

  18. Make Backup Card From Wrapped Key Repeat steps for additional cards sc-hsm-tool –initialize –so-pin $SOPIN –pin $PIN1 sc-hsm-tool –initialize –so-pin $SOPIN \ –pin $PIN1 –dkek-shares 2 sc-hsm-tool –import-dkek-share dkek-share-1.pbe \ –so-pin $SOPIN –pin $PIN1 \ –password $PASSWORD sc-hsm-tool –import-dkek-share dkek-share-2.pbe \ –so-pin $SOPIN –pin $PIN1 \ –password $PASSWORD sc-hsm-tool –unwrap-key $CKALABEL"".wrap" \ –key-reference 1 –pin $PIN1 Espinoza & Lisse (NA-NiC) SmartcardHSM 2015-02-09 18 / 19

  19. The Real Reason This is fun! Espinoza & Lisse (NA-NiC) SmartcardHSM 2015-02-09 19 / 19

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend