Advanced Distributed Software Architectures and Technology group

Download Report

Transcript Advanced Distributed Software Architectures and Technology group

ADSaT
Security
Paul Greenfield
CSIRO
Advanced Distributed Software Architectures and Technology group
1
ADSaT
Optimistic Concurrency
• Just before Security…
• Optimistic Concurrency Control
– No locks
– But check at commit or update if locks
were really needed after all
– Check by …
• Seeing if data has changed between read
and commit
• Looking at update sequence stamps
Advanced Distributed Software Architectures and Technology group
2
ADSaT
Optimistic Concurrency
• Return an exception if trying to
change data that was changed after
we read it
Select next from keytable where type=1
(remember value returned)
….
Update keytable set next=next+1 where type=1
(re-read old value of next and check that it has
not changed between Select and Update.
Return exception from Update if changed)
Advanced Distributed Software Architectures and Technology group
3
ADSaT
Snapshot Concurrency
•
•
•
•
A form of optimistic concurrency
Used by Oracle
No read locks
Still have write locks
– No waiting on read locks
• Some update history kept inside
data pages
Advanced Distributed Software Architectures and Technology group
4
ADSaT
Snapshot Concurrency
• Readers see the database as it was
when they started their transaction
– If record changed after reader
started then older value retrieved
from history
• Return exception when getting
update lock if record has changed
since start of transaction
Advanced Distributed Software Architectures and Technology group
5
ADSaT
Snapshot Concurrency
• Uses transaction stamps on records
– Has this record been changed by a
later transaction?
• Find older version if reading
• Return exception if updating
Tx_start (assign transaction stamp)
Select next from keytable where type=1
(if current t_stamp newer than start t_stamp
then find suitable older record if possible)
Update keytable set next=next+1 where type=1
(try to get update lock. If current t_stamp > start t_stamp
then return ‘cannot serialize’ exception)
Advanced Distributed Software Architectures and Technology group
6
ADSaT
Snapshot Concurrency
• Worth doing?
–
–
–
–
Better than doing page level locks
No conversion deadlocks
New ‘cannot serialize’ exception
May be no better or even worse than
doing record level read locks
• Return exception rather than waiting
where lock conversion would be done
Advanced Distributed Software Architectures and Technology group
7
ADSaT
Security
• All about building and keeping trust…
–
–
–
–
–
–
Who is accessing my system?
What are they trying to do?
Is anyone eavesdropping?
Did you really send this message?
Can you deny that you sent it?
Has my system been compromised?
Advanced Distributed Software Architectures and Technology group
8
ADSaT
Cryptography
• Underlies most security techniques
• One-way hashes
• Encryption
– Symmetric
– Asymmetric
• Algorithms are computationally
difficult to break
– Difficult but not impossible…
Advanced Distributed Software Architectures and Technology group
9
ADSaT
One-way Hashes
• Take data, such as file or message
• Produce a small ‘hashed’ digest
• Different digest for different data
– Any change to data changes the hash
• Cannot derive original data from hash
• Examples: MD5, SHA-1
• Basis for digital signatures
Advanced Distributed Software Architectures and Technology group
10
ADSaT
Encryption/Decryption
• Encryption
– turns ‘plain text’ to ‘cipher text’
• Decryption
– turns ‘cipher text’ back into ‘plain text’
• A long history…
– Substitution ciphers
• A -> Z, B -> Y, …
– Transposition ciphers
• Swap 1st letter with 2nd, ….
Advanced Distributed Software Architectures and Technology group
11
ADSaT
Encryption/Decryption
• Modern algorithms use ‘keys’
– Algorithm often well-known
– Need to know key to decrypt cipher text
– Keys come from a very large space
• 56 bits -> 72,057,594,037,927,936 keys
checking 1,000,000/sec -> 2,284 years
• Symmetric and asymmetric
– Is the same key used for encrypting and
decrypting?
Advanced Distributed Software Architectures and Technology group
12
ADSaT
Symmetric Algorithms
• Same key encrypts and decrypts
– Key is a shared secret between sender
and receiver
– How are keys distributed?
plaintext
secret key
secret key
encryption
algorithm
decryption
algorithm
ciphertext
Advanced Distributed Software Architectures and Technology group
plaintext
13
ADSaT
Asymmetric Algorithms
• A pair of related keys
– Encrypt with one, decrypt with other
– Cannot encrypt and decrypt with the
same key
– Normally one key is public and one is
kept private
• Encrypt with public, only owner of private
key can decrypt
• Encrypt with private, anyone with public
key can decrypt
Advanced Distributed Software Architectures and Technology group
14
ADSaT
Asymmetric Algorithms
A's public key
A's private key
encryption
algorithm
plaintext
decryption
algorithm
ciphertext
plaintext
• Both directions?
– A -> B encrypted with B’s public key
– B -> A encrypted with A’s public key
• Often called ‘public key’ encryption
Advanced Distributed Software Architectures and Technology group
15
ADSaT
Asymmetric Algorithms
• No shared secrets
– No key distribution problem
– Public key can be widely distributed
• Computationally difficult to derive
private key from public key
• Slower (10 – 1000) times than
symmetric algorithms
– Too slow for general use
Advanced Distributed Software Architectures and Technology group
16
ADSaT
Hybrid Algorithms
• Combine symmetric and asymmetric
– Avoid secure key exchange problem
– Good performance
• Create new, random session keys
• Exchange session keys using
asymmetric algorithms
• Exchange messages using symmetric
algorithms and session keys
Advanced Distributed Software Architectures and Technology group
17
ADSaT
Hybrid Algorithms
public key
Encryption
random number
generator
public key encryption
algorithm
session key
encrypted
session key
symmetric encryption
algorithm
plaintext
ciphertext
private key
Decryption
encrypted
session key
session key
public key decryption
algorithm
symmetric decryption
algorithm
ciphertext
Advanced Distributed Software Architectures and Technology group
plaintext
18
ADSaT
Digital Signatures
• Undeniably associate the signer of
a document with its content
– Identifies who signed it
– Signature applies to only one document
– Document has not been altered since
it was signed
• Like a real signature only stronger
– Being legally accepted
– No technologies specified in law
Advanced Distributed Software Architectures and Technology group
19
ADSaT
Digital Signatures
• Normally combine one-way hash
with public key encryption
– Hash document
– Encode hash with private key
A's private key
message
digest
message
one way hash function
signature
digital signature
algorithm
signed message
Advanced Distributed Software Architectures and Technology group
20
ADSaT
Digital Signatures
• Verifying signature
– Decode hash using known public key
– Re-hash document & check hashes match
A's public key
message
digest
signature
digital signature
algorithm
compare
signed message
one way hash function
message
message
digest
Advanced Distributed Software Architectures and Technology group
21
ADSaT
Fundamental Services
• Privacy
– Data is protected against eavesdroppers
– Provided by encryption
• Integrity
– Data has not been altered
– Provided by digital signatures
• Non-repudiation
– Signer cannot deny signing
– Provided by digital signatures
Advanced Distributed Software Architectures and Technology group
22
ADSaT
Fundamental Services
• Authentication
– Who sent a message
– Who received it
– Who is trying to gain access
• All concerned with identifying
people and organisations
– Is this really someone I trust?
Advanced Distributed Software Architectures and Technology group
23
ADSaT
Authentication
• Who sent or wrote this?
– Provided by digital signatures
– Not provided by Internet mail headers!
• Who received it?
– Encrypt with public key of intended
recipient
– No-one else can decrypt and read it
Advanced Distributed Software Architectures and Technology group
24
ADSaT
Authentication
• Who is trying to gain access?
–
–
–
–
Is this user who they really claim to be?
Many techniques of varying effectiveness
Passwords, biometrics, smart cards, …
Need to be proof against:
•
•
•
•
Eavesdropping
Replay attacks
Stolen passwords and tokens/cards
Guessed/cracked passwords
Advanced Distributed Software Architectures and Technology group
25
ADSaT
Authentication
• Techniques all based on some thing
that is unique to a user
– A secret like a password or PIN
– A possession, such as smart card
– Some physical characteristic
• Combine techniques to overcome
weaknesses
– Protect smart card with a PIN
Advanced Distributed Software Architectures and Technology group
26
ADSaT
Authentication Attacks
• Eavesdropping
– Just listen in to the logon sequence
– Works for any identifying string
• Password, fingerprint, …
– Identifying data always has to be sent
encrypted
– Identifying data must always be kept
encrypted everywhere
• Clients, servers, …
Advanced Distributed Software Architectures and Technology group
27
ADSaT
Authentication Attacks
• Replay attacks
– Just record and replay a logon
– Works with encrypted identifying data
• Password guessing
– Guess passwords
– Automated attacks using password
generators and dictionaries
– Defence is using non-trivial passwords
• With OS mandating policy
Advanced Distributed Software Architectures and Technology group
28
ADSaT
Authentication Attacks
• Stolen passwords
– Look at the bits of yellow paper…
– Protect using physical tokens or
biometrics
• Stolen smart cards & tokens
– Protected with another secret
• PINs and passwords
Advanced Distributed Software Architectures and Technology group
29
ADSaT
Secure Authentication
• Challenge-response (CHAP)
–
–
–
–
Internet and Windows algorithm
Client knows the password
Server knows only a hashed password
Random challenge to defeat replay
attacks
Advanced Distributed Software Architectures and Technology group
30
ADSaT
CHAP
Client
Server
Send logon request
Send back random challenge
Hash password
Hash hashed password and
challenge to get response
Send response
Retrieved hashed password
Hash hashed password and
challenge to get response
Check against client response
Advanced Distributed Software Architectures and Technology group
31
ADSaT
Secure Authentication
• Kerberos
– Provides secure access to a network
of computers from a single log-on
– A shared secret (password) system
• Internet RFC 1510
– Originally from MIT
– Supported on UNIX, MVS, Win2000
Advanced Distributed Software Architectures and Technology group
32
ADSaT
Kerberos
• Four different players…
– Clients
– Authentication servers
• Verify users during login
• Secure session from client to TG server
– Ticket-granting servers
• Issue ‘proof of identity’ tickets
• Identify clients to applications
– Applications
Advanced Distributed Software Architectures and Technology group
33
ADSaT
Kerberos
• Eavesdropping?
– Uses encryption on critical parts of
messages
– Only intended recipients can decode
• Replay attacks?
– Time stamps on critical messages
– Tickets have limited lifetimes
Advanced Distributed Software Architectures and Technology group
34
ADSaT
Secure Authentication
• One-time passwords
– Passwords generated as needed and
only ever used once
– Used for some highly secure systems
– Lists of passwords
•
•
•
•
•
Generated by server
Cannot derive one password from another
Transferred to user via secure channel
Use next password every log-on
Paper list? Smart card?
Advanced Distributed Software Architectures and Technology group
35
ADSaT
One-time Passwords
• S/Key
–
–
–
–
Generate password only when needed
On client when logging in
On server when checking
Client side needs program/calculator
to generate next password from user’s
own secret key
Advanced Distributed Software Architectures and Technology group
36
ADSaT
Biometrics
• Identifying a person through some
physical characteristic
– Varying reliability, cost and acceptability
• Fingerprints work well but poor public image
– All measurements are approximate
• ‘near enough’ matching allows for errors
– Still subject to attacks
• Need to combine with other techniques or
physical security
Advanced Distributed Software Architectures and Technology group
37
ADSaT
Biometrics
Possessions
Characteristics
Knowledge
Smart cards
Biometrics
Passwords
Physiological
Behavioural
Face
Signature
Fingerprint
Voice
Hand
Typing
Eye
Advanced Distributed Software Architectures and Technology group
38
ADSaT
Certificates
• A digital document identifying a
user or organisation
–
–
–
–
–
Issuing authority
Dates when certificate is valid
Details of subject
Subject’s public key
Signature of issuing authority
• Often use X.509 standard
Advanced Distributed Software Architectures and Technology group
39
ADSaT
Certificates
• Trusted way to distribute public keys
– Validate contents by checking signature
– Need to know issuer’s public key
– How do we know this?
• Ask or just know it
• Windows 2000 comes with 120+ certificates
pre-loaded
– Can the issuer be trusted?
• Who issued their certificate?
• What checking did they do?
Advanced Distributed Software Architectures and Technology group
40
ADSaT
Certificates
• Use?
– Known, trusted way of distributing
public key and other details of the
intended recipient
• Trust hierarchies
– Chain of signing authorities
– Leading up to a ‘root’ Certificate
Authority (CA)
Advanced Distributed Software Architectures and Technology group
41
ADSaT
CA Hierarchy
Root CA
CA
End user
CA
End user
End user
CA
End user
CA
End user
End user
Advanced Distributed Software Architectures and Technology group
End user
42
ADSaT
Certificate Revocation
• What happens when a certificate
needs to be withdrawn?
– Employee leaves a company
– Credit card withdrawn
• Certificate revocation lists
–
–
–
–
Signed by issuing CA
Pushed out via file transfer or mail…
Checked on-line
Compare with credit card lists
Advanced Distributed Software Architectures and Technology group
43
ADSaT
Public Key Infrastructure
• The infrastructure needed to use
public key technology on a national
scale. Normally based on X.509.
–
–
–
–
Root CA’s
Issuing CA’s
Policies and standards
Interoperable technologies
Advanced Distributed Software Architectures and Technology group
44
ADSaT
PKI in Australia
• Gatekeeper
– Federal government body setting
standards for CA’s
– Accredited CA’s
• Usage
– Tax Office issuing ABN-DSC for
signing electronic GST returns
– Health issuing certificates to doctors
for bulk-billing
Advanced Distributed Software Architectures and Technology group
45
ADSaT
Network Security
Application layer
Data representation to
applications
Messaging
security
e-commerce
specific protocols
S/MIME,
PGP/MIME
Application layer
Messaging
security
Data delivery
Transport layer
SSL/TLS, SSH
Transport layer
Data addressing, transmission
Network layer
IPSec
Network layer
Link layer
Hardware link
encryption
Network access protocols
Link layer
Internet
Advanced Distributed Software Architectures and Technology group
46
ADSaT
IPSec
• Standard for secure IP networking
– Packet authentication only
– Packet authentication and encryption
– Part of IPv6 but can be used with IPv4
• Basis for a more secure Internet
– Access control, encryption, integrity,
tunnelling, origin authentication,
defence against replay attacks
Advanced Distributed Software Architectures and Technology group
47
ADSaT
Virtual Private Networks
• A secure private network running
over the public Internet
• Uses ‘tunnelling’
– Wrap IP packets inside another
packet so that it can travel the ‘net
– Packets are normally encrypted
• Standards
– PPTP, L2TP, IPSec
Advanced Distributed Software Architectures and Technology group
48
ADSaT
VPNs
Ethernet
Ethernet
10.2.0.2
10.2.0.1
10.3.0.2
Firewall
Router
Lan
A
192.1.1.1
Internet
193.3.3.3
(doesn’t know network 10)
10.1.0.2
Firewall 10.3.0.1
Router
10.1.0.1
Lan
B
Virtual Link
(packets actually sent encapsulated over Internet)
Advanced Distributed Software Architectures and Technology group
49
ADSaT
Transport-level Security
• Secure TCP connections
– SSL and TLS (derived from SSL3)
– Secure channel between two programs
• Privacy, data integrity
• Identity of end-users can be assured
– Uses almost everything
• Public keys, symmetric keys, hashing
– Very widely used especially on Web
Advanced Distributed Software Architectures and Technology group
50
ADSaT
SSL
• Normally client to secure server
– Client establishes connection
– Server sends back X.509 certificate
– Client sends session key encrypted
with server’s public key
– Client and server communicate,
encrypting all data with the session
key using a symmetric algorithm
Advanced Distributed Software Architectures and Technology group
51
ADSaT
Access Control
• Protecting objects within a system
– Files, services, components, …
• Who?
– Users, groups of users
• What can someone do?
– Read, write, call, delete, …
• Access Control Lists
– Who can do what to an object
Advanced Distributed Software Architectures and Technology group
52
ADSaT
Access Control
• Banking service…
– Who is allowed to call Deposit, Transfer
& Withdraw?
– Operations over $5,000 need to be done
by a manager
• Declarative security
– Who has access
• Programmatic security
– Finer control over what can be done
Advanced Distributed Software Architectures and Technology group
53
ADSaT
Access Control
• Set up Teller and Manager groups
• Grant access to Banking interface
to these two groups only
• Add code to check if user is in
Manager group if amount > $5000
• Need to protect database as well
• More later in course…
Advanced Distributed Software Architectures and Technology group
54
ADSaT
Security Today
• Access control via passwords and
some use of tokens
– Security depends on OS and client
software e.g. telnet!!!
• SSL widely used for passing
sensitive information over the
Internet
– Especially Web
Advanced Distributed Software Architectures and Technology group
55
ADSaT
Security Today
• VPN’s and tunnelling used
– PPTP in MS world
• PKI and public keys still struggling
– No critical mass yet
– Federal govt trying through NEAC and
use of certificates by ATO and HIC
– Will take off when everyone has
certificates and keys….
Advanced Distributed Software Architectures and Technology group
56
ADSaT
Security Today
• Worrying about the wrong thing
– Using SSL to prevent eavesdropping
• Most likely tap point is your phone line
• ISP & backbone routers too secure and
too much traffic. Who can tap into a
1Gbps fibre optic cable?
– Real problem is poor system security
practices
• Passwords, open access, unpatched flaws
Advanced Distributed Software Architectures and Technology group
57
ADSaT
Attacks
• The Internet is a dangerous place
– Firewalls and proxies isolate internal
networks from the Internet
– Internet-connected computers offer
few services and run trusted
applications
• Web servers, file servers
– Flaws found and fixes produced daily
Advanced Distributed Software Architectures and Technology group
58
ADSaT
Firewalls
Web
server
Internet
Mail
server
User
workstation
Firewall
Private
LAN
Advanced Distributed Software Architectures and Technology group
59
ADSaT
Firewalls & Proxies
Private
network
Perimeter
network
DMZ
Interior
firewall
Internet
Exterior
firewall
Bastion
host
Advanced Distributed Software Architectures and Technology group
60
ADSaT
Attacks
• Denial of Service attacks
– Aim is to crash or overload the target
– Target may be working properly
• SYN flood attacks, PING floods, mail bombs
• Coding flaws
– such as not checking for buffer
overflow
• Thanks to DEC/Intel and C
– Can result in crashes or (worse) a total
security breach
Advanced Distributed Software Architectures and Technology group
61
ADSaT
Next Week
• Back to Ian Gorton
Advanced Distributed Software Architectures and Technology group
62