-
Notifications
You must be signed in to change notification settings - Fork 5
/
2018-1 Information Security Part2.fex
1778 lines (1705 loc) · 71.6 KB
/
2018-1 Information Security Part2.fex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
introduction
===
motivation:
basic infrastructure based on networked systems
functionality vs security tradeoff
basic definitions:
computer security:
prevent, detect improper actions of users
improper, proper actions defined relative to security
information security:
more general than computer security
proper use of information, independent of computer system
information /= data (can publish report without sources)
side-channels attack:
secure cryptography breaks due to faulty real world application
faults in the implementation, information leaks (sound, power usage)
security as policy compliance:
target is to build a system that meets specification within environment
the approach taken by software engineering, goal oriented view of security
for security, define (im)proper actions
assumed environment are users wanting to use (not break) the system
assumed adversary may networks, but no physical/side-channel access
policy compliance overview:
specification (what to do, security policy)
implementation (how is it done, security mechanism)
correctness (does it work, compliance)
formal:
secure if S||E |= P for system S, environment E, policy P
E difficult to define (need to know potential attackers)
S difficult to define (needs to include libraries, hardware, OS)
security policies:
also called security goals
CIA (traditional):
confidentiality (no improper disclosure of information)
integrity (no modification of information)
availability (no impairment of service/functionality)
more:
secrecy (no disclosure of information)
authenticity (who formulated message, more specific than integrity)
non-repudiation (accountability for actions)
plausible deniability (weak form of secrecy, contrary to non-repudiation)
auditability (integrity of whole system)
privacy:
anonymity (secrecy of principal identities, communication relationships)
data protection (personal data used only in certain ways)
access control:
protection of system resources against unauthorized access
enforcing the security policy by regulating use of system
data protection:
access control enforces conditions in present & past (provisions)
usage control enforces conditions in the future (obligations)
define security:
functional correctness, reliability, security may overlap
properties:
high-level description of system behaviours
policies:
conjunctions of different properties
or low-level & operational ("when choosing pw it must be long")
mechanisms:
concrete system components used to archive policy compliance
example policies:
bank:
authenticity of clients
integrity of accounts, user data
secrecy of customer data
non-repudiation of transactions
availability of logging
e-voting:
only registered voters can vote
each voter can vote only once
integrity of votes
privacy of voting information
individual (+universal) verifiability
availability of system during voting period
IBM secure processor:
cryptographic coprocessor with secure memory
firmware & hardware from IBM, software from customer
layers:
each layer has owner
each layer/owner has keypair, stored in persistent storage
higher level can't access lower level, physically secured
owner can use private key to authenticate commands for his layer i
owner can use private key to assign ownership of i+1
IBM acts as root of trust
properties:
outbound authentication (distinguish message from layer i from others)
inbound authentication (if A owner of layer then only A can command)
access to secrets (layer i secrets only accessed by trusted parties)
security types:
unilateral security:
security properties given to single system
system is secure if attacker can't deviate it from normal behaviour
multilateral security:
protect participants from each other, may need to employ 3rd party
SW vendor & customer both protect their IP by executing at 3rd party
security as risk minimization:
target is to minimize risk of abuse while keeping system running
the approach taken by administrators
avoid, minimize, accept or transfer risk
risk analysis:
focus on risk from vulnerabilities and their exploitation
owners:
they have valuable assets, which are under threat
impose countermeasures to reduce risk & vulnerabilities
threat agents:
threats from employees (unintentional or on purpose)
hackers, criminals, terrorists, foreign espionage agents
information-warfare operations to disrupt weapon, command structures
threats:
confidential data intercepted
integrity harmed by modification, fabrication
availability stopped by interruption of service
vulnerabilities:
interaction in unknown, hostile environment
vulnerable infrastructure, too short time to market, monocultures
how it fits together:
threat agents abuse threats which exploit vulnerabilities
threat agents abuse or damage assets
weakness can be exploited by threats to cause damage
reduction steps:
identify assets to protect
identify risks to those assets, risk = (chance * impact) of abuse
deduce how well countermeasures reduce risk and their tradeoffs
employ most effective countermeasures (intrusion detection vs prevention)
apply risk analysis:
iterate risk analysis & employing of countermeasures
use standards such as ISO 27000
email reduction:
mail content, sender/receiver link, availability
others reading, tampering mail, observe communication patterns
propose PGP
PGP reduces risk dramatically
but key exchange timeconsuming, limited support, users need education
face scanning reduction:
air travellers & those on the ground
terrorists will board planes
propose face scanning
detects some terrorists
but less privacy, false positives, false sense of security
examples:
web server:
bugs in server, php, modules
compromise often because systems not maintained or misconfigured
authentication vulnerabilities:
undetected exploitation with leaked password
passwords often poor or non-existent
poorly secured administration-level accounts
weak hashing algorithms stores with weak security
open-SSL:
cryptographic support library, used by TLS, POP, IMAP, ...
multiple vulnerabilities exposed, remote code execution (even as root)
core mechanisms:
DH:
choose generator g, use prime p
compute X with secret s => g^s mod p
compute Y with secret s2 => g^s2 mod p
prevent MitM by authenticating public keys (but preserve PFS)
prevent DoS (repeating Y computation) with proof of work
key formats:
pre-shared symmetric keys
asymmetric key-pair for en/decryption or sign/verify
network security
====
network context from security perspective (layers, protocols, internet)
options, tradeoffs of securing systems in practice
computer networks:
physical (links, bit transfer) like wire, wireless
abstract (communication medium between principal, secure channel)
layered communication:
communication divided in layers (separation of concerns)
i-th layer communicates with its peer on same level
uses only services of lower layer
TCP/IP protocol reference model:
application (telnet, FTP, HTTP)
transport (TCP, UDP) for end-to-end transport
network (IP) for the internet
link (IEEE 802.x) for single-link transport
ISO reference model:
additionally presentation, physical, session layers
encapsulation:
header/trailers added to packets on stack traversal
encryption, decryption, transformation of lower levels
internet protocol (IP):
delivers data across network
headers specify source, target address
compute next hop from destination address & forward (best-effort)
transmission control protocol (TCP):
reliable transport over network (all or nothing)
all packets delivered without loss, duplication, reordering
internet:
confederation of networks used for TCP/IP
no global domain of trust (subnetworks, long paths, spoofing, faking)
TCP/IP does not provide authenticity or confidentiality (spoofing)
how to secure communication:
where (end-to-end, hop-to-hop, ...)
which layer (link, network, transport, application)
examples for secure communication:
PGP (end-to-end, at application layer)
SSL/TLS (end-to-end, implementation below application layer)
WPA (encrypts first hop, hop layer) for confidentiality, access control
IPsec VPN (client to gateway) to protect internet traversal
application managed security:
enterprise security policy integrated in applications
each app responsible for secure communication, authentication, logging, ...
end-to-end principle:
complete, correct implementation only possible in application layer
target application has specific requirements, can support implementation
trust-to-trust (implement functionality between trusted entities)
brain-to-brain (desired end state)
reliable file transfer example:
possible errors from disk, memory, routers, ftp software, checksums limited
stronger guarantee if computed end-to-end
no trust/change/configure/manage of intermediate nodes/layers/protocols
security decision based on userID, data, etc
more examples:
mail encryption / authentication PGP, S/MIME
specialized client/server systems like eVoting
assumes correct mechanisms:
design (crypto done right, no attacks from lower levels)
implementation (no buffer overflows, injections)
assumes mature users:
understand & respect enterprise security policy
properly configure mechanisms, client credentials
immune to social engineering
problems:
3rd party, legacy applications can't keep up with policy
midbox still needed (incident response)
interference with midbox (encrypted mail hinders spam/virus scanner)
poor fit with centrally managed & enforced security
network managed security:
use SSL, VPN
implementation of IP stack:
transport layer & below (like IPsec) implemented in OS
above implemented in applications in user process
advantages:
implement security solution once
don't bother users with security (lack of knowledge, interest)
secure legacy, standard applications without own security
central management of security at midboxes
examples:
SSL (OS unchanged, but no client side authentication)
IPsec (transport security, but only IP address authentication)
WPA (secures most vulnerable link, but no others)
protecting networks:
secure using different approaches, general protection often too coarse
concepts:
defence in depth:
redundancy, secure each layers independently
employ technical, physical, administrative measures
but difficult to administrate, different policies
keep it simple:
easier to implement, administrate, configure
similar to system hardening
system hardening:
only needed services running
good engineering (code review), maintenance (install patches)
trust perimeter:
boundary between trusted, untrusted machines
multiple layers of trust possible with their own boundaries
control everything that passes perimeter (with firewall)
but maybe ill-defined (inside attackers, machine not trustworthy)
usability vs security tradeoff
firewalls:
don't allow adversaries on machine
packet filters:
router with simple access control
based on packet content, sourceId, port, ...
enforce preconfigured policies like "block FTP"
application-layer proxies:
wrapper around application, control io/access
may enforce additional authentication
can inspect content of traffic, filter undesirable data, ...
use multiple:
but complex to setup, maintain, false sense of security
does not stop inside attacks, malware, etc
secure web server:
prime target for attack, sacrificial machine (wipe if hacked)
put firewalls between server & outside & inside (at both ends)
pro:
scales better than host security, secures legacy systems
central place to setup secure policy
contra:
bad at surfing, emails, https, perimeter not well defined (cloud)
minimize risk of exploits:
good security engineering practices (patch vulnerabilities, maintain)
access control & compartmentalization
keep backups:
multiple physically separate locations
useful for integrity, availability but not confidentiality
policies & support for incidents:
detections & response
plan for worst case (attacker in network for years)
detect intruders:
monitor, analyze networks for possible incidents
intrusion detection systems (IDS):
host-based (identify break-ins), network-based (DoS)
combine multiples (but high false positive rate)
signature based (known threads, repeated login attempts)
anomaly based (ML to identify abnormal behaviour)
IDS drawbacks:
limited effectiveness (black box, unknown if attacks well handled)
lots of false positives (costly to handle, responsibles stop careing)
high live-cycle costs (training, maintenance)
arms race (powerful attacker can subvert system)
security protocols
====
motivation:
omnipresent & critical:
authentication (bank card, single sign on)
secure communication (SSL, SSH, IPsec)
special purpose (evoting, car-key systems)
in general:
use cryptographic primitives for security objectives
"security protocols are three line programs people manage to get wrong"
bad samples:
A -> B {{message}_KsA}_KB -> but B can now resend message of A
A -> B {{message}_KB}_KsA -> but C can now resend message of A
goals:
understand arising of problems
be precise (goals, execution correctness of protocol)
examine protocols & understand strengths & weakness
definitions:
protocols:
set of rules describing how messages are exchanged (distributed algorithm)
in practice, informal/formal description with diagrams, data types
security protocol:
also called cryptographic protocol
uses cryptographic mechanisms to archive security objectives
attacker models:
usually knows protocol but cannot break crypto
can be passive but overhears all communication
or active and can intercept & generate messages
or insider impersonating a role (running the protocol)
dolev-yao attacker:
the standard symbolic attacker model, strong model
read, intercept & create all messages
decompose message in parts
may compromise some agents and learn keys
but needs inverse keys for decryption (assume crypto secure)
communication between honest agents should still archives objectives
formalization like N1 element_of (IK U M) => N1 element_of has(IK U M)
protocol properties:
prefix with "if honest A completed run with honest B, then"
aliveness:
B has run the protocol in the past
prove with signature
weak agreement:
B has run the protocol believing to communicate with A
prove with signature including A
non-injective agreement:
B has run the protocol believing to communicate with A
A,B agree on all values exchanged
prove with signature including A & all other values
(injective) agreement:
B has run the protocol believing to communicate with A
A,B agree on all values exchanged
each run of A corresponds to a unique run of B
prove with signature including A, nonce & other values
recent dimension:
if property only established if both run has been recent
then can prefix property with "recent" (like "recent aliveness")
prove with nonce
protocol claims:
prefix with "if honest A completed run with honest B, and claimed *** on some value, then"
secrecy:
specific value is not learned by attacker
ensures data only available to those authorized
key authentication if data is a key
key confirmation if assurance that other possesses key
authentication:
specific participant is not impersonated
ensures to one party identity of other
synchronization protocol:
ensures recent injective agreement & authentication
protocol design:
notation:
A, B as roles
Alice, Bob as names (instantiations of roles)
KA for public key A, KsA for secret key A; {message}_KsA signing
KAB for symmetric key between A and B; {message}_KAB encryption
N_A fresh data (nonce), T timestamp; used for challenge, response
M_1 || M_2 message concatenation
A -> B:: {A, N_A}_KB when A sends B a message
modelled asynchronous, defines set of event sequences (traces)
principles of security protocols (Abadi Needham):
informal guidelines to spot errors (not necessarily minimal/optimal)
but no guarantees even if followed appropriately
explicit communication:
interpret message based on content only
to counter replay or usage in different context
appropriate action:
define conditions upon message is appropriate
to allow for transparent review
naming:
name identity in message if needed to process it
to prevent usage in different context
encryption:
define why what is encrypted
confidentiality assumes only receiver knows key
authenticity assumes only sender knows key
bind together parts of message by encrypting as one
produce random numbers by encrypting counters
to avoid redundancy
encoding:
be explicit about encoding
prevent cross-protocol, different context reuse
trust:
explicitly define trust relations protocol depends on
reason why they are appropriate and required
to allow appropriate implementation
signatures:
do not prove knowledge of singed encrypted content
only prove knowledge of content readable by sender
nonces:
define guarantees (new, random, unpredictable, timely, authorship?)
nonces can be used to prove freshness and authorship
define if nonces must be new / random
define if nonces must prove authorship
protect predictable nonces from replay
protect timely nonces from faulty clock
keys:
do not assume used key has been establish recently
prevent continuous usage of compromised keys
basic mechanisms:
cookie exchange:
initial roundtrip to establish cookie, always resend on subsequent request
before any expensive computation validate cookie to prevent DoS
A -> B :: C1, B -> A :: C2 C1; A -> B :: C1 C2 X; etc....
freshness mechanism:
nonce (but must be random)
one-way counter (but must sync & store, encrypt to avoid guessing)
timestamps (but must sync clock)
challenge-response w/ nonces (but needs roundtrip)
attacks:
forms:
man in the middle (C between A, B communication)
replay attack (record, later resend message, parts)
reflection attack (send information back to sender)
oracle attack (use protocol as decryption/encryption service)
guessing attack (protocol using pw allows to verify if correct pw found)
type flaw attack (B interprets M differently)
why its difficult to spot attackers:
assumptions unclear (intruder or insider?)
complex model despite it looking simple
humans bad at envisioning all possible interleaving computations
real protocols more complex & faulty design/standardization process
examples:
NSPK:
(1) A -> B :: {A, N_A}_KB
(2) B -> A :: {N_A, N_B}_KA
(3) A -> B :: {N_B}_KB
MitM attack with I(A)
Otway-Res protocol:
authenticated key distribution with key authentication, freshness
I as protocol run identifier, KSA, KSB already known
(1) A -> B I, A, B, {N_A, I, A, B}_KSA
(2) B -> S I, A, B, {N_A, I, A, B}_KSA, {N_B, I, A, B}_KSB
(3) S -> B I, A, B, {N_A, K_AB}_KSA, {N_B, K_AB}_KSB
(4) B -> A I, A, B, {N_A, K_AB}_KSA
type flaw attack with I(B), replays #1 as #4 back to A
type flaw attack with I(S), replays #2 in #3
Andrew Secure RPC:
exchange fresh, shared key between two principals having a shared key
K_AB' key & N_B' nonce for next session
(1) A -> B :: A, {N_A}_KAB
(2) B -> A :: {N_A + 1, N_B}_KAB
(3) A -> B :: {N_B + 1}_KAB
(4) B -> A :: {K_AB', N_B'}_KAB
type flaw attack when MitM I(A), I(B) use #2 as #4
key exchange CA (denning & sacco):
key secrecy & agreement
T_A limits usage, B knows its the target because its K_B was used
T_A timestamp from A
(1) A -> S :: A, B
(2) S -> A :: C_A, C_B
(3) A -> B :: C_A, C_B, {{T_A, K_AB}_KsA}_KB
MitM attack when I(C) <-> A uses #3 for I(A) <-> B
electronic car key example:
requirements are fast, cheap, usable
personal key K, car C, key between car & key K
(1) K -> C "open" (but can do replay attack)
new requirement "if door opens, key was pressed"
(2) K -> C {"open"}_K
new requirement "different secret, car remembers secrets"
(3) record, block, replay later
replace "key was pressed" -> "recently pressed his key"
(4) time skew, open multiple times
new requirement "X times pressed, X times door open"
(5) K -> C "open", C -> K "challenge", K -> C {"challenge"}_K
formal analysis of protocols:
approach protocol correctness as system correctness
build formal symbolic model M as transition system with algebra
specify property to be archived (e.g. secrecy)
show correctness (model checking, theorem proving) in environment E
interleaving trace model:
has linear ordering, synchronous model
trace is a sequence of events
protocol denotes a trace set (all possible interleavings)
formalism:
P formalizes protocol steps
t formalizes existing state (require t element_of P, previous_messages element_of t)
N_A, N_B are nonces (require fresh(N_A))
example NSPK:
0-3 formalize protocol, 4 formalizes attacker
0. <> element_of P
1. t, A -> B :: {A, N_A}_KB element_of P
2. t, B -> A :: {N_A, N_B}_KA element_of P
3. (similar to 2)
4. t, Spy -> B :: X element_of P if X element_of has(sees(t))
if A sent N_A to B and A received N_A then B sent N_A
has(T):
gets smallest set of messages inferable from T
formal rules define attack model
trivial, pairing / unpairing, encryption / hash, decryption if key known
includes base cases (spy knows public keys, can generate nonces)
property:
set of traces, formulate predicates with those sets
predicates describe property, evaluate to true or false
interactive verification:
create proof scripts, then check with compiler
but unprovable goals
analysis with model checking:
inductive definition allows to construct infinite tree
property corresponds to set of nodes
state enumeration to find node in property set
model checking tools to avoid complete enumeration
automatic, algorithmic methods (symbolic trees, nodes)
better than interactive constructed proofs
scyther:
supports protocol verification/falsification for different attacker models
keys, hashes, key-tables, multiple protocols, composed keys
backwards search (starts with security violation) to initial (valid) state
generates isabelle, HOL proofs
specify protocols:
declare existing key architecture
declare roles with vars, send_i, recv_i, claim_i
semantics:
protocol P generates traces(P) in presence of intruder
intruder learns all messages (intruder knowledge IK)
intruder knows all previous messages at receive
intruder can replace any messages with all IK from before
transition system semantics:
create thread (for role R and agent A create thread tid)
thread as ordered list of events, look at next event for conditions
send (select tid with send(m), add to trace & remove from tid)
recv (select tid with recv(m), add to trace & remove from tid)
claim (select tid with claim, log for subsequent checking)
example secrecy property:
if honest A executes secrecy claim x then attacker does not know
for all t element_of traces(P)
if (thread X communicates with a in t and t(i) = claim(A, Secret, x)#X)
then x not_element_of has(IK)
reasoning with semantics:
can reason by hand, but computer much better
scyther automates search, gives attack example if found
fastest method, guaranteed to terminate, user friendly with UI
complexity results:
undecidable in general
NP-complete for strong constraints (therefore only limited #thread)
analysis assumes only protocol being executed (chosen protocol attack)
could use separate keys for separate protocols (but expensive)
why is status quo so miserable:
competitions for cryptographic primitives but not for protocols
inadequate processes for protocols:
industry push main driver
often new standards, speed more important than verification
lack of understanding & politics
unhealthy competition, committees
examples:
NSPK proved with BAN logic, but logic broken
WEP not proven, industry push overrides security analysis
WiMAX (telecom, for wide-distance) no formal specification
mesh network standard proven by unsound PCL
ISO 9798 (entity authentication) with errors, ISO amended
Protocols
====
access control :
in centralized systems:
security admin has authorization monitor
user authenticates against reference monitor
reference monitor implements access control to objects
auditing oversees the whole process
in a distributed setting:
authentication by assertion was standard (just user id)
then introduced password (but in cleartext, thus not much better)
kerberos:
authentication, authorization, audit (audit not implemented)
single-sign on protocol
one password per session, subsequent authentication behind the scenes
developed in the 80's, still used today, windows built-in
properties:
secure (authenticated users access their authorized resources)
single sign-on (single password to obtain all network services)
scalable (scale with number of users & servers)
available (supported by replicating kerberos server)
general pattern (1):
setup of secure channel
A, B, trusted T which shares keys with A, B
A -> T :: request to communicate with B
T -> A :: {K_AB}_AT, {K_AB}_BT
A -> B :: {K_AB}_BT, {m}_K_AB
C can be between A and T to impersonate B
(1) + freshness & names (2):
loosely based on needham-schroeder shared-key protocol
establish shared channel & freshness
A -> T :: A, B, N_1
T -> A :: {N_1, B, K_AB, {K_AB}_BT}_AT
A -> B :: {K_AB}_BT
B -> A :: {N_2}_K_AB
A -> B :: {N_2 - 1}_K_AB (transformed to disable replay)
kerberos takes this without double encryption, nonces are timestamp
does not provide secrecy
kerberos IV:
authentication using Kerberos Authentication Server KAS
authorization using Ticket Granting Server TGS
access control of servers which check the TGS ticket
operation:
(1) login & request network service, send request ticket (once per session)
(2) session keys (like K_AB & ticket (like {K_AB}_BT) granted by KAS
(3) workstation sends ticket & authenticator to TGS
(4) TGS creates ticket for requested server
(5) workstation sends ticket & authenticator to server
(6) server verifies & grants access (may starts two-sided authentication)
authentication phase (authentication server):
once per user login session to get AuthTicket for TGS
K1 can be derived from user password
K2 shared between KAS, TGS
K3 session key between A, TGS; livetime of several hours
A -> KAS :: A, TGS
KAS -> A :: {K3, TGS, N1, {A, TGS, K3, N1}_K2}_K1
authorization phase (ticket server):
once per type of service to get ServTicket for B
K4 shared between B, TGS
K5 session key between A, B
A -> TGS :: {A, TGS, K3, N1}_K2, {A, N2}_K3
TGS -> A :: {K5, B, N3, {A, B, K5, N3}_K4}_K3
service phase (network service):
once per service session to authenticate at B
A -> B :: {A, B, K5, N3}_K4, {A, N4}_K5
B -> A :: {N4 + 1}_K5
multiple realms, kerberi:
can use multiple realms (single realm defined by KAS & TGS)
inter-realm protocol supported, using symmetric keys (n^2)
made easier in v5 with public key cryptography
limitations:
encryption not needed, attacker can flood KAS (initial message), DoS
double encryption redundant when returning tickets (removed in v5)
relies on synchronized clocks (replay using old tickets)
cryptographic weaknesses
in practice:
application layer protocol
can wrap applications ("kerberize") to make secure (ftp, smtp)
TLS:
provides secrecy, integrity, (optional mutual) authentication
conceptually a transport layer protocol, but no OS implementation
subprotocols:
handshake (initiates connection with desired properties)
record (to send data, describes how compressed, authenticated, encrypted)
others (renegotiation of cyphers, error recovery)
core concepts:
session (defines keys/encryption/MAC between client/server)
connection is a secure stream within session
handshake:
hello:
S_id for session identifier, P_a for cypher suite
everything unprotected, authenticated later
A -> B :: A, N_a, S_id, P_a
B -> A :: N_b, S_id, P_b (chosen from P_a)
server certificate:
may allows additional key exchange for DH exchange
server may also request client certificate
B -> A :: certificate(B, K_B) (X.509v3 certificate)
client exchange:
PMS pre-master secret, PRF pseudo random function, H hash function
PMS used to compute master secret M=PRF(PMS, ...)
A -> B :: certificate(A, K_A) (optional)
A -> B :: {PMS}_K_B
A -> B :: {H(...)}_K_a (optional)
finish:
compute keys from (N_a, N_b, M) for MAC/IVs/clientK/serverK
finished is hash of all previous messages to avoid downgrade
authenticates server, guarantees integrity
A -> B :: {Finished_A}_clientK
B -> A :: {Finished_B}_serverK
using in practice:
server has public key certificate (private key stored on server)
organization may additionally provide user certificates
problems:
attacks on handshake, record layer protocols
downgrade attacks on cypher suites
timing attacks, error messages leaking information
implementation errors with buffer underflows (heartbleed)
but social engineering probably easier than exploiting SSL
attacks:
MitM attack:
copy target webpage & forward
social engineering, DNS poisoning, IP highjacking
users! (don't understand SSL, certificates, error messages)
phishing:
5% of users give sensitive info to spoofed webpages
2 mio users resulting in loss of 1.2 billion on US
23% don't notice security indicators, majority ignores warnings
enhancements:
two channel authentication:
multiple communication channels (like TAN)
but requires existing relation with server (like registered phone number)
session aware user authentication:
combine channel information with credentials
so forwarding does not work anymore
user client certificates:
attacker cannot sign all previous messages correctly
PKI rollout complicated, not userfriendly
IPsec:
end-to-end security between clients/servers or midboxes (firewalls, routers)
traffic filtering with a policy database
very complex standard, no comprehensive analysis exists
works on transport layer (done by OS), can be used by any application
elements:
security association (SA):
defines security services (encryption, integrity, authenticity)
defines algorithms (DES, AES, MD5, SHA1) & session keys, IVs
setup by hand or negotiate with IKE
security policy database (SPD):
to decide for each packet transport mode, SA, ESP or AH, ...
configured by administrator, also basic firewall functionality
protocol modes:
transport:
between endpoints, gateway
payload encrypted & authenticated, IPsec inserted after IP header
tunnel:
protects the path G1, G2 between parties A, B
payload protocol encapsulated in delivery protocol
original packet has A, B as source, target
G1 modifies packet such that G1 new IP source, G2 new IP target
G2 strips out original header (A,B)
authentication header (AH):
for integrity, authenticity of message/IP
next header (type of next payload), length (of AH), reserved
32bit security parameter index SPI to identify SA
32bit sequence number field (prevent duplication, replay)
32bit words with authentication data (like sha1 MAC)
transport mode:
AH after original IP header (before IP payload)
using MAC of entire packet (except mutable fields)
end-to-end protection, but integration with IP needed
tunnel mode:
AH after IP tunnel header (before original IP header)
inner header carries original target, source
outer header protected, may contains different IPs
encapsulating security payload (ESP):
for integrity (optional), secrecy of message/IP
32bit security parameter index SPI
opague transport data (parameters for crypto algorithms)
transport mode:
adds ESP header after original IP header, ESP trailer & auth after data
encrypts data portion (payload) of each packet, IP header unchanged
tunnel mode:
ESP header after IP tunnel header, ESP trailer & auth after data
old header, payload encrypted (optionally authenticated)
internet key exchange protocol (IKE):
on application layer, to negotiate security association
invoked if IPsec session started but SA unknown
establishes a SA (protocol, keys, cryptographic & hash algorithms)
based on DH and extensions, very flexible & complex
establishment phase 1 (main mode):
parties negotiate SA to use in phase 2
different variants (pre-shared symmetric or signatures or 2 PK variants)
offers identity protection, flexibility in terms of parameters
(1) A -> B :: C_1 (cookie) ISA_1 (cryptographic proposals for ENC, AUTH)
(2) B -> A :: C_1, C_2, ISA_2 (chosen proposals, B keeps state)
(3) A -> B :: C_1, C_2, X[,g,p], N_1
(4) B -> A :: C_1, C_2, Y, N_2
(5) A -> B :: C_1, C_2, {ID_1, AUTH_1}_K
(6) B -> A :: C_1, C_2, {ID_2, AUTH_2}_K
use skeyid=H({N_1, N_2}, DH secret) to derive keys
signed HASH=H(skeyid_a, {X, Y, C_1, C_2, ISA_1, ID_1}) for authenticity
need cookies to prevent DoS
can merge (6) and (4), but was not merged to do DH in parallel
need nonces because DH reused, cookies potentially not unique
there exists an aggressive mode which provides no identity protection
establishment phase 2:
SA of phase 1 used to create more SA for further communication
public key infrastructure
=======
key management:
mechanism to bind identity & purpose to key
distribution, generation, maintenance, revocation of these keys
symmetric key with trusted parties, principals having keys with all others
asymmetric keys with public keys bound to principals
CA-base PKI:
generate key-pair, send public key to certificate authority CA
CA verifies who generated key-pair, and signs public key
third parties can obtain signed public key
CA process:
certificate signing request, money, legal documentation to CA
CA checks info then signs PK (by mail, call)
clients:
store CA keys (root of trust), may have self-signed certificates
use PKI for encryption, authentication, non-repudiation
certificates:
certificate binds identity to key
contains issuer, expiration, usage
signature of hash of content done by CA
X.509:
defines structure of certificates, widely used
version, serial number SN, issuer name (pair (SN,IN) unique)
signature algorithm identifier (algorithm, parameters)
period of validity (start, end)
subject name
subject public-key info (algorithm, parameters, key)
signature (hash of all other fields, signed by CA)
issuer unique identifier, subject unique identifier (optional)
validate:
validator already knows CA public key and trusts it
validator computes hash and checks signature & validity period
certificate forms:
domain validation DV sends email to confirm membership
extended validation EV contacts organization, many other checks
marketing feature to make customer trust more
trust models:
trust in an entity if it behaves as it should
trustworthiness of an entity if it actually behaves as it should
certification chains example:
verify certificate with public key X
base case if signing key of X already trusted
recursive case if X signed by other trusted entity Y
trust that X correctly issues certificates (for signature)
trust that X recommended by Y is trustworthy (for recursive)
construction:
A believes to have authentic X public key
A trusts X to certify keys
A has certificate for Y signed by X
set up problems:
how does A have root of trust keys
how does A obtain the certificates
which CA does A trust and for what
direct trust:
single CA for entire world
advantage:
certificate chain of length 1
need only one public key to distribute
only a single CA we need to trust
disadvantages:
no organisations trusted by all countries, companies, universities
inconvenient, insecure, expensive to obtain from distant organisation
periodic rekeying can't be done by single CA
CA has monopoly and can charge excessive prices
single CA + registration authority RA:
RA verify name/key binding, send signing request to CA
CA has key of all RA
users interact with local RA
advantages:
certificate chain of length 2
need only one public key to distribute
can revocate RA key easy because simply contact CA
disadvantages:
disadvantages of direct trust
additionally must trust all RA
oligarchy CA:
multiple CA, else same like direct trust
advantages:
more convenient as CA can be local
competition prevents abusive pricing
disadvantages:
compromise of any CA key suffices
requires principals to store keys (browsers, but MitM)
proposals:
local scoping (regional CA for regional entities)
variant scoping (can only issue for specified namespace)
oligarchy CA variants:
cross certificates:
cross certificates (CA1 signs CA2 and vice versa)
they effectively recommend each others
configured + delegated CA:
configured keys authorize delegated CA, complete transitive trust
good because users can obtain certificates easily
bad because any compromise is complete due to assumed transitive trust
also called web model, browsers have own store or use OS store
web model:
certificate discovery (collect from different kinds of stores)
path validation (walk the walk, retrieve from URL or store)
revocation checking (check if any on path are revoked)
web of trust (PGP):
people recommend each other
no trust in CA, verify others manually
keys for communication, keys to sign others identity
store known keys & level of trust (full, marginal, no trust)
key valid if singed personally OR by fully trusted OR three marginal
key valid if path of singed keys is 5 steps or shorter
web model:
MitM possible with single corrupted CA
root of trust in OS, browser (over 1400 in microsoft, mozilla)
buy-in with 50k per browser
breaches:
incompetence, greed, collusion, corruption of CA lead to multiple breaches
use cases of bad certificates include espionage, observations
lenovo embedded root CA to inject ads, private key leaked
bogus certificates can be bought to MitM any connection
CA assumptions:
has no root or delegated key compromised
does really check identity before issuing
crypto assumptions:
secure, no vulnerabilities
browser assumptions:
root certificates are correct, unaltered
routines to update certificates work correctly
chaining works as intended
no remote code execution
malicious site cannot overwrite locks
user assumptions:
user checks for https, locks, correct urls
user does not accept bogus certificates, takes warnings seriously
alternative models:
stakeholders:
users (identity theft; needs to remove bad certificates)
domains (may be liable for damages; can't really defend)
browser/OS (trust issues, very powerful; rarely use power)
certificate authorities (weakest link security; want to avoid blacklist)
client-centric:
requires no change from server operators & reduce trust in CAs
policy engine:
restrict type of certificates a CA can generate (scope with name-spaces)
perspective repository:
notary server visits SSL webpages & stores certificates
user configures notary server, verifies all certificates
user detects MitM, but no privacy (notary server learns connections)
convergence repository:
contact convergence server over intermediary, onion routing
like perspective with privacy, but more latency
SSL observative:
collects global SSL info, but not frequently updated
monkeysphere project:
distribute keys independently of CA's, for SSH keys, RSA verification
kicks in if other certificate failed, uses PGP web of trust
CA-centric:
easier revoking of certificates
certificate revocation list (CRL):
list of all revoked certificates maintained by CA
url contained in root certificates & publicly accessible
clients check themselves or use validation service
revocation because changes to names, private key compromised
X.509 with creation date, issuer, date of next CRL, revoked certificates
online certification status protocol (OCSP):
OSCP server states timestamped if certificate is good/revoked/unknown
but another roundtrip, servers slow, errors not treated fatal
attach OSCP to all certificates ("stapling") to counter some issues
domain centric:
accountability or removal of CA validations
key pinning:
store hash of certificates for domain, accept exclusively these
secure but does not scale, cumbersome to change
trust on first use (TOFU) with http public key pinning header HPKP
but if first use intersected, can disable usage & MitM
trust with TACK sent in TLS server hello, a versioned public key
defined by site administrator; client accepts after seeing it multiple times
trust over pin preinstalled in browser
DANE:
DNS based authentication of named entities (DANE)
keys tied to DNS entries, DNSSEC protected
DNSSEC hierarchical, single root of trust in USA
certificate transparency (CT):