Table des matières
- 2026:
- 2025:
4 billet(s) pour septembre 2026
| Notes HTTP Strict Transport Security - HSTS | 2026/09/18 11:04 | Jean-Baptiste |
| Notes GNU Linux GPU carte graphiques | 2026/09/08 15:49 | Jean-Baptiste |
| Notes GNU Linux graphique | 2026/09/08 15:42 | Jean-Baptiste |
| Notes urlencoding - passer des mots de passe en HTTPS | 2026/09/03 17:58 | Jean-Baptiste |
Notes PKI EasyRSA OpenVPN
Voir :
sudo apt-get install easy-rsa make-cadir vpnpki cd vpnpki
vars
export KEY_COUNTRY="FR" export KEY_PROVINCE="FR" export KEY_CITY="Paris" export KEY_ORG="Acme" export KEY_EMAIL="nospam@me.fr" export KEY_OU="Acme"
(sur les versions plus récentes ?) vars
set_var EASYRSA_ALGO "ec" set_var EASYRSA_DIGEST "sha512"
source ./vars ./clean-all unlink clean-all ln -s openssl-1.0.0.cnf openssl.cnf
./build-dh
./build-ca
Les “Common Name” doivent être unique
“A challenge password” doit être laissé vide (pas de mdp nécessaire pour revoquer le cerificat)
./build-key-server nom_serveur_fqdn
Pour Nginx notamment
cat keys/nom_serveur_fqdn.crt keys/ca.crt > /etc/nginx/ssl/nom_serveur_fqdn.crt+chain
./build-key --batch nom_client
Création du fichier crl.pem (Crash si crl.pem a une taille zero)
export KEY_CN=` export KEY_ALTNAMES=` openssl ca -gencrl -out keys/crl.pem -config openssl-1.0.0.cnf unset KEY_CN KEY_ALTNAMES
#export KEY_CONFIG=`$EASY_RSA/whichopensslcnf $EASY_RSA` export KEY_CONFIG="$EASY_RSA/openssl.cnf" source vars ./clean-all #initialize root ca; give it a cert with cn=rootca KEY_CN=rootca KEY_NAME=rootca ./pkitool --initca rootca #build intermediate ca, with name interca KEY_CN=interca KEY_NAME=interca ./pkitool --inter interca #now copy vars for intermediate ca cp vars inter_ca_vars #... and edit them for use for endpoints (clients/servers): nano inter_ca_vars nano inter_ca_vars #edit place where keys are stored # intermediate ca has separate key directory export KEY_DIR="$EASY_RSA/intercakeys" #edit to set up end user certs export KEY_CN=EndPoint export KEY_NAME=EndPoint export KEY_OU=host.domain_endpoint_division source ./inter_ca_vars ./clean-all ./build-dh # generates several files in /etc/openvpn/easy-rsa/intercakeys: # export-ca.crt ./inherit-inter /home/jibe/tmp/pki/keys interca ./pkitool --server openvpnserver
Using Common Name: openvpnserver Error Loading extension section server 139680895010448:error:2206D06C:X509 V3 routines:X509V3_parse_list:invalid null name:x509v3/v3_utl.c:370: 139680895010448:error:22097069:X509 V3 routines:DO_EXT_NCONF:invalid extension string:x509v3/v3_conf.c:146:name=subjectAltName,section= 139680895010448:error:22098080:X509 V3 routines:X509V3_EXT_nconf:error in extension:x509v3/v3_conf.c:97:name=subjectAltName, value=
Notes PKI avec XCA X Certificate and key manager
Voir :
Carte à puce :
Voir aussi :
Notes PHP
Le module xdebug est-il activé ?
php -m | grep xdebug
Sur Debian Jessie /etc/php5/mods-available/xdebug.ini \ Sur RedHat 7 /etc/php.d/xdebug.ini
xdebug.ini
;Debian ; zend_extension=xdebug.so ;RedHat ; zend_extension=/usr/lib64/php/modules/xdebug.so
Logs
error_log = /var/log/php-fpm/error.log log_level = notice
Pb boot LVM
Tapez dans le menu grub :
lvm vgchange -aly
Si cela ne marche pas, démarrer avec une Debian rescue
pkill cryptsetup sleep 2 || exit 1 /sbin/cryptsetup luksOpen $1 root || exit 1 sleep 2 || exit 1 /bin/lvm vgscan sleep 1 || exit 1 /bin/lvm vgchange -a y sleep 1 || exit 1 /sbin/ttyecho -n /dev/console q
2
Cette astuce ma aidé une fois. Partitions LVM chiffées (cryptsetup)
cryptsetup: evms_activate is not available
Create a new file /etc/initramfs-tools/scripts/local-top/workaround_mdadm :
/etc/initramfs-tools/scripts/local-top/workaround_mdadm
#!/bin/sh sleep 6 mdadm --stop /dev/md1 mdadm --stop /dev/md0 sleep 6 mdadm --assemble --scan
Make the file executable :
chmod 755 /etc/initramfs-tools/scripts/local-top/workaround_mdadm
Create new initrd files in /boot :
update-initramfs -k all -c
Reboot with just one disk and enjoy.
Notes php.ini
; Allow the <? tag. Otherwise, only <?php and <script> tags are recognized. short_open_tag = Off ; Decides whether PHP may expose the fact that it is installed on the server ; (e.g. by adding its signature to the Web server header). It is no security ; threat in any way, but it makes it possible to determine whether you use PHP ; on your server or not. ; http://php.net/expose-php expose_php = Off date.timezone = 'Europe/Paris' Voir https://www.dokuwiki.org/install:php et https://www.zabbix.com/documentation/2.0/manual/installation/install Apparemment le "safe mode" et remplacé par : disable_functions = http://php.net/disable-functions http://php.net/disable-classes max_execution_time memory_limit = max_input_time = default_socket_timeout = ; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT ; http://php.net/error-reporting error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT sql.safe_mode =
http://www.thonky.com/how-to/prevent-base-64-decode-hack/
allow_url_fopen=Off allow_url_include=Off open_basedir = On register_globals = Off exec = Off shell_exec = Off allow_url_fopen = Off allow_url_include = Off allow_url_fopen = off allow_url_include = off display_errors = Off //safe to disable on live site register_globals = Off //off by default but a good reminder to check expose_php = Off //safe to disable allow_url_fopen = Off //might break something allow_url_include = Off //might break something log_errors = On //logging errors is always a good idea if you check them error_log = /var/log/phperror.log enable_dl = Off //might break something file_uploads = Off //will most likely break something disable_functions="popen,exec,system,passthru,proc_open,shell_exec,show_source,php disable_functions = =exec,passthru,shell_exec,system,proc_open,popen,curl_exec,curl_multi_exec,parse_ini_file,show_source disable_functions = show_source,system,shell_exec,passthru,exec,phpinfo,popen,proc_open,allow_url_fopen exec, passthru, shell_exec, system, proc_open, posix_mkfifo, pg_lo_import, dbmopen, dbase_open, popen, chgrp, chown, chmod, symlink, pcntl_exec, apache_child_terminate, apache_setenv, define_syslog_variables, posix_getpwuid, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid, posix_setuid, posix_setuid, posix_uname, proc_close, pclose, proc_nice, proc_terminate, shell_exec disable_functions = show_source, system, shell_exec, passthru, exec, popen, proc_open, allow_url_fopen, phpinfo, gzinflate, fsockopen, pfsockopen apache_child_terminate, apache_setenv, define_syslog_variables, escapeshellarg, escapeshellcmd, eval, exec, fp, fput, ftp_connect, ftp_exec, ftp_get, ftp_login, ftp_nb_fput, ftp_put, ftp_raw, ftp_rawlist, highlight_file, ini_alter, ini_get_all, ini_restore, inject_code, openlog, passthru, php_uname, phpAds_remoteInfo, phpAds_XmlRpc, phpAds_xmlrpcDecode, phpAds_xmlrpcEncode, popen, posix_getpwuid, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid, posix_setuid, posix_setuid, posix_uname, proc_close, proc_get_status, proc_nice, proc_open, proc_terminate, shell_exec, show_source, syslog, system, xmlrpc_entity_decode, ini_set disable_functions = "ln, cat, popen, pclose, posix_getpwuid, posix_getgrgid, posix_kill, parse_perms, system, dl, passthru, exec, shell_exec, popen, proc_close, proc_get_status, proc_nice, proc_open, escapeshellcmd, escapeshellarg, show_source, posix_mkfifo, mysql_list_dbs, get_current_user, getmyuid, pconnect, link, symlink, pcntl_exec, ini_alter, pfsockopen, leak, apache_child_terminate, posix_kill, posix_setpgid, posix_setsid, posix_setuid, proc_terminate, syslog, fpassthru, stream_select, socket_select, socket_create, socket_create_listen, socket_create_pair, socket_listen, socket_accept, socket_bind, socket_strerror, pcntl_fork, pcntl_signal, pcntl_waitpid, pcntl_wexitstatus, pcntl_wifexited, pcntl_wifsignaled, pcntl_wifstopped, pcntl_wstopsig, pcntl_wtermsig, openlog, apache_get_modules, apache_get_version, apache_getenv, apache_note, apache_setenv, virtual, chmod, file_upload, delete, deleted, edit, fwrite, cmd, rename, unlink, mkdir, mv, touch, cp, cd, pico" disable_functions = "apache_child_terminate, apache_setenv, define_syslog_variables, escapeshellarg, escapeshellcmd, eval, exec, fp, fput, ftp_connect, ftp_exec, ftp_get, ftp_login, ftp_nb_fput, ftp_put, ftp_raw, ftp_rawlist, highlight_file, ini_alter, ini_get_all, ini_restore, inject_code, mysql_pconnect, openlog, passthru, php_uname, phpAds_remoteInfo, phpAds_XmlRpc, phpAds_xmlrpcDecode, phpAds_xmlrpcEncode, popen, posix_getpwuid, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid, posix_setuid, posix_setuid, posix_uname, proc_close, proc_get_status, proc_nice, proc_open, proc_terminate, shell_exec, syslog, system, xmlrpc_entity_decode" disable_functions = exec,passthru,shell_exec,system,proc_open,popen,parse_ni_file,show_source,phpinfo,proc_open,base64_decode,base64_encodem,proc_terminate; base64_decode disable_functions = exec,passthru,shell_exec,system,proc_open,popen,curl_exec,curl_multi_exec,parse_ini_file,show_source
allow_url_include = Off allow_url_fopen = Off session.use_only_cookies = 1 session.cookie_httponly = 1 expose_php = Off display_errors = Off register_globals = Off disable_functions = escapeshellarg, escapeshellcmd,passthru, proc_close, proc_get_status, proc_nice, proc_open,proc_terminate
Socket Listen
Voir :
/etc/php-fpm.d/www.conf
listen.backlog = -1
man 2 listen php-fpm -tt -y /etc/php-fpm.conf
cat /proc/sys/net/core/somaxconn
sysctl net.core.somaxconn=1024
Valeur possibles :
- 128
- 1024
- 65535
