Introduction Details Random info End Fenrir Whoamiopensourceday.org/slides/OSD2014-Fenrir.pdf ·...

20
Introduction Details Random info End Fenrir Whoami Luca Fulchir, Magistrale Informatica qui a Udine, Sistemista, esperto in sicurezza, reti. Presidente AsCI, organizzatore OSD. Luca Fulchir – [email protected] University of Udine, Italy Fenrir – Authentication, Encryption & Transport protocol – http://fenrirproject.org 1 of 20

Transcript of Introduction Details Random info End Fenrir Whoamiopensourceday.org/slides/OSD2014-Fenrir.pdf ·...

Page 1: Introduction Details Random info End Fenrir Whoamiopensourceday.org/slides/OSD2014-Fenrir.pdf · accesso a facebook ma non alla banca, il tuo pc a tutti e due) ... fenrir.example.com.

Introduction Details Random info End

Fenrir

Whoami

Luca Fulchir,Magistrale Informatica qui a Udine,Sistemista, esperto in sicurezza, reti.Presidente AsCI, organizzatore OSD.

Luca Fulchir – [email protected] University of Udine, ItalyFenrir – Authentication, Encryption & Transport protocol – http://fenrirproject.org 1 of 20

Page 2: Introduction Details Random info End Fenrir Whoamiopensourceday.org/slides/OSD2014-Fenrir.pdf · accesso a facebook ma non alla banca, il tuo pc a tutti e due) ... fenrir.example.com.

Introduction Details Random info End

Fenrir

Fenrir

Tesi magistrale in sicurezza delle reti.I Transport protocolI Encryption protocolI Authentication protocol

WARNING: work in progress, molte cosesono ancora solo su carta, siamo solo a 9k righe dicodice.

Luca Fulchir – [email protected] University of Udine, ItalyFenrir – Authentication, Encryption & Transport protocol – http://fenrirproject.org 2 of 20

Page 3: Introduction Details Random info End Fenrir Whoamiopensourceday.org/slides/OSD2014-Fenrir.pdf · accesso a facebook ma non alla banca, il tuo pc a tutti e due) ... fenrir.example.com.

Introduction Details Random info End

Fenrir

Ne abbiamo bisogno?I Trasporto:

I TCP / UDPI SCTP / DCCPI Google’s QUIC, D.J.B.’s minimaLT

I CifraturaI SSL / TLSI Google’s QUICI D.J.B.’s minimaLT

I AutenticazioneI KerberosI OAuth (unfortunately)I SPID (incoming, take cover)

Quindi perche uno nuovo?Per avere una libreria unica, per un sistema federato e perche,seriamente, OAuth?

Luca Fulchir – [email protected] University of Udine, ItalyFenrir – Authentication, Encryption & Transport protocol – http://fenrirproject.org 3 of 20

Page 4: Introduction Details Random info End Fenrir Whoamiopensourceday.org/slides/OSD2014-Fenrir.pdf · accesso a facebook ma non alla banca, il tuo pc a tutti e due) ... fenrir.example.com.

Introduction Details Random info End

Fenrir

Why? (OAuth/SPID workflow)

I TCP connectionI TLS connectionI HTTP/XML exchange

QUIC, minimaLT proteggonol’handshake, non supportanoautenticazione posticipata,federazione, autorizzazioni...

Luca Fulchir – [email protected] University of Udine, ItalyFenrir – Authentication, Encryption & Transport protocol – http://fenrirproject.org 4 of 20

Page 5: Introduction Details Random info End Fenrir Whoamiopensourceday.org/slides/OSD2014-Fenrir.pdf · accesso a facebook ma non alla banca, il tuo pc a tutti e due) ... fenrir.example.com.

Introduction Details Random info End

Fenrir

Why?Spid:

Luca Fulchir – [email protected] University of Udine, ItalyFenrir – Authentication, Encryption & Transport protocol – http://fenrirproject.org 5 of 20

Page 6: Introduction Details Random info End Fenrir Whoamiopensourceday.org/slides/OSD2014-Fenrir.pdf · accesso a facebook ma non alla banca, il tuo pc a tutti e due) ... fenrir.example.com.

Introduction Details Random info End

Fenrir

Oh god, why...Spid:

Complesso (get, post, redirect)Niente certificate pinninghttp/HTML server+client

trasparent window hackusiamo ancora le password

...e XML...Luca Fulchir – [email protected] University of Udine, ItalyFenrir – Authentication, Encryption & Transport protocol – http://fenrirproject.org 6 of 20

Page 7: Introduction Details Random info End Fenrir Whoamiopensourceday.org/slides/OSD2014-Fenrir.pdf · accesso a facebook ma non alla banca, il tuo pc a tutti e due) ... fenrir.example.com.

Introduction Details Random info End

Features

Layer 3 (Trasporto)

I UDP-based – control flow reimplementatoI message-oriented (Non bytestream come TCP)I supporto multi stream (Stile SCTP, piu messaggi per

pacchetto)I header brevi (21 bytes + UDP (8) minimum)I consegna Reliable/unreliable (per-stream)I consegna ordinata o fuori ordine (per-stream)I (piu altre due sorprese, aspettate le slide finali ;))

