воскресенье, 26 января 2020 г.

Jenkins, HTML documentation and security

Jenkins может сам генерировать документацию, но доступ к ней будет ограничен по CSP
Jenkins 1.641 / Jenkins 1.625.3 introduce the Content-Security-Policy header to static files served by Jenkins (specifically DirectoryBrowserSupport). This header is set to a very restrictive default set of permissions to protect Jenkins users from malicious HTML/JS files in workspaces, /userContent, or archived artifacts.

Unfortunately, several popular, useful plugins are affected by this and lose part of their functionality unless the default rules are relaxed.
https://wiki.jenkins.io/display/JENKINS/Configuring+Content+Security+Policy

Сначала для обхода надо было выставлять hudson.model.DirectoryBrowserSupport.CSP, например через консоль
System.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "default-src 'self' 'unsafe-inline' 'unsafe-eval'; img-src 'self' 'unsafe-inline' data:;")

Или через конфиг файлы
https://kb.froglogic.com/squish/integrations/jenkins/content-security-policy-csp-web-report/
https://stackoverflow.com/questions/37618892/jenkins-content-security-policy

Но с версии 2.200 введено улучшение - отдельный путь для документации, зовётся Resource root URL. По встроенной справке много подробностей.

https://issues.jenkins-ci.org/browse/JENKINS-41891

Комментариев нет:

Отправить комментарий