Interview Prep/Jenkins/Shared libraries

Global vs folder-level vs ad hoc libraries: what is the security difference?

AdvancedConceptShared libraries
Answer
  • Global libraries (Manage Jenkins > System) are trusted: they run outside the Groovy sandbox with full controller access. Only admins can configure them, and whoever can push to the library repo effectively has admin.
  • Folder-level libraries are untrusted: they run in the sandbox, like Jenkinsfiles, so script approval applies.
  • Ad hoc libraries loaded with library identifier: from arbitrary repos are untrusted too.

Protect trusted library repos with branch protection, required reviews and tags.

All Jenkins questions Roadmap: Jenkins

More on Shared libraries