# Custom plugin Content Security Policy problem

**URL:** <https://discuss.elastic.co/t/custom-plugin-content-security-policy-problem/178047>\
**Category:** Elasticsearch\
**Created:** [April 23, 2019, 1:41pm UTC](https://discuss.elastic.co/t/custom-plugin-content-security-policy-problem/178047 "2019-04-23T13:41:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![iamazy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/iamazy/32/36501_2.png) [@iamazy](https://discuss.elastic.co/u/iamazy)\
**Post date:** [April 23, 2019, 1:41pm UTC](https://discuss.elastic.co/t/custom-plugin-content-security-policy-problem/178047/1 "2019-04-23T13:41:34Z")

</div>

hello  
i wrote a sql plugin for es7，and after installed it，query dataset by sql in kibana，i found kibana cause a Content Security Policy problem, the complete message as followed

```auto
Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'nonce-jHPATaeGD121pcYk'". Either the 'unsafe-inline' keyword, a hash ('sha256-SHHSeLc0bp6xt4BoVVyUy+3IbVqp3ujLaR+s+kSP5UI='), or a nonce ('nonce-...') is required to enable inline execution.

A single error about an inline script not firing due to content security policy is expected!

```

and then kibana got a message

```json
{
  "statusCode": 504,
  "error": "Gateway Time-out",
  "message": "Client request timeout"
}

```

How to solve this problem?

thanks

---

<div class="post-metadata">

**Author:** ![trex](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/trex/32/34230_2.png) [@trex](https://discuss.elastic.co/u/trex)\
**Post date:** [April 24, 2019, 2:44pm UTC](https://discuss.elastic.co/t/custom-plugin-content-security-policy-problem/178047/2 "2019-04-24T14:44:20Z")

</div>

I see the same error in the browser console. Everything works though.

---

<div class="post-metadata">

**Author:** ![iamazy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/iamazy/32/36501_2.png) [@iamazy](https://discuss.elastic.co/u/iamazy)\
**Post date:** [April 25, 2019, 1:34am UTC](https://discuss.elastic.co/t/custom-plugin-content-security-policy-problem/178047/3 "2019-04-25T01:34:28Z")

</div>

Hello ，  
My problem was solved，may be it caused by serialization，I changed anothor  
way and it works。  
But I dont konw Why is that you got the same error but everything works

bye

---

<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:** [May 23, 2019, 1:34am UTC](https://discuss.elastic.co/t/custom-plugin-content-security-policy-problem/178047/4 "2019-05-23T01:34:40Z")

</div>

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