Transport Layer Security: Difference between revisions
(→Obtaining a certificate: wording, link articles) |
(→Trust management: crosslink content addressing the expansion template (I think the blacklist case is good to keep in Security)) |
||
Line 27: | Line 27: | ||
== Trust management == | == Trust management == | ||
See [[Security#Managing SSL certificates]] on how to distrust/blacklist a certificate authority. | |||
=== Trust a certificate authority system-wide === | === Trust a certificate authority system-wide === |
Revision as of 21:59, 29 November 2018
According to Wikipedia:
- Transport Layer Security (TLS), and its now-deprecated[1] predecessor, Secure Sockets Layer (SSL), are cryptographic protocols designed to provide communications security over a computer network. Several versions of the protocols find widespread use in applications such as web browsing, email, instant messaging, and voice over IP (VoIP). Websites can use TLS to secure all communications between their servers and web browsers.
Implementations
There are four TLS implementations available in the official repositories. OpenSSL is the only one part of the base group (albeit indirectly).
- OpenSSL — A robust, commercial-grade, and full-featured toolkit for the TLS and SSL protocols; also a general-purpose cryptography library.
- GnuTLS — A free software implementation of the TLS, SSL and DTLS protocols. Offers APIs for X.509, PKCS #12, OpenPGP and other structures.
- Network Security Services (NSS) — Implementation of cryptographic libraries supporting TLS/SSL and S/MIME. Also supports TLS acceleration and smart cards.
- mbed TLS — Portable SSL/TLS implementation, aka PolarSSL.
Certificate authorities
With TLS you trust in a set of certificate authorities (CAs) and when you receive a public key certificate from a server, your client verifies that it is signed by a certificate authority, which you trust. On Arch Linux the certificate authorities are provided by the ca-certificates package, which is indirectly part of the base group, because of the dependency chain (pacman > curl > ca-certificates), and has the following dependency tree (excerpt):
- ca-certificates
Is just an anchor point, other packages depend on.- ca-certificates-mozilla
Contains only the/usr/share/ca-certificates/trust-source/mozilla.trust.p11-kit
file, generated from the Mozilla CA Certificate Store, which is also part of NSS (/usr/lib/libnssckbi.so
).- ca-certificates-utils
Provides the update-ca-trust(8) script and the same-named pacman hook.
- ca-certificates-utils
- ca-certificates-mozilla
Trust management
See Security#Managing SSL certificates on how to distrust/blacklist a certificate authority.
Trust a certificate authority system-wide
# trust anchor certificate.crt
This is for example required to allow a HTTPS MITM proxy to intercept traffic.
Obtaining a certificate
The first step is to generate an RSA private key. Before generating the key, set a restrictive file mode creation mask with umask (for example 077
).
/etc/ssl/private
directory like most other distributions do, see FS#43059.A certificate can be obtained either from a certificate authority with a Certificate Signing Request (CSR) or self-signed. While self-signed certificates can be generated easily, clients will reject them by default, meaning that every client needs to be configured to trust the self-signed certificate.
For the actual generation commands refer to the article of the used implementation:
Server-side recommendations
Because there are various attacks against TLS the best practices should be considered:
- Disable SSLv3 to prevent the POODLE attack.
- weakdh.org's Guide to Deploying Diffie-Hellman for TLS
- Mozilla's Server Side TLS article
- SSL Labs' SSL and TLS Deployment Best Practices
- Cipherli.st
Checking TLS
Programs to check TLS:
Websites to check TLS:
- https://dev.ssllabs.com/ssltest/ (only HTTPS)
- https://www.checktls.com/ (only email)
- https://www.htbridge.com/ssl/ (any port)
- https://tls.imirhil.fr/tls (any port)
Miscellaneous
ACME
The Automated Certificate Management Environment (ACME) protocol lets you request valid X.509 certificates from certificate authorities, like Let's Encrypt.
See also List of ACME clients.
- acme.sh — A pure Unix shell script ACME client.
- acme-client — Secure Let's Encrypt client, written in C
- acme-tiny — A 200-line Python script to issue and renew TLS certs from Let's Encrypt.
- acmetool — An easy-to-use ACME CLI.
- Certbot — ACME client recommended by Let's Encrypt.
- dehydrated — ACME client, written in Bash.
- getssl — ACME client, written in Bash.
- https://github.com/srvrco/getssl || getsslAUR, getssl-gitAUR
- lego — Lets Encrypt client and ACME library, written in Go.
- letsencrypt-cli — Yet another Letsencrypt (ACME) client using Ruby.
- manuale — A fully manual Let's Encrypt client, written in Python.
- ruby-acme-client — A Ruby client for the letsencrypt's ACME protocol.
- simp_le — Simple Let's Encrypt client, written in Python.
OCSP
The Online Certificate Status Protocol (OCSP) is supported by Firefox, Chromium has its own mechanism[2].
See also ocsptool(1) by GnuTLS and ocsp(1ssl) by OpenSSL.
HSTS
The HTTP Strict Transport Security (HSTS) mechanism is supported by Firefox, Chromium and wget (~/.wget-hsts
).