Luca Fulchir – [email protected] University of Udine, ItalyFenrir – Authentication, Encryption & Transport protocol – http://fenrirproject.org 7 of 20

Page 8: Introduction Details Random info End Fenrir Whoamiopensourceday.org/slides/OSD2014-Fenrir.pdf · accesso a facebook ma non alla banca, il tuo pc a tutti e due) ... fenrir.example.com.

Introduction Details Random info End

Features

Cifratura

I perfect forward securityI NON basato su SSL/TLS (ma scambio di chiavi simile)I NON basato su X.509: la fiducia deriva da DNSSEC (o altro)

I Nessuna gesione di PKII Non serve spendere per certificati!

Luca Fulchir – [email protected] University of Udine, ItalyFenrir – Authentication, Encryption & Transport protocol – http://fenrirproject.org 8 of 20

Page 9: Introduction Details Random info End Fenrir Whoamiopensourceday.org/slides/OSD2014-Fenrir.pdf · accesso a facebook ma non alla banca, il tuo pc a tutti e due) ... fenrir.example.com.

Introduction Details Random info End

Features

Autenticazione

I autenticazione posticipata: anonimo⇒autenticato durantela stessa sessione.

I Federazione: username = [email protected] algoritmo d’autenticazione ad-hoc (formalmente testato)I account management per-device (esempio: il tuo cellulare ha

accesso a facebook ma non alla banca, il tuo pc a tutti e due)

3 ruoli (ricordate Kerberos?)I Authentication ServerI ServiceI Client

Luca Fulchir – [email protected] University of Udine, ItalyFenrir – Authentication, Encryption & Transport protocol – http://fenrirproject.org 9 of 20

Page 10: Introduction Details Random info End Fenrir Whoamiopensourceday.org/slides/OSD2014-Fenrir.pdf · accesso a facebook ma non alla banca, il tuo pc a tutti e due) ... fenrir.example.com.

Introduction Details Random info End

Features

Autenticazione Federata

Application

Auth. Manager

Service

Auth. Service

1 : {Service, usernames}

2 : {Token, usernames}

3 : {newuser}

4 : {ok, keys}

5 : {ok, keys}

6 : {data}

Luca Fulchir – [email protected] University of Udine, ItalyFenrir – Authentication, Encryption & Transport protocol – http://fenrirproject.org 10 of 20

Page 11: Introduction Details Random info End Fenrir Whoamiopensourceday.org/slides/OSD2014-Fenrir.pdf · accesso a facebook ma non alla banca, il tuo pc a tutti e due) ... fenrir.example.com.

Introduction Details Random info End

Packet structure

Struttura del pacchetto

bytes 0 1 2 30-3 Connection id4 padlen (eventual padding)5-8 Stream id Data length9-12 flags Stream counter

verde == cifratoEncrypt-then-MAC o AEAD

Il tutto e allineato al byte, ma il client puo richiedere unallineamento diverso (2,4,8 byte)

Luca Fulchir – [email protected] University of Udine, ItalyFenrir – Authentication, Encryption & Transport protocol – http://fenrirproject.org 11 of 20

Page 12: Introduction Details Random info End Fenrir Whoamiopensourceday.org/slides/OSD2014-Fenrir.pdf · accesso a facebook ma non alla banca, il tuo pc a tutti e due) ... fenrir.example.com.

Introduction Details Random info End

Packet structure

Padding

bytes 0 1 2 30-3 Connection id4 padlen (eventual padding)5-8 Stream id Data length9-12 flags Stram counter

Random lunghezza campo padding: 1 byte per pacchetto, 4 bitsper streamLa randomness e inserita per rendere piu difficili analisi sullalunghezza del pacchetto (CRIME, BREACH).L’esistenza stessa di piu stream di dati dovrebbe rendere piudifficile l’analisi statistica della connessione.

Luca Fulchir – [email protected] University of Udine, ItalyFenrir – Authentication, Encryption & Transport protocol – http://fenrirproject.org 12 of 20

Page 13: Introduction Details Random info End Fenrir Whoamiopensourceday.org/slides/OSD2014-Fenrir.pdf · accesso a facebook ma non alla banca, il tuo pc a tutti e due) ... fenrir.example.com.

Introduction Details Random info End

Authentication

DNSSEC

I query: fenrir.example.com, type TXTfenrir.example.com. 86400 IN TXT “fenrir=”abcdefg....””

I la chiave pubblica, porta udp, ip (multipli)... base85-encodedI 1300-1400 bytes in un singolo messaggio TXT, firmato.

In DNSSEC tutto viene firmato, quindi lo riteniamo sicuro.Facile da modificare, hai completo controllo della tua zona,supporto a piu ip per servizio, failover, balancing, in un unicopacchetto.

Luca Fulchir – [email protected] University of Udine, ItalyFenrir – Authentication, Encryption & Transport protocol – http://fenrirproject.org 13 of 20

