He creado una web con un elemento iframe pero estoy teniendo problemas con la Política de Seguridad de Contenidos, he creado una pero sigo teniendo problemas. El enlace a mi sitio web es https://daniellop.me/comments
Los errores que me sale son los siguientes:
[Error] The source list for Content Security Policy directive 'script-src' contains an invalid source: ''report-sample''. It will be ignored. [Error] The source list for Content Security Policy directive 'style-src' contains an invalid source: ''report-sample''. It will be ignored. [Error] The Content Security Policy directive 'report-uri' is ignored when delivered via an HTML meta element. [Error] Unrecognized Content-Security-Policy directive 'worker-src'. [Error] Refused to load https://c.daniellop.me/js/iframeResizer.min.js because it does not appear in the script-src directive of the Content Security Policy. [Error] Refused to apply a stylesheet because its hash, its nonce, or 'unsafe-inline' does not appear in the style-src directive of the Content Security Policy. (comments.html, line 1) [Error] The source list for Content Security Policy directive 'script-src' contains an invalid source: ''report-sample''. It will be ignored. [Error] The source list for Content Security Policy directive 'style-src' contains an invalid source: ''report-sample''. It will be ignored. [Error] Unrecognized Content-Security-Policy directive 'worker-src'. [Info] Successfully preconnected to https://api.github.com/ [Error] Refused to load https://c.daniellop.me/en/widget?origin=https%3A%2F%2Fdaniellop.me%2Fcomments.html&session=ed4607482497cb466430f139%2BkgtddmKtaL8RbU%2FqGlagBFJqTeszuxjVT8vCzWLJOH1fuMPdKGfO2XE8xBrfJ%2BzXBXrZIUZ0LSQXt64xi7hZ7MO666GzN6notYDPb64gNQNwAWgiCrimp2f5yU%3D&theme=light&reactionsEnabled=0&emitMetadata=0&repo=daniellop1%2Fcomments&repoId=R_kgDOGmDcFQ&category=Comment&categoryId=DIC_kwDOGmDcFc4CAirK&description=&term=Main+comment+page because it does not appear in the frame-ancestors directive of the Content Security Policy.Mi política de seguridad de contenido actual
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'report-sample' 'self' https://c.daniellop.me/client.js; style-src 'report-sample' 'self' https://cdn.daniellop.me; object-src 'none'; base-uri 'self'; connect-src 'self'; font-src 'self'; frame-src 'self' https://c.daniellop.me; img-src 'self'; manifest-src 'self'; media-src 'self'; report-uri https://61d813c6adaa4253cc595f23.endpoint.csper.io/?v=2; worker-src 'none';">La principal fuente de errores es que está utilizando funciones de CSP nivel 3, mientras que su navegador probablemente solo sea compatible con CSP nivel 2. 'report-sample' y worker-src solo están disponibles en el nivel 3. Probablemente debería ceñirse al nivel 2 de momento hasta que aumente el soporte de nivel 3.
Está configurando CSP en una metaetiqueta. Algunas directivas solo se pueden configurar en CSP cuando se entregan como un encabezado de respuesta, report-uri está fallando debido a esto.
Tiene un estilo en línea en comments.html que infringe la política actual.
Por lo general, solo debe incluir hosts en su lista de fuentes y debe reemplazar https://c.daniellop.me/client.js con c.daniellop.me o https://c.daniellop.me .
También hay una violación de ancestros de marcos. Como los ancestros de marcos se ignoran en las metaetiquetas, debe haber otro CSP establecido en un encabezado de respuesta. Recuerde que si el sitio A está enmarcando al sitio B, frame-src del sitio A decidirá si es aceptable enmarcar B, mientras que frame-ancestros de B decidirá si es aceptable ser enmarcado por A.