↓ Skip to main content
  1. Posts/

Jenkins Finally Has Its Own zizmor

Table of Contents
jenkins-lint checking a directory and reporting syntax errors and security issues

If you’ve used GitHub Actions, you’ve probably heard of zizmor, right?

zizmor is a static analysis tool written in Rust that looks specifically for security problems in GitHub Actions. It has become the de facto standard for security checks on GitHub Actions. So if your GitHub repositories haven’t been through it yet, pick a day when you’re in a good mood and give it a try.

Another example: hadolint. Anyone who has written a Dockerfile knows it. It’s pretty much the de facto standard for linting Dockerfiles too. Docker later shipped its own checks (docker build --check), but maybe because hadolint came first, it had already won users’ minds.

As for me, I rarely use Docker’s own checks. hadolint is already in a lot of my repositories that have Dockerfiles, and I can’t be bothered to switch. Besides, I’m not a big fan of how Docker’s checks are ignored inside the Dockerfile: you can only skip a check for the whole file at the top, not line by line as with hadolint, like this:

# check=skip=JSONArgsRecommended,StageNameCasing

Also, hadolint is written in Haskell and ships as a static binary, so it’s awkward to use in pre-commit. The official hooks leave two options: use Docker, or install it yourself first.

That’s unfriendly to users, and the issue about it sat open in the official repository for three years. I eventually packaged it as a Python package, which solved the problem. I also offered to contribute it upstream, but so far they haven’t said yes.

Still, my hadolint-pre-commit is what a lot of people use to run hadolint in pre-commit. The downloads say it: hadolint-py was downloaded more than 180,000 times last month. (Upstream didn’t take it, but users did.)

With it, people don’t have to manage the binary themselves anymore. When upstream releases a new version, I follow, and users only need to pin a version.

So what about Jenkinsfiles? There really wasn’t a tool like this before. Now there is: jenkins-lint. jenkins-lint is to Jenkinsfiles what:

  • hadolint is to Dockerfiles
  • zizmor is to GitHub Actions

Why me
#

My history with Jenkins goes back to 2011. That was my first time using it. Nothing fancy: Freestyle jobs, configured by clicking around. Back then it wasn’t even called Jenkins yet. It was Hudson, and it was renamed later. Some of the younger folks may not know it had an earlier name.

I’ve used Jenkins ever since, from Freestyle to Pipeline, and then to Shared Libraries.

Along the way I almost wrote a book about Jenkins. At the time there were only one or two Jenkins books in Chinese. I really wanted to write one, and I even signed a contract with a publisher. But I was too busy. Finishing it would have taken six months to a year, and my day-to-day work came first, so in the end I told the publisher, on my own, that I couldn’t do it for personal reasons. (Signing a contract and then running off: I still regret it, but you can’t have it both ways.)

The book never happened, but I never stopped using Jenkins.

Now, linters. I started cpp-linter around 2022, and today I’d say it’s the best lint workflow for C/C++ projects. Thousands of open source projects use it, plus more in private repositories that nobody can count. cpp-linter was the first hint that I’d end up building linters.

cpp-linter’s ranking among C/C++ tools

I asked an AI where cpp-linter ranks. Its answer: #1 among clang-tidy PR-check Actions with 1,075 dependents (#2 has 527), #3 by actual usage among all C/C++ format and lint Actions, and #1 by stars and Marketplace search.

DevOps work got me into hadolint, open source got me into zizmor, Python projects got me into uv and ruff, and then Rust. From Jenkins to open source, to linters, to Rust, they’re all old friends of mine.

In 2025 I had in fact already written half a Jenkins linter: its predecessor, jenkinsfilelint, written in Python and built on existing infrastructure.

2026 is different. AI models have become far more capable, and Rust has a natural performance edge for tooling, so I could think big: no JVM, no reliance on the stalled Jenkinsfile Runner project, start from zero and build Jenkins its own zizmor with no baggage. Put all of that together, and I did it: jenkins-lint 2.0 is out.

One more thing: I also made an artwork for jenkins-lint, and it’s now on the Jenkins artwork page. “Lint” is the fluff on your clothes, so the Jenkins butler is holding a lint roller.

The jenkins-lint artwork: the Jenkins butler holding a lint roller

So what does jenkins-lint 2.0 actually do?

Mostly static checks for Jenkinsfiles, including security checks. Security used to get even less attention before commit. If Groovy interpolation passes a secret to sh, Jenkins only warns that it’s insecure in the build log, once the build is already running. After the warning, life goes on, and few people go back to fix it.

2.0: starting over
#

In 2.0 I dropped both of 1.x’s defaults (connecting to your own controller, or starting one in Docker): it no longer connects to a controller by default, and Docker support is gone. From 2.0 on, checking no longer needs Docker, and I’ve given up on Jenkinsfile Runner for good.

2.0 checks offline by default, and connecting to a controller is an option (--remote). (Maybe in 3.0 I’ll drop --remote too and make it a pure static checker.)

Also, 1.x was mostly Python, and 2.0 is Rust. As I said above, Rust is everywhere in this kind of static analysis tool: zizmor is written in Rust, and so are uv, ruff and ty.

To get this to zizmor’s level, a rewrite in Rust was unavoidable.

Enough talk. How do you use it?

Simple. In any project with a Jenkinsfile or other Pipeline files, run:

uvx jenkins-lint .

and you’ll see whether your Pipelines have syntax errors or security problems.

What it checks
#

Briefly, what it does:

  • Syntax and Declarative structure: errors use Jenkins’s own wording where it has one.
  • Security: branch name and pull request title injection, secret interpolation, steps that run on the controller, unpinned shared libraries and images, and input that anyone may approve: 6 rules in all.
  • Step parameters: since 2.2, give it your plugins.txt or a step list exported from Jenkins, and it catches typos like junit testResultz: offline.
  • Old repositories: hundreds of findings on the first run? Don’t panic. --write-baseline records them, and from then on only new ones fail.
  • Runs anywhere: pre-commit, GitHub Actions (pull request annotations, code scanning), and Jenkins itself, plus a Docker image and a static binary.
  • Follows the value: secrets and pull request input are followed through variables to the sh that runs them, and the finding points back to where the value came from.
  • Fixes, modeled on ruff: every fix is marked safe or unsafe. --fix applies the safe ones, and --unsafe-fixes also applies the ones that might change behavior.

Speed is no problem either. Validating through a Jenkins controller used to mean a network round trip per file, and starting a controller in Docker took 20 to 40 seconds the first time. Now 17,470 files, 3.8 million lines, take 13 seconds on one core.

Finally
#

There is an English introduction on the jenkins.io blog, and every rule and option is in the docs. If it gets something wrong or misses something, please open an issue.

From here, I’ll keep working on jenkins-lint as a long-time Jenkins user, an open source author, and the author of cpp-linter. I hope it ends up being what I said on X:

hadolint for Dockerfiles, zizmor for GitHub Actions, and now jenkins-lint for Jenkinsfiles.

Go run jenkins-lint . and see how many highs your Jenkinsfiles have.

Share X LinkedIn Telegram Email Edit this page