Impossible de charger la ressource Directive de Content Security Policy

Bonjour à tous.
J’ai deux Jeedom :
Une Jeedom ATLAS et une Jeedom SMART (bientôt remplacée par une LUNA)
Sont toutes deux au même niveau 4.4.19.
Sur la Jeedom ATLAS le plugin Webview fonctionne correctement, ne renvoie pas d’erreur.
Sur la SMART j’ai l’erreur suivante :
<<
Impossible de charger la ressource « http://192.168.X.X », car elle va contre la directive de Content Security Policy :
« frame-src ‹ self › *.jeedom.com *.google.com *.google.fr *.googleapis.com data: »

Pourquoi ça fonctionne avec l’ATLAS et pas avec la SMART ?
J’ai vu certaines explications déjà sur le community, mais je ne souhaite pas bricoler. La dernière fois la SMART a planté et j’ai du tout réinitialiser.
Si quelqu’un a une idée ?
Bien cordialement
Jean

Bonjour,

sans doute que ton ATLAS est en Apache non sécurisé, contrairement a ta SMART.

https://doc.jeedom.com/fr_FR/core/4.4/faq#Depuis%20la%204.2%2C%20je%20ne%20peux%20plus%20afficher%20d’iframe

Car sur l’Atlas Apache (le serveur web qui fait tourner jeedom) doit être en non sécurisé alors qu’avec la Smart oui.

Tu as une option accessible depuis les paramètres systeme de jeedom pour passer d’un mode à l’autre.
Cependant passer totalement en mode non sécurisé n’est pas idéal en terme de sécurité comme tu peux l’imaginer …

Peut-on vérifier sur l’ATLAS et sur la SMART respectivement le niveau de sécurisation Apache pour vérifier que c’est bien celà ?
L’onglet OS/DB du menu system configuration semble proposer des commandes mais je n’ose pas y toucher …

Oui, dans le même menu administration système tape la commande personnalisée suivante sur chacun de tes jeedom :

cat /etc/apache2/conf-available/security.conf

Ca ne modifiera rien, ça ne fait qu’afficher le fichier de conf.
En comparant les deux on va vite voir si l’un est en mode sécurisé et pas l’autre

Retour de la commande cat /etc/apache2/conf-available/security.conf pour la SMART

ServerTokens Prod

ServerSignature off

TraceEnable Off

<Directory /var/www/html>

Options -Indexes -ExecCGI -FollowSymLinks

AllowOverride All

</Directory>

<IfModule mod_headers.c>

Header set X-Content-Type-Options "nosniff"

Header set X-Frame-Options "sameorigin"

Header set X-XSS-Protection "1; mode=block"

Header unset X-Powered-By

Header set Referrer-Policy: strict-origin-when-cross-origin

Header set Permissions-Policy "accelerometer=(),battery=(),fullscreen=(self),geolocation=(),camera=(),ambient-light-sensor=(self),autoplay=(self)"

Header set Content-Security-Policy "default-src 'self' file: data: blob: filesystem:;script-src-attr 'self' 'unsafe-inline' 'unsafe-eval' *.google.com *.google.fr *.googleapis.com;script-src 'self' 'unsafe-inline' 'unsafe-eval' *.google.com *.google.fr;script-src-elem 'self' 'unsafe-inline' 'unsafe-eval' *.google.com *.google.fr;img-src 'self' * data:;style-src 'self' 'unsafe-inline';style-src-attr 'self' 'unsafe-inline';worker-src blob:;frame-src 'self' *.jeedom.com *.google.com *.google.fr *.googleapis.com data:;"

</IfModule>

Retour de la commande cat /etc/apache2/conf-available/security.conf pour l’ATLAS

<Directory /var/www/html>

Options -Indexes -ExecCGI -FollowSymLinks

AllowOverride All

</Directory>

ServerTokens Prod

TraceEnable Off

<IfModule mod_headers.c>

# Content Security Policy (CSP)

Header set Content-Security-Policy` "script-src 'self'; object-src 'self'"

<FilesMatch "\.(appcache|atom|bbaw|bmp|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|webapp|web[mp]|webmanifest|woff2?|xloc|xml|xpi)$">

Header unset Content-Security-Policy

</FilesMatch>

# Reducing MIME type security risks

Header set X-Content-Type-Options "nosniff"

# HTTP Strict Transport Security (HSTS)

Header always set Strict-Transport-Security "max-age=16070400; includeSubDomains"

# Clickjacking

Header set X-Frame-Options "DENY"

<FilesMatch "\.(appcache|atom|bbaw|bmp|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|webapp|web[mp]|webmanifest|woff2?|xloc|xml|xpi)$">

Header unset X-Frame-Options

</FilesMatch>

# Reflected Cross-Site Scripting (XSS) attacks

Header set X-XSS-Protection "1; mode=block"

<FilesMatch "\.(appcache|atom|bbaw|bmp|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|webapp|web[mp]|webmanifest|woff2?|xloc|xml|xpi)$">

Header unset X-XSS-Protection

</FilesMatch>

# Server software information

ServerSignature Off

Header unset X-Powered-By

# Weak SSL protocols

SSLProtocol all -SSLv2 -SSLv3 -TLSv1

</IfModule>

ErrorLog /var/www/html/log/http.error

C’est bien ça les deux box n’ont pas le même niveau de sécurisation d’Apache.

Tu affiches quoi exactement avec le plugin Webview ?
Pour voir si il y a une alternative autre que de passer totalement en non sécurisé

Alors bonjour et merci pour les aides.
J’affiche des Caméra et des serveurs webradio sur Raspberry distants ou sur mon réseau.
Bien cordialement
Jean