Skip to main content
zoll

Rego policies for every file in a repository, and for the code hidden inside it.

PyPI CI License

English | Русский

Code hidden inside other code is read by nothing until it runs: awk in a shell string, a script in a YAML run:, a RUN line in a Dockerfile, a command: in a Kubernetes manifest. conftest sees data formats only; a linter sees one language. zoll parses every file - data formats into their document, code into its syntax tree - finds the code embedded in it, and runs your Rego policies over all of it.

zoll check reports curl piped into a shell, at its line in a workflow's run: step

Highlights

  • 50 languages, one run. Data formats become the document conftest would give your policy; code becomes its tree-sitter tree.
  • Code inside code. Bash in a workflow run:, awk in that bash, a script in a Markdown fence: each is checked as a file of its own, to any depth, and reported at its line in the real file.
  • conftest's policies run as they are. YAML, JSON and TOML give the documents conftest gives; a package main is bound to its language by one line of config.
  • Policies from git, pinned. A policy set kept in its own repository is fixed to its commit in zoll.lock.
  • Reports for people and for machines: text, JSON, GitHub annotations, SARIF.
  • One binary, no OPA. Rego is evaluated in process; the wheel holds everything.

How it works

.github/workflows/ci.yml          yaml   → package yaml policies
└── jobs.build.steps[0].run       bash   → package bash policies
    └── awk '{print $1}'          awk    → package awk policies
  1. Each file's language comes from its name, extension or shebang.
  2. Data formats (YAML, JSON, TOML…) become the document conftest would give your policy - with YAML read as YAML 1.2, so on: stays on; code becomes its tree-sitter tree, as JSON.
  3. Code embedded in it is found by where it sits - the argument of awk, the value of run: - and is checked as a file of its own, to any depth.
  4. A policy in package bash runs on bash wherever it is: a .sh file, a run:, a Dockerfile RUN. A conftest policy's package main is bound to its language by one line of config, and runs with its file untouched.
  5. Every violation is reported at its line in the real file.

A policy

policy/bash.rego, found with no config at all:

package bash

# A pipe into a shell downloads and runs code nobody reviewed.
deny_curl_pipe contains {"msg": "curl piped into a shell", "at": node} if {
	walk(input, [_, node])
	node.type == "pipeline"
	some cmd in node.children
	cmd.type == "command"
	cmd.fields.name.text == "curl"
}

It finds the pipe in a workflow's run:, as the picture above shows: the bash there is a file of its own to it.

zoll inspect FILE prints the JSON a policy sees for that file and every fragment in it, so a rule is written against the real shape.

Configuration

zoll.toml, .zoll.toml, or [tool.zoll] in pyproject.toml:

[tool.zoll]
policies = [
  "policy/",
  "git+https://github.com/my-org/policies//embedded-code@v1.0.0",
]
data = ["policy/data/"]

Policies from git are pinned to their commit in zoll.lock; zoll lock --upgrade moves them on purpose.

A result is silenced by a comment on its line, or for a glob in the config:

curl -fsSL https://example.com/install.sh | sh  # zoll: ignore[bash.curl_pipe]
[tool.zoll.per-file-ignores]
"scripts/legacy/**" = ["bash.curl_pipe"]

One that silences nothing is reported, so a dead one does not linger.

Install

uv tool install zoll-lint

The command is zoll; the PyPI name zoll is taken by a look-alike. Wheels are built for Linux (x86_64, aarch64), macOS (x86_64, arm64) and Windows.

pre-commit

zoll is a dev dependency, so the hook, make and CI run the one version uv.lock holds:

uv add --dev zoll-lint pre-commit
uv run pre-commit install

.pre-commit-config.yaml, at the repository's root:

repos:
  - repo: local
    hooks:
      - id: zoll
        name: zoll
        entry: uv run --locked zoll check --force-exclude
        language: system
        types: [file]
        require_serial: true

pre-commit names every staged file; --force-exclude leaves out those the config's exclude does.

In CI

On GitHub, each violation becomes an annotation on its line:

steps:
  - uses: actions/checkout@v7
    with:
      persist-credentials: false
  - uses: astral-sh/setup-uv@v10
  - run: uv run --locked zoll check --format github

License

MIT. The grammars and crates built into the binary keep their own licenses.

Metadata

Release files for zoll-lint 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for zoll-lint 0.2.0
File Size Uploaded Provenance Actions
zoll_lint-0.2.0.tar.gz 1.5 MB Without provenance Details for zoll_lint-0.2.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for zoll-lint 0.2.0
File Actions
zoll_lint-0.2.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for zoll_lint-0.2.0-py3-none-win_amd64.whl
zoll_lint-0.2.0-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details for zoll_lint-0.2.0-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
zoll_lint-0.2.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details for zoll_lint-0.2.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
zoll_lint-0.2.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for zoll_lint-0.2.0-py3-none-macosx_11_0_arm64.whl
zoll_lint-0.2.0-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details for zoll_lint-0.2.0-py3-none-macosx_10_12_x86_64.whl

Total release size: 46.5 MB

Release files / zoll_lint-0.2.0.tar.gz

Download URL zoll_lint-0.2.0.tar.gz
Size 1.5 MB
Tags Source
SHA-256 checksum
How to use checksums
9d4a3857ef791911b27dc0457b7cede4854282aa4ac0d89c5639dddb4f4ea985
BLAKE2b-256 checksum
How to use checksums
53e8844a4f71835e9aba269b92847660d7289afe203efc8e92a63beea3b18d76
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / zoll_lint-0.2.0-py3-none-win_amd64.whl

Download URL zoll_lint-0.2.0-py3-none-win_amd64.whl
Size 9.0 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
0f9175e0c93474339e83c5f355f9bdeb34d2d3bfcf837c1bb4e2420f4477c969
BLAKE2b-256 checksum
How to use checksums
2edc324ec4faf1c9b96e73b6179382b48304f4ce77bf8e343c1f2c59f316c216
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / zoll_lint-0.2.0-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL zoll_lint-0.2.0-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 9.1 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
e438543ee78e1e7dac5ba4a41f5cbd166b906068adf8fd501f2fbc5c2e26d1f0
BLAKE2b-256 checksum
How to use checksums
7d2948ba200cd6652d0e317be7f4a3af0ed09f137671d24a9448f9b35406b0cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / zoll_lint-0.2.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL zoll_lint-0.2.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 8.8 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
b0405cc2e0f1ce73a28d9f3cc16cd5b0fc1b4f2fb02c5ecd0b4b341ab9ec63bc
BLAKE2b-256 checksum
How to use checksums
03190df45d0cda7d289cafecb6a297851661129b338400bea67d0b8a5f649e8d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / zoll_lint-0.2.0-py3-none-macosx_11_0_arm64.whl

Download URL zoll_lint-0.2.0-py3-none-macosx_11_0_arm64.whl
Size 9.2 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
c810688035df00512bb450625842d36040838928af8e855d9cc3bf613a0d23e0
BLAKE2b-256 checksum
How to use checksums
4981f81d0bfc4a4b9b1a3d9ed24311018e35ae178a39226ccb0b8adc6c5c3cb5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / zoll_lint-0.2.0-py3-none-macosx_10_12_x86_64.whl

Download URL zoll_lint-0.2.0-py3-none-macosx_10_12_x86_64.whl
Size 8.9 MB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
8ce9f5f6cd7baacfd692fcbc75ff5d52d45ae3d0132972ab3030c8b666863d3a
BLAKE2b-256 checksum
How to use checksums
c52754da26ce5e13a2041a05d77c89406d314fff2b9baf4331fe6b6708baaaeb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for zoll-lint 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

6 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page