Security of network applications Flashcards
Approaches to security of network applications
We have a very poor standard, very weak authn (interceptable pwd) or ip-address based authentication (can be spoofed). And even if stronger systems are used (OTP, challenge response), that prevent problems with authn, there are issues related to data snooping/forging, shadow servers/MITM, replay and filtering.
Approaches to avoid problems:
- Channel security: nodes negotiate encryption algo/keys before communication starts
- Message/data security: each data item is protected (individually) by being wrapped inside a secure container (e.g. PK-SSL).
- Mixed approeach is also possible: secure data inside a secure channel, the secure channel, however, is the preferred choice for applications such as the web.
Apprach to security of net. applications: message/data security
- Message/data security: each data item is protected (individually) by being wrapped inside a secure container (e.g. PK-SSL).
- sender is creating the protection
- data that doesn’t need security is not protected
- only single authn is achieved
- integrity and privacy are self-contained in the message.
- protection remains even if data exits network (and is stored at dest): allows non-repudiation, but requires some modifications to the application.
Approach to security of net. applications: Channel security
- Channel security: nodes negotiate encryption algo/keys before communication starts
- all traffic will be protected by secure channel after set-up.
- can get single or mutual authn, integrity and privacy (since features are negotiated at the start)
- no possibility of non-repudiation when data exits the secure channel
- widely adopted because easy to implement (can be done at OS level), doesn’t require modifications of applications
Internal and External Secuirty to Applications
- Internal:
- each app. implements security internally
- possible implementation errors (inventing sec. protocols is hard)
- doesn’t guarantee interoperability between app.s
- communication channel is the part in common.
- External:
- session would be ideal to implement sec. but TCP/IP doesn’t have one.
- secure session level was proposed: “secure logical channel”
- defacto standard
- uses socket to send data enriched with protection
- simplifies application dev. work
- avoids implementation errors
- app. is free to use it or implement its own sec.
Secure channel products
- SSL/TLS: most widely used, intially SSL -> TLS
- SSH: was successful (when export of crypto products from USA was limited), nowdays is niche.
- PCT: MSFT alternative to SSL. Fiasco.
SSL
Initially SSL (Secure Socket Layer) was proposed by Netspace Communications, that needed a secure protocol to implement e-commerce on the web. SSL is a secure transport channel (session level) with some properties:
-
Peer authn and optionally mutual authn
- compulsory to have server authentication when SSL channel is opened (since it was made for e-commerce).
- possible to do also client authn.
- session level protocol means that username/pwd aren’t required.
- message confidentiality: optional because maybe authn is enough
- message authn and integrity: compulsory, are used to prove who created the message and that the message has not been modified during transmission.
-
replay attack and filtering attack protection
- replay attacks will be detected as weel as filtering attacks (part of the data being deleted)
Success of SSL is based on the fact that is built on top of TCP, making it available to all protocols that use it: HTTP, SMTP, NNTP, FTP, TELNET.
SSL: Authn and integrity
- peer authentication at channel setup:
- server authenticates itself by sending its public key cert. (x.509) and by responding to an implicit asymmetric challenge
- client authn is optional, is done with public key certificate and explicit challenge to prove the possesion of the private key by the client)
- if authn fails the channel is not opened.
- authentication and integrity of data achieved using:
- a keyed-digest (SHA-1 or better) to demonstrate authentication and integrity.
- A message IDentifier (number to avoid reply and cancellations)
- TCP doesn’t deliver to upper levels out-of-order or duplicate packets. So if a packet has a duplicate ID or skipped a number we are under attack.
SSL: confidentiality
- Optional.
- Client generates a session key, that later is used for symmetric encryption of data (RC4, 3DES, IDEA, AES)
- Key exchange with the server occurs via public key cryptography (RSA, Diffie-Hellman or Fortezza-KEA)
TLS connection opening
TLS is a negotiation protocols.
In the security config. parties agree on algorithms/keys.
Next, if they have agreed about a set of algorithms, the server would give back its certificate which must contain the name corresponding to the connected URL. Then, the server must use its private key to implicitly respond a challenge (on the picture there is a simplification, the browser is not sending a challenge).
SSL3 architecture
Base: network protocol (IP), reliable transport protocol (TCP), on top of the latter there’s a record protocol to transmit SSL records (i.e. protected data).
Inside the record protocol there’s application data, altough it it initially used for the handshake protocol.
The change cipher spec protocol is used at the end of the handshake to tell systems that the agreement ended.
Alarm protocol is to signal missing or duplicated packets, or the end of the communication.
SSL session-id
- The identifier is sent by the server, it is used to avoid re-negotiation of crypto parameters of each SSL connection => more connections can be part of the same logical session.
- If the client sends a valid session-id when opening a SSL connection, negotiation is skipped, and data is exchanged securely from then on.
- the server can reject use of session-id (always or according the the validity set by its policy)
Since a typical use of SSL is to request a lot of items from the same server, it becomes computationally expensive to negotiate parameters with the same server at each request.
SSL-3 / TLS record protocol
If large files need to be sent using SSL, packets are fragmented and compressed (only in old versions, it was vulnerable to attacks).
SSL has a maximum packet length of 32KB.
Then a MAC is computed to protected authentication and integrity.
If confidentiality is wanted too, padding is added (to match multiple of block-size).
The packet is then encrypted and the header prepended to make it recognizable as an SSL segment inside TCP.
TLS-1.0 record format
- uint8 type = change_cipher_spec (20), alert (21), handshake (22), application_data (23)
- uint16 version = major (uint8) + minor (uint8)
- uint16 length:
- ≤ 214 (record not compressed) for compatibility with SSL-2
- ≤ 214 + 1024 (compressed records)
- This means that it is a 5-byte header
- Plus a payload of max 16kB
SSL computation of MAC
- MAC = digest_fun(key, seq_number || type || version || length || fragment)
- In order to protect authentication and integrity a MAC is computed with a specific hash function, using the key used during handshake.
- everything is protected.
- Notes:
- changes based on the direction of the message (otherwise we could replay packets sent from client to server as part of server to client.
- seq-number is a 64bits integer that is never transmitted, it’s implcitly calculated. The seq-number allows for a lot of segments, the channel must be closed after exhausted.
SSL/TLS handshake protocol
- Needed to:
- agree on set of algos: integrity and confidentiality
- exchange random numbers between client and server (used for subsequent generation of keys)
- establish a symmetric key by means of public key operations ( RSA, DH, Fortezza)
- Negotiate the session-id: when contacting server multiple times
- exchange necessary certificates