Skip to content
microsoftPublic

About

The Linux native compliance and hardening engine. CIS, STIG, and custom baselines - audit, remediate, report.

Resources

Code of conduct

Contributing

Security policy

Stars

6 stars

Watchers

1 watching

Forks

Repository files navigation

kompli

License: MIT OpenSSF Scorecard

kompli is a Linux security compliance engine for evaluating and remediating system configuration against industry benchmarks (CIS, STIG, etc.). It is derived from the Azure OSConfig project, with its kompli core in src/engine/, a local CLI and a separate Machine Configuration adapter.

See the glossary for project and interface terminology.

History

This codebase originates from Azure OSConfig — a modular security configuration stack for Linux Edge devices developed by Microsoft, supporting multi-authority device management over Azure IoT Hub and local management. OSConfig consisted of a platform daemon, a PnP/MC adapter layer, and a set of management modules (CommandRunner, SecurityBaseline, DeviceInfo, Networking, Firewall, and others).

kompli focuses on the project core and its execution entry points rather than the original platform's full management stack. The MC (Machine Configuration) adapter, shared utilities, logging, JSON support and optional telemetry support the core.

Structure

src/
├── adapters/mc/complianceengine/   MC adapter for the engine
├── common/
│   ├── commonutils/                Shared C utilities (pruned to CE dependencies)
│   ├── logging/                    Logging library
│   ├── mpiclient/                  MPI client (socket communication)
│   └── parson/                     JSON library
├── engine/                         Core engine, procedures, Lua evaluator
│   └── tests/                      GTest suite
├── benchmarkio/                    Benchmark-definition parsing + input-file security
├── kompli/                         kompli CLI tool
├── tools/lua-evaluator/            Lua evaluator tool
└── telemetry/                      Telemetry library

Getting started

Prerequisites

sudo apt -y update && sudo apt-get -y install \
    build-essential cmake git curl pkg-config tar unzip zip \
    libssl-dev python3
pip3 install pre_commit && python3 -m pre_commit install

cmake >= 3.21 is required. vcpkg is used for additional dependencies (googletest, parson) and is bootstrapped automatically.

A C++11 compiler and standard library with working std::regex support are required; the legacy POSIX regex fallback is no longer provided.

Build

cmake -S src -B build \
    -DCMAKE_BUILD_TYPE=Debug \
    -DBUILD_TELEMETRY=OFF \
    -DBUILD_TESTS=ON
cmake --build build

By default, CMake copies and bootstraps external/vcpkg in build/vcpkg_root. To use a shared copy instead, configure a fresh build directory:

cmake -S src -B build-shared \
    -DVCPKG_ROOT_DIR="$PWD/shared-vcpkg" \
    -DBUILD_TELEMETRY=OFF \
    -DBUILD_TESTS=ON

To build the release artifact only:

cmake -S src -B build \
    -DCMAKE_BUILD_TYPE=Release \
    -DBUILD_TELEMETRY=OFF \
    -DBUILD_TESTS=OFF
cmake --build build --target OsConfigResourceComplianceEngine

The build produces build/adapters/mc/complianceengine/libOsConfigResourceComplianceEngine.so.

Test

cd build && ctest

Configuration

The engine is configured via /etc/kompli/kompli.json:

{
    "LoggingLevel": 6
}

LoggingLevel values: 6 = informational (default), 7 = debug.

Distribution override

To override automatic OS detection (useful for testing), create /etc/kompli/system_id.override:

OS="Linux" ARCH="x86_64" DISTRO="ubuntu" VERSION="24.04"

Contributing

See CONTRIBUTING and SECURITY.

Telemetry

Data Collection. The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

About

The Linux native compliance and hardening engine. CIS, STIG, and custom baselines - audit, remediate, report.

Resources

Code of conduct

Contributing

Security policy

Stars

6 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages