# Embed Kibana Dashboard via IFrame / csp config

**URL:** <https://discuss.elastic.co/t/embed-kibana-dashboard-via-iframe-csp-config/291128>\
**Category:** Kibana\
**Created:** [December 7, 2021, 2:20pm UTC](https://discuss.elastic.co/t/embed-kibana-dashboard-via-iframe-csp-config/291128 "2021-12-07T14:20:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ksremo](https://avatars.discourse-cdn.com/v4/letter/k/5fc32e/32.png) [@ksremo](https://discuss.elastic.co/u/ksremo)\
**Post date:** [December 7, 2021, 2:20pm UTC](https://discuss.elastic.co/t/embed-kibana-dashboard-via-iframe-csp-config/291128/1 "2021-12-07T14:20:05Z")

</div>

hi i want a third webserver to embed a dashboard via iframe, but default csp config denied it.  
what i tried so far in the kibana.yml  
xpack.security.sameSiteCookies: None  
xpack.security.secureCookies: true  
csp.strict: false  
server.securityResponseHeaders.disableEmbedding: false  
csp.rules: ["default-src \*"]  
#csp.rules: ["default-src [https://urlthatembeds.local/](https://urlthatembeds.local/)"]  
#server.customResponseHeaders: {"x-frame-options":"allow-from [https://urlthatembeds.local/](https://urlthatembeds.local/) "}  
server.customResponseHeaders: {"x-frame-options":"allow-from \*"}

But it seems that always "x-frame-options: SAMEORIGIN" is sent (but also the custom header)

how to allow these iframes?

---

<div class="post-metadata">

**Author:** ![azasypkin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/azasypkin/32/42216_2.png) [@azasypkin](https://discuss.elastic.co/u/azasypkin)\
**Post date:** [December 16, 2021, 1:50pm UTC](https://discuss.elastic.co/t/embed-kibana-dashboard-via-iframe-csp-config/291128/2 "2021-12-16T13:50:48Z")

</div>

> [@ksremo](#):
>
> but default csp config denied it.

What exact error do you observe? Do you see the same behavior in different browsers (e.g. Firefox vs Chrome)?

---

<div class="post-metadata">

**Author:** ![ksremo](https://avatars.discourse-cdn.com/v4/letter/k/5fc32e/32.png) [@ksremo](https://discuss.elastic.co/u/ksremo)\
**Post date:** [December 16, 2021, 2:09pm UTC](https://discuss.elastic.co/t/embed-kibana-dashboard-via-iframe-csp-config/291128/3 "2021-12-16T14:09:44Z")

</div>

i could solve the problem.  
problem was the nginx reverse proxy in front of kibana. he adds "x-frame-options: SAMEORIGIN" header.

---

<div class="post-metadata">

**Author:** ![azasypkin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/azasypkin/32/42216_2.png) [@azasypkin](https://discuss.elastic.co/u/azasypkin)\
**Post date:** [December 16, 2021, 2:13pm UTC](https://discuss.elastic.co/t/embed-kibana-dashboard-via-iframe-csp-config/291128/4 "2021-12-16T14:13:32Z")

</div>

Ah, nice, thanks for sharing!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 13, 2022, 2:14pm UTC](https://discuss.elastic.co/t/embed-kibana-dashboard-via-iframe-csp-config/291128/5 "2022-01-13T14:14:09Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
