linux_privatebin

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentes Révision précédente
Prochaine révision
Révision précédente
linux_privatebin [2022/04/28 20:17] – [Modification du pied de page] nekanlinux_privatebin [2022/05/02 07:41] (Version actuelle) – [Prérequis] nekan
Ligne 2: Ligne 2:
 <label type="info">Création</label>  --- //[[nekan@shyrkasystem.com|Nicolas THOREZ]] 2022/04/28 14:12// <label type="info">Création</label>  --- //[[nekan@shyrkasystem.com|Nicolas THOREZ]] 2022/04/28 14:12//
  
 +<callout type="info" title="Réalisation" icon="true">Cette procédure a été réalisée et testée sur un VM de 2 cœurs (CPU Atom) et 2Mo de RAM, hébergée sur un ''Proxmox'' et dont le système d'exploitation est une Debian 11.</callout>
 +
 +<callout type="danger" title="Droits" icon="true">Certaines manipulations nécessitent des droits ''root''. Attention donc.</callout>
 ===== Présentation ===== ===== Présentation =====
  
Ligne 23: Ligne 26:
 a2enmod ssl a2enmod ssl
 a2enmod rewrite a2enmod rewrite
 +a2enmod headers
 service apache2 restart</sxh> service apache2 restart</sxh>
  
Ligne 50: Ligne 54:
   * Le contenu de ce fichier de configuration :   * Le contenu de ce fichier de configuration :
 <file><VirtualHost *:80> <file><VirtualHost *:80>
-        ServerName 10.30.1.128+        ServerName mon.privatebin.com
         DocumentRoot /var/www/privatebin/         DocumentRoot /var/www/privatebin/
  
 +        # Redirection vers HTTPS
         RewriteEngine On         RewriteEngine On
-        RewriteCond %{SERVER_NAME} =www.shyrkasystem.com +        RewriteRule ^(.*)$ https://mon.privatebin.com/$1 [R=301,L]
-        RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent] +
 </VirtualHost> </VirtualHost>
  
  
 <VirtualHost *:443> <VirtualHost *:443>
-        ServerName 10.30.1.128+        ServerName mon.privatebin.com
         DocumentRoot /var/www/privatebin/         DocumentRoot /var/www/privatebin/
 +        Protocols h2 http/1.1
 +        
 +        # Log
         ErrorLog ${APACHE_LOG_DIR}/privatebin-error.log         ErrorLog ${APACHE_LOG_DIR}/privatebin-error.log
         CustomLog ${APACHE_LOG_DIR}/privatebin-access.log combined         CustomLog ${APACHE_LOG_DIR}/privatebin-access.log combined
 +        
         <Directory /var/www/privatebin>         <Directory /var/www/privatebin>
                 AllowOverride All                 AllowOverride All
         </Directory>         </Directory>
 +        
 +        # HSTS (mod_headers is required) (15768000 seconds = 6 months)
 +        Header  always set Strict-Transport-Security "max-age=15768000"
 +        Header set X-Frame-Options SAMEORIGIN
 +        Header set X-XSS-Protection "1; mode=block"
 +        Header set X-Content-Type-Options nosniff
 +        Header always set Referrer-Policy "same-origin"
 +        Header always set Feature-Policy "microphone 'none'; payment 'none'; sync-xhr 'self' https://mon.privatebin.com"
  
 +        # SSL
         SSLEngine On         SSLEngine On
         SSLCertificateFile      /etc/ssl/certs/ssl-cert-snakeoil.pem         SSLCertificateFile      /etc/ssl/certs/ssl-cert-snakeoil.pem
  • linux_privatebin.1651177022.txt.gz
  • Dernière modification : 2022/04/28 20:17
  • de nekan