Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Contexte

La communication entre démon se fait par http.

Afin de sécuriser les communications du la communication des autres démons vers le Scheduler, il est possible d'activer le SSL sur le daemon , via des paramètres dédiés à cet effet dans le répertoire et communiquer en HTTPS.

Paramétrage du SSL

Le paramétrage du démon se fait en 2 étapes:

Paramétrage du SSL
  • Indiquer dans le schedulerd.ini que le démon doit ouvrir des sockets communication sécurisés
    • situé dans /etc/shinken/daemons/

 

  • Le préciser aussi dans le fichier de définition 

Passage du daemon en SSL - Fichier /etc/shinken/daemons/schedulerd.

cfg

ini

Pour activer le SSL, il faut modifier le fichier /etc/shinken/daemons/schedulerd.cfg qui contient les paramètres du daemon.

Ce fichier contient un bloc concernant le paramétrage des ports d'écoutes du daemon ( #-- HTTPS configuration – ) :

 

Code Block
[daemon]
##################################################
########### Daemon directory and logging #########
##################################################
# Directory the daemon will use to chdir into
workdir = /var/run/shinken

# Login directory, for standard logging and debug logging file
logdir  = /var/log/shinken

# Enable log for this daemon
use_local_log=1

# Standard log path
local_log=%(logdir)s/schedulerd.log

# accepted log level values= DEBUG,INFO,WARNING,ERROR,CRITICAL
log_level=WARNING

# unique pid file
pidfile=%(workdir)s/schedulerd.pid

# The system user the daemon will run as.
user=shinken

# The system group the daemon will run as.
group=shinken

# Set this parameter to 1 if you allow the daemon to run as root. Never do this unlesss you really understand why you are doing it and the risk
# that add to your installation.
#idontcareaboutsecurity=0

# Directory to load modules code from
modules_dir=/var/lib/shinken/modules

# Set to 0 if you want to make this daemon NOT run
daemon_enabled=1




##################################################
########### Daemon HTTP(s) server        #########
##################################################

# TCP port the daemon will listen to.
port=7768

# Address the daemon will listen to. By default 0.0.0.0=>all interfaces.
host=0.0.0.0

#-- HTTPS  configuration --
# Use or not the HTTPs as listening protocol for the daemon (default HTTP)
use_ssl=0

# Path for the CA certificate.
# NOTE: default file are for example ONLY. Do not use them in production!
#ca_cert=/etc/shinken/certs/ca.pem

# Path for the server certificate
#server_cert=/etc/shinken/certs/server.cert

# Path for the server key
#server_key=/etc/shinken/certs/server.key

# Enable or not the hard name for the HTTPS server name authentification (connection name and certificate must
# match the exact string to allow connection)
hard_ssl_name_check=0

# Which http backend code to run. Use auto.
http_backend=auto

# Number of threads that will listen to external connection to this daemon. Increase it if your
# daemon will be accessed by lot of other daemons (like for large realm architectures)
daemon_thread_pool_size=64


 

Ce fichier contient donc le paramètre use_ssl à passer à 1 pour activer le SSL.

Les certificats utilisés par défaut sont auto-signés et donc fournis à titre d'exemple, ils ne sont en aucun cas approuvés par une autorité de certification.
Il faut donc que vous placiez vos propres certificats dans le répertoire /etc/shinken/certs/ et modifiez alors les chemins si besoin.

 

Déclaration du daemon - Fichier /etc/shinken/schedulers/scheduler-master.cfg

Il faut déclarer le daemon Scheduler auprès de l'Arbiter. Pour cela, le fichier utilisé est /etc/shinken/schedulers/scheduler-master.cfg.

La variable  use_ssl permet de signaler à l'Arbiter que pour contacter le scheduler, il faut utiliser une connexion SSL.

Passez donc le paramètre use_ssl à 1.