[SÉCURITÉ] Ajouter l'OCSP Stapling dans Yunohost 3.3 et supérieur

:fr:
Bonjour,

Qu’est-ce que l’OCSP

Pour simplifier, à chaque fois qu’une personne va sur un site web protégé par un certificat valide, son navigateur a besoin de savoir si le certificat a été révoqué ou non. Pour cela, il a deux solutions :

  • Soit il envoie un requête à chaque fois à l’autorité de certification pour savoir la date de révocation du certificat
  • Soit il demande à un fichier qui est présent sur le serveur (c’est le même fichier que celui que l’on va chercher sur le site de l’autorité de certification).

La deuxième solution s’appelle “OCSP Stapling” (stapling = agrafage)

Comment activer l’OCSP Stapling avec Let’s Encrypt ?

C’est très simple : la fonctionnalité est déjà acquise au moment où vous ajoutez le certificat.
Et voilà… c’est fait.

Pour les autres autorités de certification

  • Vous devez posséder le certificat/clef Chaine (certificat de l’autorité de certification, aussi appelé Bundle, que vous trouverez sur le site ou dans votre tableau de bord). Téléchargez-le et mettez-le dans un dossier.

  • Ajoutez ensuite ces lignes à la configuration nginx de votre domaine /etc/nginx/conf.d/domain.tld.conf :

    # OCSP settings
    ssl_stapling on;
    ssl_stapling_verify on;
    ssl_trusted_certificate /Dossier/ou/se/trouve/votre/certificat.chaine;
    resolver 127.0.0.1 127.0.1.1 valid=300s;
    resolver_timeout 5s;

:uk:
Hello,

What is OCSP

To simplify, each time a person visits a website protected by a valid certificate, their browser needs to know if the certificate has been revoked or not. For this, it has two solutions:

  • Either it sends a request each time to the certification authority to know the “expiry” date of the certificate
  • Either it asks a file that is present on the server (it is the same file that you will find on the certification authority’s website).

The second solution is called “OCSP Stapling” (stapling)

How to activate OCSP Stapling with Let’s Encrypt?

It’s very simple:

  • Add a Let’s Encrypt SSL certificate from your administration interface.
  • Connect in SSH to your server and do: yunohost service regen-conf

There you go… it’s done.

For other certification authorities

  • You must have the certificate/Chain key (certificate of the certification authority, also called Bundle, that you will find on the site or in your dashboard). Download it and put it in a folder.

  • Then add these lines to your nginx configuration of your domain `/etc/nginx/conf.d/domain.tld.conf``:

    # OCSP settings
    ssl_stapling on;
    ssl_stapling_verify on;
    ssl_trusted_certificate /Folder/wher/there/is/your/cacertificate;
    resolver 127.0.0.0.1 127.0.1.1.1 valid=300s;
    resolver_timeout 5s;

Source :
WIKIPEDIA : https://en.wikipedia.org/wiki/OCSP_stapling
MAXCDN : https://www.maxcdn.com/one/visual-glossary/ocsp-stapling/

HELP for other CA

DIGICERT https://www.digicert.com/ssl-support/nginx-enable-ocsp-stapling-on-server.htm

Test your server header/security :

SSLLABS : https://www.ssllabs.com/ (check security)
DIGICERT : https://www.digicert.com/help/

2 Likes