SlideShare une entreprise Scribd logo
1  sur  22
Télécharger pour lire hors ligne
AKT un outil pour
sécuriser vos données et
documents sensibles
Stéphane Carrez POSS 2019
https://github.com/stcarrez/ada-keystore 2
Les (mauvaises) pratiques de
sécurité (1)
● Mon mot de passe sur post-it
https://github.com/stcarrez/ada-keystore 3
Les (mauvaises) pratiques de
sécurité (2)
● Mes clefs d’API dans le code sous GitHub
(100 000 repo)
● 57 million de comptes
● 100 000 $ de ranson
● 148 million $ d’amende
https://github.com/stcarrez/ada-keystore 4
Les (mauvaises) pratiques de
sécurité (3)
● Mes documents confidentiels dans le Cloud
https://github.com/stcarrez/ada-keystore 5
Pourquoi AKT?
● Plusieurs besoins :
– stocker les paramètres sensibles d’un serveur
écrit en Ada
– sauver des numéros de comptes, mots de
passe
– sauver des documents cryptés complets sans
exposer les clefs
https://github.com/stcarrez/ada-keystore 6
Pourquoi Ada?
● Ada n’est pas qu’un vieux langage : Ada 2012
● Ada n’est pas que pour les militaires, l’aviation
● Ada est fortement typé et détecte les erreurs de
programmation
● Moins de CWE
(Common Weakness Enumeration)
– Pas de buffer overflow (CWE 120)
https://github.com/stcarrez/ada-keystore 7
AKT: un stockage sécurisé
AKT
User passwordGPG protected key
Encrypted Data
Keystore
https://github.com/stcarrez/ada-keystore 8
AKT: avec plusieurs clefs
Directory key
Master key block
Data info key
Data key key
Data keys
Data keys
Signature key
User password
GPG protected
key
Data fragment
Data fragment
Data fragment
Data fragment
Data fragment
Directory keys Encrypted Data
https://github.com/stcarrez/ada-keystore 9
AKT: des keystores récursifs
Directory key
Master key block
Data info key
Data key key
Data keys
Data keys
Signature key
Second key
First key
Directory keys
Directory key
Master key block
Data info key
Data key key
Signature key
https://github.com/stcarrez/ada-keystore 10
AKT: des blocs sans chaine
HMAC-256HDR
(1815-12-10)
(1852-11-27)
Ada
HMAC-256UUID
Storage
ID
HDR Data Storage Info + HMAC
Directory Name Entry Data block indexes & keys
HMAC-256HDR Data fragment info HMAC-256 Data Fragment
Header block
Directory block
Data block
Master key block
...
HMAC-256HDR Wallet info Key slot 1UUID Key slot 7...
4K
https://github.com/stcarrez/ada-keystore 11
AKT: protection des clefs (1)
Wallet master key slot N (512 bytes)
key slot Nsalt key N
HMAC
256
= ?
AES-256
CBC
Wallet Master Keys
(32 bytes) (240 bytes)
key key
(256 bits)
key IV
(128 bits)
dat key
(256 bits)
dat IV
(128 bits)
dir key
(256 bits)
dir IV
(128 bits)
Wallet master key block
AES-256
CBC
PBKDF2
HMAC
256
ctr slot N
(4 bytes)
Sign N HMAC
(32 bytes) (32 bytes)
PBKDF2
HMAC
256
(4 bytes)
salt IV N
(32 bytes)
HMAC-256HDR Wallet info Key slot 1UUID Key slot 7...
Wallet Header Key, wallet header IV, Block ID
User password NO, invalid
password
YES, valid password
dir sign
(256 bits)
dat sign
(256 bits)
key sign
(256 bits)
Key
IV
HMAC
256
= ?
NO, invalid
block
YES, valid block
Wallet Sign
https://github.com/stcarrez/ada-keystore 12
AKT: protection des clefs (2)
Wallet master key slot N (512 bytes)
key slot N
HMAC
256
= ?
AES-256
CBC
Wallet Master Keys
(240 bytes)
key key
(256 bits)
key IV
(128 bits)
dat key
(256 bits)
dat IV
(128 bits)
dir key
(256 bits)
dir IV
(128 bits)
Wallet master key block
AES-256
CBC
Sign N HMAC
(32 bytes) (32 bytes)
HMAC-256HDR Wallet info Key slot 1UUID Key slot 7...
NO, invalid
password
YES, valid password
dir sign
(256 bits)
dat sign
(256 bits)
key sign
(256 bits)
Key, IV
GPG2
GPG Private key
Header block
Key
(32 bytes)
IV
(16 bytes)
IV Key
(16 bytes) (32 bytes)
(1815-12-10)
(1852-11-27)
Ada
HMAC-256UUID
Storage
ID
HDR Data Storage Info + HMAC
Sign
(32 bytes)
HMAC
256
= ? NO, invalid
block
YES, valid block
header tag
(4 bytes)
https://github.com/stcarrez/ada-keystore 13
AKT: protection des clefs (3)
Directory block
AES-256
CBC
HMAC-256HDR ...
Directory Key, directory IV, Block ID HMAC
256
= ?
NO, invalid
block
YES, valid block
Directory Sign
Directory Name Entry Data block indexes & keys...
Per data fragment encryption keys
Name
(N bytes)
Entry ID
(4 bytes)
key
(256 bits)
IV
(128 bits)
Block NumStore ID
(4 bytes)(4 bytes)(4 bytes)
Entry ID
HMAC-256HDR Data fragment info HMAC-256 Data Fragment HMAC-256HDR Data fragment info HMAC-256 Data Fragment
https://github.com/stcarrez/ada-keystore 14
AKT : à retenir
● Plusieurs clefs AES-256 pour un même document
● Intégrité par HMAC-256 sur plusieurs niveaux
● Blocs avec des classes de sécurités différentes
● Partage sécurisé entre N participants (N<=7)
https://github.com/stcarrez/ada-keystore 15
AKT : création du Keystore
● Protection par mot de passe :
akt create ks.akt ­p admin
● Protection par GPG:
akt create ks.akt ­­gpg user
● Protection par GPG et séparation des données:
akt create ks.akt ­­split 10 ­­gpg user
https://github.com/stcarrez/ada-keystore 16
AKT : protection de documents
● Protéger un document:
akt store ks.akt mydoc.odt
● Utiliser akt get pour l’obtenir:
akt extract ks.akt mydoc.odt
https://github.com/stcarrez/ada-keystore 17
AKT : protégez vos scripts
● But : protéger une clef d’API de type OAuth2:
akt set ks.akt api.key Ahn1kos8Ahn1k
● Utiliser akt get pour l’obtenir:
key=`akt get ks.akt api.key`
https://github.com/stcarrez/ada-keystore 18
AKT : pas de secret dans le code
● Intégration python
import subprocess
result = subprocess.run([‘akt’, ‘get’, 
‘ks.akt’, ‘api.key’], 
stdout=subprocess.PIPE)
key = result.stdout
https://github.com/stcarrez/ada-keystore 19
AKT : une sauvegarde sécurisée
● Création de la sauvegarde:
tar czf ­ . | akt store ks.akt ­­ backup
● Extraction:
akt extract ks.akt ­­ backup | tar xzf ­
https://github.com/stcarrez/ada-keystore 20
AKT : un partage sécurisé
● Importer les clefs GPG des participants
● Création du keystore:
akt create ks.akt ­­gpg key­id­1 key­id­2
● Chaque participant utilise sa propre clef GPG
privée
akt store ks.akt documents.zip
https://github.com/stcarrez/ada-keystore 21
AKT : évolutions
● Support de ChaCha20 (alternative à AES-256)
● Support de SmartCart/PKCS#11
● Scellement des blocs avec arbre de Merkle
● Intégration avec le Cloud dans GAKT
https://github.com/stcarrez/ada-keystore 22
Conclusion
● Pas de post-it pour les mots de passe
● Pas d’excuse pour les clefs d’API dans GitHub
● AKT pour crypter vos documents sur le Cloud !
● Disponible pour GNU/Linux, FreeBSD, NetBSD
● Open Source, Contributions Welcome !,
License Apache 2.0
● Documentation
– https://ada-keystore.readthedocs.io/en/latest/

