> For the complete documentation index, see [llms.txt](https://docs.videsk.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.videsk.io/es-developers/seguridad/cabeceras.md).

# Cabeceras

A continuación te explicaremos ciertos conceptos importantes a considerar antes de integrar Videsk en tu sitio web.

Dependiendo de la configuración de tu sitio web y dónde esté alojado deberás configurar ciertas cabeceras en tu servidor web.

{% hint style="info" %}
**Las cabeceras son opcionales**, pero son sugeridas para añadir mayor seguridad a tu sitio web. **Si no posees ninguna de ellas no es obligatorio añadirlas.**
{% endhint %}

## Permissions-Policy

Esta cabecera define donde y que tipos de características del navegador se pueden utilizan en tu sitio, como cámara, micrófono, GPS, giroscopio, batería, etc. Si tienes activada esta cabecera deberás añadir al listado:

```
Permissions-Policy: autoplay=(self), camera=(self), fullscreen=(self), microphone=(self), picture-in-picture=(self)
```

{% hint style="info" %}
`Feature-Policy` es el nombre antiguo de `Permissions-Policy` y está obsoleta. Solo mantenla si necesitas compatibilidad con navegadores antiguos:

`Feature-Policy: microphone 'self'; camera 'self'; autoplay 'self'; fullscreen 'self'; picture-in-picture 'self'`
{% endhint %}

## X-Frame-Options

Esta cabecera es vital en términos de seguridad, evita que embeban tu sitio web en uno externo suplantando tu identidad y potencialmente extraer datos de tus usuarios. Por ello, te sugerimos añadirla como mínimo en `SAMEORIGIN`.

```
X-Frame-Options: SAMEORIGIN
```

{% hint style="info" %}
Si configuras el valor en `DENY` podrías perder ciertas funcionalidades de Videsk.
{% endhint %}

## Content-Security-Policy

Esta cabecera (CSP) permite definir que tipo de contenido se tiene permitido cargar para cada servicio y tipo de recursos registrados en esta cabecera.

```
Content-Security-Policy: media-src 'self' *.videsk.io; connect-src 'self' *.videsk.io; default-src 'self' 'unsafe-inline' *.videsk.io
```

{% hint style="warning" %}
Sin `connect-src 'self' *.videsk.io` provocarás que las conexiones WebSocket sean bloqueadas.
{% endhint %}

## Content-Security-Policy-Report-Only

Esta cabecera permite experimentar con ciertas políticas de cabeceras antes de implementar oficialmente, sin generar necesariamente un impacto real sobre tu sitio, dando así la opción de monitorear el comportamiento.

Te sugerimos añadir lo mismo que en Content-Security-Policy (CSP).

## Connection-Allowlist

Esta cabecera, disponible desde Chrome 152, restringe a qué destinos puede conectarse tu sitio web. A diferencia de CSP, funciona como una lista blanca única: **cualquier conexión que no coincida con la lista es bloqueada**. Los destinos se definen con la sintaxis estándar [URLPattern](https://developer.mozilla.org/docs/Web/API/URL_Pattern_API).

Si tienes activada esta cabecera deberás añadir nuestros dominios y habilitar WebRTC:

```
Connection-Allowlist: ("https://*.videsk.io/*" "wss://*.videsk.io/*" response-origin); webrtc=allow
```

{% hint style="warning" %}
Esta cabecera bloquea WebRTC por defecto. Sin `webrtc=allow` las videollamadas no podrán establecerse, aunque nuestros dominios estén en la lista.
{% endhint %}

{% hint style="info" %}
Esta cabecera también bloquea por defecto las redirecciones. Si detectas conexiones bloqueadas por este motivo, añade `redirects=allow` a la política.
{% endhint %}

## Connection-Allowlist-Report-Only

Al igual que con CSP, esta cabecera permite probar la política sin bloquear conexiones: el navegador solo envía los reportes de infracción al endpoint que definas en la cabecera `Reporting-Endpoints`.

Te sugerimos comenzar con esta cabecera antes de activar `Connection-Allowlist`:

```
Reporting-Endpoints: connection-allowlist="https://tu-sitio.com/reportes"
Connection-Allowlist-Report-Only: ("https://*.videsk.io/*" "wss://*.videsk.io/*" response-origin); webrtc=allow; report-to=connection-allowlist
```

{% hint style="info" %}
Puedes revisar las conexiones bloqueadas en la pestaña **Network** de las DevTools de Chrome, y los errores de sintaxis de la cabecera en la pestaña **Issues**.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.videsk.io/es-developers/seguridad/cabeceras.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
