# CSP Безопасность

{% hint style="info" %}
Content Security Policy (CSP) – это широко поддерживаемый стандарт веб-безопасности. Он позволяет разработчикам выбирать, какие ресурсы могут загружаться приложениями, и тем самым предотвращать определенные типы атак с внедрением кода.
{% endhint %}

Для настройки, на сервере откройте файл **.env**, уберитесь что в списке есть CSP\_ENABLED и она включена

{% code title=".env" %}

```
CSP_ENABLED=true
```

{% endcode %}

<details>

<summary>После ее включение, некоторые сервисы не работают, что делать?</summary>

После включения CSP, сайт будет работать исключительно через проверенных источников, если какой либо сторонний сервис не работает, попросите ваших программистов настроить файл на сервере.&#x20;

```
app/Policies/CspPolicy.php
```

Рекомендуем настроить этот файл согласно инструкции [Laravel CSP](https://github.com/spatie/laravel-csp)

*<mark style="color:red;">После настроек, и в случае будущих обновлений, обязательно сохраняйте файл</mark>*

</details>

## Рекомендуемые ссылки

{% content-ref url="/pages/1l6h1Oe73cxdYfGUwqH8" %}
[Как найти путь к проекту и имя пользователя в FastPanel?](/pomosh-i-spravka/infrastruktura/kak-naiti-put-k-proektu-i-imya-polzovatelya-v-fastpanel.md)
{% endcontent-ref %}


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.iexexchanger.com/obshaya-informaciya/centr-bezopasnosti/csp-bezopasnost.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
