Changes

Jump to navigation Jump to search
1,077 bytes removed ,  21:31, 25 October 2023
Line 1: Line 1:  
{{Languages|PHPki}}
 
{{Languages|PHPki}}
 +
 +
{{Note box|type=Note :| pour la v10, nous avons créé une nouvelle version mise à jour de PHPKi appelée PHPKi-ng avec des correctifs et des valeurs par défaut de sécurité plus élevées. Si vous utilisiez la version précédente, vous devrez créer une nouvelle autorité de certification et des certificats. Nous avons importé la version originale dans les contributions si vous avez vraiment besoin de l'utiliser, mais ce n'est pas recommandé et ce ne sera pas généralement publié.}}
    
=== Mainteneur ===
 
=== Mainteneur ===
[mailto:daniel@firewall-services.com[[User:VIP-ire|Daniel B.]]] from [http://www.firewall-services.com Firewall Services]
+
Initialement :
 +
[mailto:daniel@firewall-services.com[[User:VIP-ire|Daniel B.]]] de [http://www.firewall-services.com Firewall Services]
    +
La contribution est maintenant maintenue par Koozali SME.
 
=== Version ===
 
=== Version ===
 +
Ancienne version avant SME10 : smeserver-phpki and phpki.
 +
Nouvelle version :
 +
{{ #smeversion: smeserver-phpki-ng }}
 +
{{ #smeversion: phpki-ng }}
   −
{{ #smeversion: smeserver-phpki }}
+
Veuillez suivre les instructions d'installation ci-dessous, elles satisferont toutes les dépendances et les dernières versions des 2 paquets qui seront installés automatiquement.
{{ #smeversion: phpki }}
  −
 
  −
Please follow the installation instructions below. The installation instructions will satisfy all dependencies and the latest versions of the above 2 RPMs will be installed automatically.
      
=== Description ===
 
=== Description ===
   −
[http://sourceforge.net/projects/phpki/ PHPki] is an Open Source Web application for managing a multi-agency PKI for HIPAA compliance. With it, you may create and centrally manage X.509 certificates for use with S/MIME enabled e-mail clients, SSL servers, and VPN applications. PHPki is now used to manage certificates with the latest release of the [[OpenVPN_Bridge|SME Server OpenVPN Bridge contrib]].
+
[http://sourceforge.net/projects/phpki/ PHPki] est une application OpenSource pour gérer une multi-agency PKI conforme HIPAA. Avec ça, vous pouvez gérer de manière centralisée les certificats X.509 utilisés avec S/MIME activé sur les clients de messagerie, serveurs SSL, et applications VPN. PHPki est maintenant utilisé pour gérer les certificats avec la dernière version de la contribution [[OpenVPN_Bridge/fr|SME Serveur OpenVPN Bridge]].
   −
You can see a demo installation [http://phpki.sourceforge.net/phpki/ here]
+
Vous pouvez voir la démo d'installation [http://phpki.sourceforge.net/phpki/ ici], en anglais.
    
=== Pré-requis ===
 
=== Pré-requis ===
*SME Server 7.X
     −
Verified on:
+
{{Warning box|type=Attention :| cette version de PHPki est une version légèrement modifiée, de sorte qu'elle puisse être utilisée avec les certificats générés avec la version précédente de [[OpenVPN_Bridge/fr|SME Server OpenVPN Bridge]], ainsi que quelques autres modifications mineures.
SME Server 7.4 - [[User:RequestedDeletion|RequestedDeletion]]
+
À partir de phpki-ng-0.84, default_md a été mis à niveau vers sha512 (l'ancien était sha1). Vous pouvez conserver votre autorité de certification existante, mais nous vous conseillons vivement de passer à une nouvelle instance, car la faiblesse du hachage sha1 est un problème de sécurité.
 +
}}
    +
=== Installation ===
 +
{{Warning box|type=Attention : | si openvpn n'est pas détecté, PHPKi ne peut pas générer de clé TA - takey - et il doit vous en informer lors de l'installation. Pour générer une clé TA une fois que vous avez installé openvpn, faites ceci (en supposant qu'il s'agit du bon répertoire) :
 +
openvpn --genkey --secret /opt/phpki/phpki-store/CA/private/takey.pem
 +
chown phpki:phpki /opt/phpki/phpki-store/CA/private/takey.pem}}
   −
{{Warning box|This version of PHPki is a slightly modified version, so it can be used with certificates generated with previous release of smeserver-openvpn-bridge, plus some others minor modifications.
+
<tabs container><tab name="SME 10">
}}
+
*Installer les paquets
 +
yum --enablerepo=smecontribs install smeserver-phpki-ng
   −
=== Installation ===
+
Aller dans le gestionnaire du serveur au paragraphe « Sécurité », dans « Gestion des certificats » et commencer la création de votre certificat racine (CA).
   −
==== SME Server 7, SME Server 8, SME Server 9 ====
+
Attention à ne cliquer qu'une seule fois et attendre le rafraichissement de la la page ; cela peut être très long de créer un certificat de 4096 bits...
   −
For sme8
+
</tab>
*install the rpms
+
<tab name="SME 9">
  yum --enablerepo=smecontribs install smeserver-phpki
+
Vous devez activer le dépôt [[epel]].
 +
*Installer les paquets
 +
  yum --enablerepo=smecontribs,epel install smeserver-phpki
   −
*and start/restart needed services:
+
*Et redémarrer les services nécessaires :
 
  expand-template /etc/httpd/conf/httpd.conf
 
  expand-template /etc/httpd/conf/httpd.conf
 
  expand-template /etc/httpd/pki-conf/httpd.conf
 
  expand-template /etc/httpd/pki-conf/httpd.conf
Line 41: Line 53:  
  sv u /service/httpd-pki
 
  sv u /service/httpd-pki
   −
* alternatively issue the following :
+
*Sinon, il est aussi possible de redémarrer le serveur :
 
  signal-event post-upgrade; signal-event reboot
 
  signal-event post-upgrade; signal-event reboot
    +
Lors de la mise à jour, vous pouvez exécuter :
 +
expand-template /etc/httpd/conf/httpd.conf
 +
expand-template /etc/httpd/pki-conf/httpd.conf
 +
sv t /service/httpd-e-smith
 +
sv t /service/httpd-pki
   −
For sme9
  −
you have to enable the [[epel]] repository
  −
*install the rpms
  −
yum --enablerepo=smecontribs,epel install smeserver-phpki
     −
*and start/restart needed services:
+
</tab>
 +
<tab name="SME 8">
 +
Pour sme8
 +
*Installer les paquets
 +
yum --enablerepo=smecontribs install smeserver-phpki
 +
 
 +
*Et démarrer/redémarrer les services nécessaires :
 
  expand-template /etc/httpd/conf/httpd.conf
 
  expand-template /etc/httpd/conf/httpd.conf
 
  expand-template /etc/httpd/pki-conf/httpd.conf
 
  expand-template /etc/httpd/pki-conf/httpd.conf
Line 56: Line 75:  
  sv u /service/httpd-pki
 
  sv u /service/httpd-pki
   −
* alternatively issue the following :
+
*Sinon, il est aussi possible de redémarrer le serveur :
 
  signal-event post-upgrade; signal-event reboot
 
  signal-event post-upgrade; signal-event reboot
 +
</tab>
 +
</tabs>
 +
 +
=== Configurer votre nouveau PKI ===
   −
=== Configurer le nouveau PKI ===
+
Dans le gestionnaire du serveur, vous trouverez un nouveau menu « Gestion des certificats » (ou vous pouvez utiliser le lien suivant : https://server.domain.tld/phpki/ca).
   −
Go in the server-manager, you'll find a new "Manage Certificates" menu (or you can use the URL https://server.domain.tld/phpki/ca)
+
Vous devez entrer les informations suivantes :
Here you have to enter the following informations:
      
**Organisation
 
**Organisation
Line 76: Line 98:  
**URL of your PKI (https://my.domain.tld/phpki)
 
**URL of your PKI (https://my.domain.tld/phpki)
   −
This screenshot illustrate the first (and the most important) part of this configuration page:
+
Ces deux images montrent la première (et la plus importante) partie de cette page de configuration :
   −
[[File:Phpki_init_config.png|768px|thumb|center|First part of the initiale configuration page]]
+
[[File:PHPki_CA_initial_setup_data_part_1.png|768px|thumb|center|Première partie de l'écran de configuration initiale (haut)]]
   −
The second part is like this:
+
[[File:PHPki_CA_initial_setup_data_part_2.png|768px|thumb|center|Première partie de l'écran de configuration initiale (bas)]]
   −
[[File:Phpki_init_config2.png|768px|thumb|center|Second part of the initiale configuration page]]
+
La seconde partie ressemble à ceci :
   −
The default settings should be OK for most installations. You may just want to change the "Help Document Contact Info" part.
+
[[File:PHPki_CA_initial_setup_options.png|768px|thumb|center|Seconde partie de l'écran de configuration initiale]]
   −
Once you have submitted this form (which can take several minutes, as generating dh parameters can take a long time), you should have something like this:
+
La configuration par défaut devrait être viable pour la plupart des installations. Vous pouvez juste changer la partie "Help Document Contact Info".
    +
Une fois ce formulaire rempli (ce qui peut prendre plusieurs minutes, '''soyez patient''', car la génération des paramètres dh peut être assez longue), vous devriez avoir quelque chose comme ceci :
    
[[File:Phpki_init_finish.png|768px|thumb|center|Second part of the initiale configuration page]]
 
[[File:Phpki_init_finish.png|768px|thumb|center|Second part of the initiale configuration page]]
   −
Now you'll be able to start using PHPki. It's quite easy to use.
+
Maintenant, PHPki est prêt. Il est très simple à utiliser.
 
  −
The administrative interface is available on the server-manager or directly https://my.domain.tld/phpki/ca
  −
 
  −
There's also a public interface, available only from the local networks, but without password at https://my.domain.tld/phpki.
  −
Here, users can download the Master CA certificate, the CRL, or search for certificates of other users (public part only of course).
     −
{{Note box|If you just installed the [[OpenVPN_Bridge]] contrib and are installing PHPki as suggested by the wiki page, or you just want to use [[PHPki]] without [[OpenVPN_Bridge]] contrib, then you are done here, and you don't have to migrate any certificates}}
+
Il est accessible dans le gestionnaire du serveur ou vous pouvez utiliser le lien suivant : https://server.domain.tld/phpki/ca
   −
=== Migration des certificats pour l'installation des versions précédentes de la contribs OpenVPN-Bridge ===
+
Il existe aussi une interface publique, disponible uniquement sur les réseaux locaux, mais sans mot de passe, sur https://my.domain.tld/phpki.
   −
If you are installing this phpki contrib because you have used [[OpenVPN_Bridge]] before and have already certificates, follow the instructions below. If you have a fresh and new install of [[OpenVPN_Bridge]], skip the below instructions for you do not have 'old' certificates!
+
Ici, les utilisateurs peuvent télécharger les Certificats Master CA, CRL, ou chercher les certificats des autres utilisateurs (uniquement pour la partie publique bien sûr).
   −
PHPki is now the certificate manager recommended to manage [[OpenVPN_Bridge]] certificates.
+
{{Note box|type=Note :| si vous installez uniquement la contribution [[OpenVPN_Bridge/fr]] et avez installé PHPki comme recommandé sur la page Wiki, ou vous voulez uniquement utiliser [[PHPki]] sans la contribution [[OpenVPN_Bridge/fr]], alors vous avez terminé, et vous n'avez donc pas besoin de migrer les certificats.}}
This part will explain how-to import your certificates created with openvpn-bridge into PHPki
     −
* First, you need to install the contribs as it's explain on this page (you can enter anything for the configuration of the CA, all your old parameters will be restored)
+
{{Note box|type=Note : |à partir de phpki-ng-0.84-14, de nouvelles URL sont disponibles pour accéder à votre CRL et demander l'état du certificat :
   −
* Second, you need to copy this script on your server (for example as /root/migrate.sh) and execute it as root.
+
    http://www.somewhere.com/phpki/ns_revoke_query.php?
   −
{{Warning box|Of course, take some time to read this script before runing it as root.}}
+
    http://www.somewhere.com/phpki/dl_crl.php}}
    +
=== Ajouter un autre admin  ===
 +
Si vous avez besoin de déléguer la génération de certificats, vous pouvez utiliser le panneau utilisateur pour ajouter l'accès au panneau, mais vous devrez également ajouter l'utilisateur manuellement à la configuration php.
   −
#!/bin/bash
+
Éditer /opt/phpki/phpki-store/config/config.php<syntaxhighlight lang="php">
+
#$PHPki_admins = Array(md5('admin'));
# Read Openvpn-Bridge DB
+
$PHPki_admins = Array(md5('admin'),md5('user2'));
ORGNAME=$(/sbin/e-smith/db openvpn-bridge getprop default_config organizationName)
  −
COUNTRY=$(/sbin/e-smith/db openvpn-bridge getprop default_config countryCode)
  −
STATE=$(/sbin/e-smith/db openvpn-bridge getprop default_config countryName)
  −
LOC=$(/sbin/e-smith/db openvpn-bridge getprop default_config localityName)
  −
DEP=$(/sbin/e-smith/db openvpn-bridge getprop default_config sectionName)
  −
KEYSIZE=$(/sbin/e-smith/db openvpn-bridge getprop default_config keySize)
  −
EMAIL=$(/sbin/e-smith/db openvpn-bridge getprop default_config mailAddress)
  −
  −
  −
OPENSSL=/usr/bin/openssl
  −
OLDDIR=/etc/openvpn/easy-rsa/keys/bridge/
  −
NEWDIR=/opt/phpki/phpki-store/CA/
  −
  −
  −
# Store the actual time in $TIME
  −
TIME=$(date +%d%m%Y%H%M%S)
  −
  −
  −
# Create needed directories
  −
prepare_dir(){
  −
        mkdir -p $NEWDIR/{certs,newcerts,requests,pfx,private}
  −
}
  −
  −
  −
# Migrate the certificates to phpki store
  −
migrate_certs(){
  −
        cd $OLDDIR
  −
  −
        # Copy the old index.txt and serial
  −
        cat $OLDDIR/index.txt > $NEWDIR/index.txt
  −
        cat serial > $NEWDIR/serial
  −
  −
        # Copy the cacert related files
  −
        cat ca.crt > $NEWDIR/certs/cacert.pem
  −
        cat ca.key > $NEWDIR/private/cakey.pem
  −
  −
        # Now, for each file ending with .crt
  −
        for CERT in $(ls ./*.crt); do
  −
                CERT=$(basename $CERT .crt)
  −
  −
                ISININDEX=$(grep -c "/CN=$CERT/" $NEWDIR/index.txt)
  −
  −
                # If the current cert isn't referenced in the index,
  −
                # or the corresponding key or csr file dosn't exists, then skip it
  −
                # This can happen in some situation where the serial has been corrupted
  −
  −
                if [ $ISININDEX -gt 0 ]&&[ -s $CERT.key ]&&[ -s $CERT.csr ]; then
  −
                        # Retrieve the serial number as reported by  openssl
  −
                        SERIAL=$(openssl x509 -noout -serial -in $CERT.crt | cut -d"=" -f 2)
  −
  −
                        # Create the pem only cert in the new dir
  −
                        $OPENSSL x509 -in $CERT.crt -inform PEM -outform PEM -out $NEWDIR/newcerts/$SERIAL.pem
  −
  −
                        # Create the der formated cert
  −
                        $OPENSSL x509 -in $CERT.crt -inform PEM -outform DER -out $NEWDIR/certs/$SERIAL.der
  −
  −
                        # And the pkcs12 bundle (cert+key+ca)
  −
                        $OPENSSL pkcs12 -export -in $CERT.crt -inkey $CERT.key -certfile ca.crt -caname $ORGNAME -passout pass: -out $NEWDIR/pfx/$SERIAL.pfx
  −
  −
                        # Copy the private key
  −
                        cat $CERT.key > $NEWDIR/private/$SERIAL-key.pem
  −
  −
                        # And the cert request
  −
                        cat $CERT.csr > $NEWDIR/requests/$SERIAL-req.pem
  −
                fi
  −
        done
  −
}
  −
  −
perms(){
  −
        # Restrict access
  −
        chown -R phpki:phpki $NEWDIR
  −
        chmod -R o-rwx $NEWDIR
  −
}
  −
  −
phpki_conf(){
  −
        # Retrieve the common name of our CA with openssl command
  −
        CACN=$($OPENSSL x509 -subject -noout -in $OLDDIR/ca.crt | cut -d'=' -f 8 | cut -d'/' -f 1)
  −
  −
  −
        if [ -e /opt/phpki/phpki-store/config/config.php ]; then
  −
                # Move the actual phpki configuration file             
  −
                mv /opt/phpki/phpki-store/config/config.php /opt/phpki/phpki-store/config/config.php.$TIME
  −
  −
                # And use sed to configure it properly
  −
                sed -e "s/config\['organization'\].*/config\['organization'\] = '$ORGNAME';/" \
  −
                        -e "s/config\['unit'\].*/config\['unit'\] = '$DEP';/" \
  −
                        -e "s/config\['contact'\].*/config\['contact'\] = '$EMAIL';/" \
  −
                        -e "s/config\['locality'\].*/config\['locality'\] = '$LOC';/" \
  −
                        -e "s/config\['province'\].*/config\['province'\] = '$STATE';/" \
  −
                        -e "s/config\['country'\].*/config\['country'\] = '$COUNTRY';/" \
  −
                        -e "s/config\['common_name'\].*/config\['common_name'\] = '$CACN';/" \
  −
                        -e "s/config\['ca_pwd'\].*/config\['ca_pwd'\] = <nowiki>''</nowiki>;/" \
  −
                        -e "s/config\['keysize'\].*/config\['keysize'\] = '$KEYSIZE';/" \
  −
                        /opt/phpki/phpki-store/config/config.php.$TIME \
  −
                        > /opt/phpki/phpki-store/config/config.php
  −
        fi
  −
}
  −
  −
migrate_var(){
  −
        # Here, we just migrate dhparam and ta to phpki store
  −
        if [ -e $OLDDIR/dh.pem ]; then
  −
                cat $OLDDIR/dh.pem > $NEWDIR/private/dhparam1024.pem
  −
        fi
  −
        if [ -e $OLDDIR/ta.key ]; then
  −
                cat $OLDDIR/ta.key > $NEWDIR/private/takey.pem
  −
        fi
  −
}
  −
  −
  −
  −
prepare_dir
  −
migrate_certs
  −
phpki_conf
  −
migrate_var
  −
perms
     −
 
+
</syntaxhighlight>
Now, go in the server-manager, in "Manage Certificates" and check your old certificates are here.
      
=== Désintallation ===
 
=== Désintallation ===
To uninstall the contrib from your server, just run the following commands:
+
Pour procéder à la désinstallation, exécutez les commandes suivantes :
  yum remove smeserver-phpki phpki
+
  yum remove smeserver-phpki-ng phpki-ng
 
  expand-template /etc/httpd/conf/httpd.conf
 
  expand-template /etc/httpd/conf/httpd.conf
 
  sv t /service/httpd-e-smith
 
  sv t /service/httpd-e-smith
   −
{{Note box|As many other rpms, removing phpki won't remove everything from your server. Especially certificates will be kept, and some php file.
+
{{Note box|type=Note :|comme pour beaucoup d'autres paquets, supprimer PHPki ne va pas le faire disparaître totalement de votre serveur. Surtout les certificats seront conservés ainsi que certains fichiers PHP. PHPKi-ng tentera de sauvegarder tous les anciens certificats.}}
}}
+
 
 +
Les certificats et fichiers de configuration PKI sont stockés ici : /opt/phpki/phpki-store, Les fichiers PHP sont ici : /opt/phpki/html.
   −
Certificates and PKI configuration are stored in /opt/phpki/phpki-store, php files are in /opt/phpki/html
+
{{Warning box|type=Attention !|Pour recommencer à zéro après la désinstallation, vous devez supprimer les répertoires html et pkpki-store avant de réinstaller.
{{Warning box|These files can be very important, so my recommendation is to let them remain here. If you really want to remove them, just backup them before:
+
Ces fichiers peuvent être très importants, je vous recommande de les laisser ici. Si vous souhaitez réellement tout supprimer, faites donc une sauvegarde avant :
 
  cd /opt/phpki
 
  cd /opt/phpki
 
  tar cvzf ~/phpki-backup.tar.gz ./
 
  tar cvzf ~/phpki-backup.tar.gz ./
Now you can remove the entire /opt/phpki directory
  −
}}
     −
=== -installation ===
+
A présent, vous pouvez vider complètement le répertoire /opt/phpki :
If you have removed the contrib, and want to re-install it, you'll need to follow these steps after you have installed the rpms:
+
rm /opt/phpki/{html,phpki-store} -rf
 +
}}
 +
 
 +
=== Réinstallation ===
 +
 
 +
==== Avant phpki-ng 0.84-14 ====
 +
Si vous avez supprimé la contribution et que vous souhaitez la réinstaller en ayant conservé vos certificats CA précédents (en supposant que vous avez restauré /opt/phpki), vous avez besoin de suivre ces étapes après avoir réinstallé les paquets :
    
  cd /opt/phpki/html/
 
  cd /opt/phpki/html/
Line 263: Line 171:  
  rm -f index.php
 
  rm -f index.php
 
  ln -s main.php index.php
 
  ln -s main.php index.php
 +
cd /opt/phpki/
 +
chown phpki:phpki -R phpki-store
 +
chown root:phpki -R html/config.php
 +
 +
=== Bogues ===
 +
Merci de signaler tout bogue dans la section dédiée sur [http://bugs.contribs.org/enter_bug.cgi bugzilla].
 +
 +
====smeserver-phpki-ng====
 +
 +
Pour la nouvelle contribution, sélectionner le composant smeserver-phpki-ng ou utilisez {{BugzillaFileBug|product=SME%20Contribs|component=smeserver-phpki-ng|title=ce lien.}}
 +
{{#bugzilla:columns=id,product,version,status,summary |sort=id |order=desc |component=smeserver-phpki-ng|noresultsmessage="Pas de bogues ouverts actuellement."}}
 +
 +
====phpki-ng====
 +
Uniquement pour le nouveau phpki-ng, sélectionner le composant phpki-ng ou utilisez {{BugzillaFileBug|product=SME%20Contribs|component=phpki-ng|title=ce lien.}}
 +
 +
{{#bugzilla:columns=id,product,version,status,summary |sort=id |order=desc |component=phpki-ng|noresultsmessage="Pas de bogues ouverts actuellement."}}
   −
=== Bugs ===
+
=== Journal des modifications ===
Please raise bugs under the SME-Contribs section in [http://bugs.contribs.org/enter_bug.cgi bugzilla]
+
Seules les versions publiées dans smecontrib sont listées ici.
and select the smeserver-phpki component or use {{BugzillaFileBug|product=SME%20Contribs|component=smeserver-phpki|title=this link}}
      +
{{#smechangelog:smeserver-phpki-ng}}
 +
{{#smechangelog:phpki-ng}}
 
----
 
----
[[Category:Contrib]]
+
[[Category:Contrib/fr]]
[[Category:Administration:Certificates]]
+
[[Category:Administration:Certificates/fr]]
3,054

edits

Navigation menu