Description :

Nous allons voir comment chiffrer les communications Splunk :

  • L'accès au SplunkWeb du Search Head Cluster (SHC)

Dans cette partie 1 nous allons voir la configuration pour chiffrer l'accès à la GUI SplunkWeb.

Prérequis :

On partira sur la base de SHC et IDX cluster.

Important :
Bien avoir le splunk.secret et passwd sur toutes les machines Splunk Core/full install.

Génération des certificats :

Nous allons utiliser un certificat auto-signé, pour le SplunkWeb des US et SHC :

Commençons par la création de l'environnement sur us1 :

1 $ mkdir -p ~/certificate
2 $ cd ~/certificate

Création de la clés CA :

1 $ openssl genrsa  -out rootCA.key 4096
2 Generating RSA private key, 4096 bit long modulus (2 primes)
3 ..............................................................................................................................................++++
4 .........................................................................................................................++++
5 e is 65537 (0x010001)

Création et signature du certificat CA :

 1 $ openssl req -x509 -new -nodes -key rootCA.key -sha256 -days 1024 -out rootCA.pem
 2 You are about to be asked to enter information that will be incorporated
 3 into your certificate request.
 4 What you are about to enter is what is called a Distinguished Name or a DN.
 5 There are quite a few fields but you can leave some blank
 6 For some fields there will be a default value,
 7 If you enter '.', the field will be left blank.
 8 -----
 9 Country Name (2 letter code) [XX]:FR
10 State or Province Name (full name) []:France
11 Locality Name (eg, city) [Default City]:Paris
12 Organization Name (eg, company) [Default Company Ltd]:Alasta
13 Organizational Unit Name (eg, section) []:SIT
14 Common Name (eg, your name or your server's hostname) []:ca.udmiot.lab
15 Email Address []:

Création de la clés du certificat du serveur :

1 $ openssl genrsa -out wildcard_web.udmiot.key 2048
2 Generating RSA private key, 2048 bit long modulus (2 primes)
3 ........+++++
4 ......+++++
5 e is 65537 (0x010001)

Génération du csr :

 1 $ openssl req -new -key wildcard_web.udmiot.key -out wildcard_web.udmiot.csr
 2 You are about to be asked to enter information that will be incorporated
 3 into your certificate request.
 4 What you are about to enter is what is called a Distinguished Name or a DN.
 5 There are quite a few fields but you can leave some blank
 6 For some fields there will be a default value,
 7 If you enter '.', the field will be left blank.
 8 -----
 9 Country Name (2 letter code) [XX]:FR
10 State or Province Name (full name) []:France
11 Locality Name (eg, city) [Default City]:Paris
12 Organization Name (eg, company) [Default Company Ltd]:Alasta
13 Organizational Unit Name (eg, section) []:SIT
14 Common Name (eg, your name or your server's hostname) []:*.udmiot.lab
15 Email Address []:
16 
17 Please enter the following 'extra' attributes
18 to be sent with your certificate request
19 A challenge password []:
20 An optional company name []:

Génération du certificat :

1 $ openssl x509 -req -in wildcard_web.udmiot.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out wildcard_web.udmiot.pem -days 500 -sha256
2 Signature ok
3 subject=C = FR, ST = France, L = Paris, O = Alasta, OU = SIT, CN = *.udmiot.lab
4 Getting CA Private Key

Génération du certificat avec la clés :

1 $ cat wildcard_web.udmiot.key > wildcard_web.udmiot_with_key.pem
2 $ cat wildcard_web.udmiot.pem >> wildcard_web.udmiot_with_key.pem

Mise en place :

Copions les fichiers dans la configuration Splunk de l'instance Deployer/us1 et Cluster Master/us2 :

1 $ mkdir -p /opt/splunk/etc/auth/my_cert/
2 
3 $ cp wildcard_web.udmiot.key wildcard_web.udmiot.pem /opt/splunk/etc/auth/my_cert/

Création de l'app pour la configuration TLS :

1 $ mkdir -p /opt/splunk/etc/apps/custom_my_cert_tls/local/
2 $ vi /opt/splunk/etc/apps/custom_my_cert_tls/local/web.conf
3 
4 [settings]
5 enableSplunkWebSSL = true
6 privKeyPath = etc/auth/my_cert/wildcard_web.udmiot.key
7 serverCert =  etc/auth/my_cert/wildcard_web.udmiot.pem

Redémarrage pour prise en compte :

1 $ sudo systemctl status Splunkd

Vérification :

Vérifier en se connectant à us1 et us2 en HTTPS sur le port 8000.

Configuration pour la mise en place sur le SHC :

Sur chaque SHC, créer le dossier de certificat et y copier le certificat et la clés :

1 $ mkdir -p /opt/splunk/etc/auth/my_cert/

Création de l'app à déployer sur le SHC depuis le Deployer us1 :

1 $ cd /opt/splunk/etc/shcluster/apps/
2 
3 $ ln -s ../../apps/custom_my_cert_tls/

Deploiement :

1 $ /opt/splunk/bin/splunk apply shcluster-bundle -target https://shc1.udmiot.lab:8089

Vérification :

Vérifier en se connectant sur les Search Head en HTTPS sur le port 8000.