Page 14: Introduction Details Random info End Fenrir Whoamiopensourceday.org/slides/OSD2014-Fenrir.pdf · accesso a facebook ma non alla banca, il tuo pc a tutti e due) ... fenrir.example.com.

Introduction Details Random info End

Authentication

Qualche informazione

I token-based (niente password!)I Nessun timestamp (nessuna sincronizzazione di orologi!)

Un’applicazione (manager) viene eseguita sul device, mantiene itoken per i tuoi account.Il programma che vuole autenticarsi in qualche servizio si connette(dbus) al manager e ottiene le informazioni per la connessione –NON i token

Luca Fulchir – [email protected] University of Udine, ItalyFenrir – Authentication, Encryption & Transport protocol – http://fenrirproject.org 14 of 20

Page 15: Introduction Details Random info End Fenrir Whoamiopensourceday.org/slides/OSD2014-Fenrir.pdf · accesso a facebook ma non alla banca, il tuo pc a tutti e due) ... fenrir.example.com.

Introduction Details Random info End

Authentication

Reticolo d’autenticazione

I ogni servizioha un reticolo di privilegi a lui associato.

I Il manager ha autorizzazione ”write”,ma puo limitare un’applicazione a ”read”

I dobbiamo trasferire il reticolo (3kb max) :(

Luca Fulchir – [email protected] University of Udine, ItalyFenrir – Authentication, Encryption & Transport protocol – http://fenrirproject.org 15 of 20

Page 16: Introduction Details Random info End Fenrir Whoamiopensourceday.org/slides/OSD2014-Fenrir.pdf · accesso a facebook ma non alla banca, il tuo pc a tutti e due) ... fenrir.example.com.

Introduction Details Random info End

Transport

Feature Avanzate

I 3-RTT handshake con syncookie SCTP style.I 2-RTT handshake QUIC styleI 1-RTT handshake minimaLT styleI protocollo simile a stun per comunicazione tra i client.I supporto multihoming senza ulteriori configurazioni.

Luca Fulchir – [email protected] University of Udine, ItalyFenrir – Authentication, Encryption & Transport protocol – http://fenrirproject.org 16 of 20

Page 17: Introduction Details Random info End Fenrir Whoamiopensourceday.org/slides/OSD2014-Fenrir.pdf · accesso a facebook ma non alla banca, il tuo pc a tutti e due) ... fenrir.example.com.

Introduction Details Random info End

Transport

Multicast

I NON ancora implementatoI per ogni tipo di connessione (reliable/unreliable, ordinato o

non ordinato)I multicast stream + unicast stream per ritrasmissioni.

Luca Fulchir – [email protected] University of Udine, ItalyFenrir – Authentication, Encryption & Transport protocol – http://fenrirproject.org 17 of 20

Page 18: Introduction Details Random info End Fenrir Whoamiopensourceday.org/slides/OSD2014-Fenrir.pdf · accesso a facebook ma non alla banca, il tuo pc a tutti e due) ... fenrir.example.com.

Introduction Details Random info End

Transport

ProxyHTTPS non puo essere cachato (a meno di non rompere la fiduciaX.509)...Ma Fenrir puo! (non implementato ancora)

I supporto a proxy a livello di protocolloI proxy trasparente / esplicitoI i servizi devono specificare che cosa puo essere cachato e

quanto a lungo.I necessario un id di risorsa example.com/resource/pathI il caching puo essere effettuato a livello ISP o locale in

maniera sicura. (Content Delivery Network)I la chiave di decifratura viene chiesta direttamente al server.

Luca Fulchir – [email protected] University of Udine, ItalyFenrir – Authentication, Encryption & Transport protocol – http://fenrirproject.org 18 of 20

Page 19: Introduction Details Random info End Fenrir Whoamiopensourceday.org/slides/OSD2014-Fenrir.pdf · accesso a facebook ma non alla banca, il tuo pc a tutti e due) ... fenrir.example.com.

Introduction Details Random info End

Status

Development status

Codice pubblico, ma non usabile (demo a breve)I C++11 standard, poche librerie esterne necessarie (libevent,

ssl)I licenza libreria: LGPL3 (double licensing)I auth daemon: GPLv3I client: GPLv3

Aiuto?Si grazie :)il codice va sempre ripulito, tenete d’occhio il sito per la campagnaIndiegogo. (verso Natale)

Luca Fulchir – [email protected] University of Udine, ItalyFenrir – Authentication, Encryption & Transport protocol – http://fenrirproject.org 19 of 20

Page 20: Introduction Details Random info End Fenrir Whoamiopensourceday.org/slides/OSD2014-Fenrir.pdf · accesso a facebook ma non alla banca, il tuo pc a tutti e due) ... fenrir.example.com.

Introduction Details Random info End

EOF

Thank you!

logo by Piera Zuliani – [email protected]

Luca Fulchir – http://fenrirproject.org

[email protected]

Future: Indiegogo + Open Technology Fund (cryptocat, tor...)Luca Fulchir – [email protected] University of Udine, ItalyFenrir – Authentication, Encryption & Transport protocol – http://fenrirproject.org 20 of 20