從不停下來的學習
  • Home
  • About
  • Links
  • Ghost
  • Docker
  • VueJS
  • Stable Diffusion
Sign in Subscribe

Google Analytics

Content Security Policy中使用Google Analytics

Content Security Policy中使用Google Analytics

防範XSS攻擊 CSP是由Google提出的安全性工具,主要是因為多年來網站很容易受到Cross-site Scripting XXS攻擊。 完全封鎖 首先是試一試最安全的設定,根據CSP Evaluator的設定如下 script-src 'strict-dynamic' 'nonce-rAnd0m123' 'unsafe-inline' http: https:; object-src 'none'; base-uri 'none'; report-uri https://csp.example.com; 這個設定下....幾乎什麼script也不可能運作!連本地的script也被封死了... default-src 'self' https://*.google.com https://*.googleapis.com https://www.google-analytics.com https://*.gstatic.com; 不過我需要Google Analytics,因為Google Analytics需要多個source,所以我了defau
Edmond Yip Mar 8, 2017

Subscribe to 從不停下來的學習

Subscribe 以取得最新消息!
©256pages