Metadata-Version: 2.5
Name: lsmcheck
Version: 0.1.0
Summary: Linux Security Module introspection
Project-URL: Homepage, https://quad4.io
Project-URL: Repository, https://github.com/Quad4-Software/lsmcheck
Project-URL: Issues, https://github.com/Quad4-Software/lsmcheck/issues
Project-URL: Changelog, https://github.com/Quad4-Software/lsmcheck/blob/master/CHANGELOG.md
Author: Quad4
License-Expression: 0BSD
License-File: LICENSE
Keywords: apparmor,linux,lsm,security,selinux
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Security
Classifier: Topic :: System :: Operating System Kernels :: Linux
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# lsmcheck

[![CI](https://github.com/Quad4-Software/lsmcheck/actions/workflows/ci.yml/badge.svg)](https://github.com/Quad4-Software/lsmcheck/actions/workflows/ci.yml)
[![CodeQL](https://github.com/Quad4-Software/lsmcheck/actions/workflows/codeql.yml/badge.svg)](https://github.com/Quad4-Software/lsmcheck/actions/workflows/codeql.yml)
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/Quad4-Software/lsmcheck/badge)](https://securityscorecards.dev/viewer/?uri=github.com/Quad4-Software/lsmcheck)
[![PyPI](https://img.shields.io/pypi/v/lsmcheck.svg)](https://pypi.org/project/lsmcheck/)
[![License: 0BSD](https://img.shields.io/badge/license-0BSD-blue)](LICENSE)

Linux Security Module introspection from procfs and sysfs only: which
LSMs the kernel runs, the security attributes of a process, and the
state of AppArmor, SELinux, Yama and lockdown. No dependencies, no
shell-outs; every reader degrades to None when the feature is absent.

Requires Python 3.10+ and Linux.

## Install

    pip install lsmcheck

## Example

    import lsmcheck

    print(lsmcheck.active_lsms())          # [LSM.CAPABILITY, LSM.YAMA, ...]
    ctx = lsmcheck.apparmor.current()
    if ctx and ctx.mode == lsmcheck.apparmor.AppArmorMode.ENFORCE:
        print("confined by", ctx.profile)

## Development

    uv sync --group dev
    make check

License: 0BSD. Quad4 Software, https://quad4.io