Contenu connexe

Tendances (8)

Meetup vault - ScaaS Secrets as a Service
Meetup vault - ScaaS Secrets as a ServiceMeetup vault - ScaaS Secrets as a Service
Meetup vault - ScaaS Secrets as a Service
 
Maltacademy: securing your k8s cluster with CNCF falco
Maltacademy: securing your k8s cluster with CNCF falcoMaltacademy: securing your k8s cluster with CNCF falco
Maltacademy: securing your k8s cluster with CNCF falco
 
Logs serveurs : du terme barbare à la simplicité de la réalité
Logs serveurs :  du terme barbare à la simplicité de la réalitéLogs serveurs :  du terme barbare à la simplicité de la réalité
Logs serveurs : du terme barbare à la simplicité de la réalité
 
Le nouveau AMP : apache mariadb php
Le nouveau AMP : apache mariadb phpLe nouveau AMP : apache mariadb php
Le nouveau AMP : apache mariadb php
 
Redis - (nosqlfr meetup #2)
Redis - (nosqlfr meetup #2) Redis - (nosqlfr meetup #2)
Redis - (nosqlfr meetup #2)
 
Tp gpg
Tp gpgTp gpg
Tp gpg
 
Backdoors et rootkits_avancees_[slides]
Backdoors et rootkits_avancees_[slides]Backdoors et rootkits_avancees_[slides]
Backdoors et rootkits_avancees_[slides]
 
Plein phar
Plein pharPlein phar
Plein phar
 

Similaire à AKT un outil pour sécuriser vos données et documents sensibles

Tester la sécurité de votre annuaire Active Directory : top 10 des menaces et...
Tester la sécurité de votre annuaire Active Directory : top 10 des menaces et...Tester la sécurité de votre annuaire Active Directory : top 10 des menaces et...
Tester la sécurité de votre annuaire Active Directory : top 10 des menaces et...
Microsoft Technet France
 
Tester la sécurité de votre annuaire Active Directory : top 10 des menaces et...
Tester la sécurité de votre annuaire Active Directory : top 10 des menaces et...Tester la sécurité de votre annuaire Active Directory : top 10 des menaces et...
Tester la sécurité de votre annuaire Active Directory : top 10 des menaces et...
Microsoft Décideurs IT
 
Apache ssl
Apache sslApache ssl
Apache ssl
GSI
 

Similaire à AKT un outil pour sécuriser vos données et documents sensibles (20)

Sthack 2015 - David Berard & Vincent Fargues - Attack the cache to get some cash
Sthack 2015 - David Berard & Vincent Fargues - Attack the cache to get some cashSthack 2015 - David Berard & Vincent Fargues - Attack the cache to get some cash
Sthack 2015 - David Berard & Vincent Fargues - Attack the cache to get some cash
 
GAB 2017 PARIS - Tester la sécurité de vos annuaires Active Directory et Azur...
GAB 2017 PARIS - Tester la sécurité de vos annuaires Active Directory et Azur...GAB 2017 PARIS - Tester la sécurité de vos annuaires Active Directory et Azur...
GAB 2017 PARIS - Tester la sécurité de vos annuaires Active Directory et Azur...
 
sshGate
sshGatesshGate
sshGate
 
Qui a laissé son mot de passe dans le code
Qui a laissé son mot de passe dans le codeQui a laissé son mot de passe dans le code
Qui a laissé son mot de passe dans le code
 
StHack 2014 - Benjamin "@gentilkiwi" Delpy Mimikatz
StHack 2014 - Benjamin "@gentilkiwi" Delpy MimikatzStHack 2014 - Benjamin "@gentilkiwi" Delpy Mimikatz
StHack 2014 - Benjamin "@gentilkiwi" Delpy Mimikatz
 
Tester la sécurité de votre annuaire Active Directory : top 10 des menaces et...
Tester la sécurité de votre annuaire Active Directory : top 10 des menaces et...Tester la sécurité de votre annuaire Active Directory : top 10 des menaces et...
Tester la sécurité de votre annuaire Active Directory : top 10 des menaces et...
 
Tester la sécurité de votre annuaire Active Directory : top 10 des menaces et...
Tester la sécurité de votre annuaire Active Directory : top 10 des menaces et...Tester la sécurité de votre annuaire Active Directory : top 10 des menaces et...
Tester la sécurité de votre annuaire Active Directory : top 10 des menaces et...
 
Protocole IKE/IPsec
Protocole IKE/IPsecProtocole IKE/IPsec
Protocole IKE/IPsec
 
Apache ssl
Apache sslApache ssl
Apache ssl
 
Rapport tp openssl
Rapport  tp  opensslRapport  tp  openssl
Rapport tp openssl
 
Déploiement ELK en conditions réelles
Déploiement ELK en conditions réellesDéploiement ELK en conditions réelles
Déploiement ELK en conditions réelles
 
mimikatz @ sthack
mimikatz @ sthackmimikatz @ sthack
mimikatz @ sthack
 
gRPC, échange à haute fréquence!
gRPC, échange à haute fréquence!gRPC, échange à haute fréquence!
gRPC, échange à haute fréquence!
 
gRPC, ECHANGES A HAUTE FREQUENCE !
gRPC, ECHANGES A HAUTE FREQUENCE !gRPC, ECHANGES A HAUTE FREQUENCE !
gRPC, ECHANGES A HAUTE FREQUENCE !
 
3 Microsoft Advanced Threat Analytics - Genève
3   Microsoft Advanced Threat Analytics - Genève3   Microsoft Advanced Threat Analytics - Genève
3 Microsoft Advanced Threat Analytics - Genève
 
REX Ansible
REX AnsibleREX Ansible
REX Ansible
 
Virtualiastion des systèmes d'exploitations
Virtualiastion des systèmes d'exploitationsVirtualiastion des systèmes d'exploitations
Virtualiastion des systèmes d'exploitations
 
Geneve Monitoring Graylog
Geneve Monitoring GraylogGeneve Monitoring Graylog
Geneve Monitoring Graylog
 
Ssl et certification electronique - (construction de certification)
Ssl et certification electronique  - (construction de certification)Ssl et certification electronique  - (construction de certification)
Ssl et certification electronique - (construction de certification)
 
Sécurité asterisk web
Sécurité asterisk webSécurité asterisk web
Sécurité asterisk web
 

Plus de Stephane Carrez

Plus de Stephane Carrez (8)

Implementing a build manager in Ada
Implementing a build manager in AdaImplementing a build manager in Ada
Implementing a build manager in Ada
 
Porion a new Build Manager
Porion a new Build ManagerPorion a new Build Manager
Porion a new Build Manager
 
Protect Sensitive Data with Ada Keystore
Protect Sensitive Data with Ada KeystoreProtect Sensitive Data with Ada Keystore
Protect Sensitive Data with Ada Keystore
 
Ada for Web Development
Ada for Web DevelopmentAda for Web Development
Ada for Web Development
 
Secure Web Applications with AWA
Secure Web Applications with AWASecure Web Applications with AWA
Secure Web Applications with AWA
 
Persistence with Ada Database Objects (ADO)
Persistence with Ada Database Objects (ADO)Persistence with Ada Database Objects (ADO)
Persistence with Ada Database Objects (ADO)
 
Writing REST APIs with OpenAPI and Swagger Ada
Writing REST APIs with OpenAPI and Swagger AdaWriting REST APIs with OpenAPI and Swagger Ada
Writing REST APIs with OpenAPI and Swagger Ada
 
IP Network Stack in Ada 2012 and the Ravenscar Profile
IP Network Stack in Ada 2012 and the Ravenscar ProfileIP Network Stack in Ada 2012 and the Ravenscar Profile
IP Network Stack in Ada 2012 and the Ravenscar Profile
 

AKT un outil pour sécuriser vos données et documents sensibles

  • 1. AKT un outil pour sécuriser vos données et documents sensibles Stéphane Carrez POSS 2019
  • 2. https://github.com/stcarrez/ada-keystore 2 Les (mauvaises) pratiques de sécurité (1) ● Mon mot de passe sur post-it
  • 3. https://github.com/stcarrez/ada-keystore 3 Les (mauvaises) pratiques de sécurité (2) ● Mes clefs d’API dans le code sous GitHub (100 000 repo) ● 57 million de comptes ● 100 000 $ de ranson ● 148 million $ d’amende
  • 4. https://github.com/stcarrez/ada-keystore 4 Les (mauvaises) pratiques de sécurité (3) ● Mes documents confidentiels dans le Cloud
  • 5. https://github.com/stcarrez/ada-keystore 5 Pourquoi AKT? ● Plusieurs besoins : – stocker les paramètres sensibles d’un serveur écrit en Ada – sauver des numéros de comptes, mots de passe – sauver des documents cryptés complets sans exposer les clefs
  • 6. https://github.com/stcarrez/ada-keystore 6 Pourquoi Ada? ● Ada n’est pas qu’un vieux langage : Ada 2012 ● Ada n’est pas que pour les militaires, l’aviation ● Ada est fortement typé et détecte les erreurs de programmation ● Moins de CWE (Common Weakness Enumeration) – Pas de buffer overflow (CWE 120)
  • 7. https://github.com/stcarrez/ada-keystore 7 AKT: un stockage sécurisé AKT User passwordGPG protected key Encrypted Data Keystore
  • 8. https://github.com/stcarrez/ada-keystore 8 AKT: avec plusieurs clefs Directory key Master key block Data info key Data key key Data keys Data keys Signature key User password GPG protected key Data fragment Data fragment Data fragment Data fragment Data fragment Directory keys Encrypted Data
  • 9. https://github.com/stcarrez/ada-keystore 9 AKT: des keystores récursifs Directory key Master key block Data info key Data key key Data keys Data keys Signature key Second key First key Directory keys Directory key Master key block Data info key Data key key Signature key
  • 10. https://github.com/stcarrez/ada-keystore 10 AKT: des blocs sans chaine HMAC-256HDR (1815-12-10) (1852-11-27) Ada HMAC-256UUID Storage ID HDR Data Storage Info + HMAC Directory Name Entry Data block indexes & keys HMAC-256HDR Data fragment info HMAC-256 Data Fragment Header block Directory block Data block Master key block ... HMAC-256HDR Wallet info Key slot 1UUID Key slot 7... 4K
  • 11. https://github.com/stcarrez/ada-keystore 11 AKT: protection des clefs (1) Wallet master key slot N (512 bytes) key slot Nsalt key N HMAC 256 = ? AES-256 CBC Wallet Master Keys (32 bytes) (240 bytes) key key (256 bits) key IV (128 bits) dat key (256 bits) dat IV (128 bits) dir key (256 bits) dir IV (128 bits) Wallet master key block AES-256 CBC PBKDF2 HMAC 256 ctr slot N (4 bytes) Sign N HMAC (32 bytes) (32 bytes) PBKDF2 HMAC 256 (4 bytes) salt IV N (32 bytes) HMAC-256HDR Wallet info Key slot 1UUID Key slot 7... Wallet Header Key, wallet header IV, Block ID User password NO, invalid password YES, valid password dir sign (256 bits) dat sign (256 bits) key sign (256 bits) Key IV HMAC 256 = ? NO, invalid block YES, valid block Wallet Sign
  • 12. https://github.com/stcarrez/ada-keystore 12 AKT: protection des clefs (2) Wallet master key slot N (512 bytes) key slot N HMAC 256 = ? AES-256 CBC Wallet Master Keys (240 bytes) key key (256 bits) key IV (128 bits) dat key (256 bits) dat IV (128 bits) dir key (256 bits) dir IV (128 bits) Wallet master key block AES-256 CBC Sign N HMAC (32 bytes) (32 bytes) HMAC-256HDR Wallet info Key slot 1UUID Key slot 7... NO, invalid password YES, valid password dir sign (256 bits) dat sign (256 bits) key sign (256 bits) Key, IV GPG2 GPG Private key Header block Key (32 bytes) IV (16 bytes) IV Key (16 bytes) (32 bytes) (1815-12-10) (1852-11-27) Ada HMAC-256UUID Storage ID HDR Data Storage Info + HMAC Sign (32 bytes) HMAC 256 = ? NO, invalid block YES, valid block header tag (4 bytes)
  • 13. https://github.com/stcarrez/ada-keystore 13 AKT: protection des clefs (3) Directory block AES-256 CBC HMAC-256HDR ... Directory Key, directory IV, Block ID HMAC 256 = ? NO, invalid block YES, valid block Directory Sign Directory Name Entry Data block indexes & keys... Per data fragment encryption keys Name (N bytes) Entry ID (4 bytes) key (256 bits) IV (128 bits) Block NumStore ID (4 bytes)(4 bytes)(4 bytes) Entry ID HMAC-256HDR Data fragment info HMAC-256 Data Fragment HMAC-256HDR Data fragment info HMAC-256 Data Fragment
  • 14. https://github.com/stcarrez/ada-keystore 14 AKT : à retenir ● Plusieurs clefs AES-256 pour un même document ● Intégrité par HMAC-256 sur plusieurs niveaux ● Blocs avec des classes de sécurités différentes ● Partage sécurisé entre N participants (N<=7)
  • 15. https://github.com/stcarrez/ada-keystore 15 AKT : création du Keystore ● Protection par mot de passe : akt create ks.akt ­p admin ● Protection par GPG: akt create ks.akt ­­gpg user ● Protection par GPG et séparation des données: akt create ks.akt ­­split 10 ­­gpg user
  • 16. https://github.com/stcarrez/ada-keystore 16 AKT : protection de documents ● Protéger un document: akt store ks.akt mydoc.odt ● Utiliser akt get pour l’obtenir: akt extract ks.akt mydoc.odt
  • 17. https://github.com/stcarrez/ada-keystore 17 AKT : protégez vos scripts ● But : protéger une clef d’API de type OAuth2: akt set ks.akt api.key Ahn1kos8Ahn1k ● Utiliser akt get pour l’obtenir: key=`akt get ks.akt api.key`
  • 18. https://github.com/stcarrez/ada-keystore 18 AKT : pas de secret dans le code ● Intégration python import subprocess result = subprocess.run([‘akt’, ‘get’,  ‘ks.akt’, ‘api.key’],  stdout=subprocess.PIPE) key = result.stdout
  • 19. https://github.com/stcarrez/ada-keystore 19 AKT : une sauvegarde sécurisée ● Création de la sauvegarde: tar czf ­ . | akt store ks.akt ­­ backup ● Extraction: akt extract ks.akt ­­ backup | tar xzf ­
  • 20. https://github.com/stcarrez/ada-keystore 20 AKT : un partage sécurisé ● Importer les clefs GPG des participants ● Création du keystore: akt create ks.akt ­­gpg key­id­1 key­id­2 ● Chaque participant utilise sa propre clef GPG privée akt store ks.akt documents.zip
  • 21. https://github.com/stcarrez/ada-keystore 21 AKT : évolutions ● Support de ChaCha20 (alternative à AES-256) ● Support de SmartCart/PKCS#11 ● Scellement des blocs avec arbre de Merkle ● Intégration avec le Cloud dans GAKT
  • 22. https://github.com/stcarrez/ada-keystore 22 Conclusion ● Pas de post-it pour les mots de passe ● Pas d’excuse pour les clefs d’API dans GitHub ● AKT pour crypter vos documents sur le Cloud ! ● Disponible pour GNU/Linux, FreeBSD, NetBSD ● Open Source, Contributions Welcome !, License Apache 2.0 ● Documentation – https://ada-keystore.readthedocs.io/en/latest/