LEEUNITYAssets / Content / 博客.asset
层级
⌄ Lee / Homepage
INSPECTOR
Type
Content
Name
博客
lee@mtftm.com ↗GitHub ↗
N038JENKINS / JENKINS CSS

技术 / English

Jenkins allows loading inline CSS styles

Jenkins security policy:

更新
2025.05.05
阅读
2 分钟
语言
English

Groovy Script

Jenkins security policy:

  • No JavaScript allowed at all
  • No plugins (object/embed) allowed
  • No inline CSS, or CSS from other sites allowed
  • No images from other sites allowed
  • No frames allowed
  • No web fonts allowed
  • No XHR/AJAX allowed
  • etc.

By default, only internal server resources are allowed. To allow inline styles, execute the following code in Manage Jenkins -> Script Console, or use Pipeline + Groovy plugin to execute during the process.

System.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "sandbox allow-same-origin; default-src 'self'; style-src 'self' 'unsafe-inline';")

For more details, please refer to the official documentation