Skip to main content

landlockpy

CI CodeQL OpenSSF Scorecard License: 0BSD

Dependency-free Python bindings for the Landlock Linux security module. Landlock lets unprivileged processes sandbox themselves with filesystem, network and IPC restrictions enforced by the kernel. Supports ABI versions 1 through 11 with best-effort degradation on older kernels.

Requires Python 3.10+ and Linux 5.13+ with Landlock enabled in the LSM list.

Install

pip install landlockpy

Usage

from landlockpy import AccessFS, AccessNet, Ruleset

with Ruleset() as ruleset:
    ruleset.allow_path(
        "/usr", AccessFS.READ_FILE | AccessFS.READ_DIR | AccessFS.EXECUTE
    )
    ruleset.allow_port(443, AccessNet.CONNECT_TCP)
    ruleset.restrict()

# everything not granted above is now denied for this thread and its children

landlockpy.supported() reports whether the running kernel has Landlock, and landlockpy.abi_version() returns its ABI version.

Documentation

License: 0BSD.

Metadata

Release files for landlockpy 0.1.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 landlockpy 0.1.0
File Size Uploaded
landlockpy-0.1.0.tar.gz 55.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for landlockpy 0.1.0
File Interpreter ABI Platform
landlockpy-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 65.0 kB

Release files / landlockpy-0.1.0.tar.gz

Download URL landlockpy-0.1.0.tar.gz
Size 55.1 kB
Tags Source
SHA-256 checksum
How to use checksums
473ea0ef843a2b06c553c45f30ba020ad24394ce6db5ea93ca7ee1c240757b0d
BLAKE2b-256 checksum
How to use checksums
2b00b9d66bad975e4c859c4f59670c59a2000a0c8e59a455ca2074f9e185b489
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

Release files / landlockpy-0.1.0-py3-none-any.whl

Download URL landlockpy-0.1.0-py3-none-any.whl
Size 10.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
28f689199bae87ba009c7c59d479feafd12e659da251050f362296e8af746e37
BLAKE2b-256 checksum
How to use checksums
7e1326a3773ee7eeaedc270a773b155f37b5efdc0bd954e8912ced5f7f562658
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 22, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.0

2 release files

0.1.1

2 release files

This release

0.1.0 This release

2 release files

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