Skip to content

Architecture

The package lives under src/kimera/. This page describes what is on disk, from the entry points down to the engine.

  • exploit_k8s.py — a shim for the kimera command that loads environment variables and delegates to the click group in cli/.
  • mcp/ — the MCP server. server.py defines the seven tools and the click entry point for kimera-mcp; __main__.py lets the module run with python -m.
  • banner.py — the startup banner shown by the interactive commands.
  • resources.py — resolves the config and prompt directories, and reads KIMERA_CONFIG_DIR.

cli/ holds one module per command or group: assess.py, exploit.py, enforce.py, generate.py, manage.py, query.py, secure.py, technique.py, validate.py, and prompts.py for confirmation handling. __init__.py defines the shared kimera group and its global options, and registers every command.

application/config/ loads and validates configuration: loader.py merges the sources, schemas.py defines the ToolkitConfig Pydantic models, and registry.py loads the exploit-type registry. The packaged YAML sits under config/: default.yaml, env_mappings.yaml, and the checks/, exploits/, kind/, profiles/ and techniques/ folders.

core/ is the service layer the CLI and the MCP server share:

  • assessor.py — the CIS benchmark scanner behind assess.
  • enumerator.py — the namespace inventory behind the attack-surface tool.
  • technique_registry.py — loads technique YAML into TechniqueDefinition objects.
  • technique_engine.py — runs a technique in exec or api mode and builds a result.
  • api_executor.py — issues the Kubernetes API calls for api-mode techniques.
  • findings.py — the Pydantic result models (Finding, AssessmentReport, TechniqueResult).
  • enrichment.py — the EnrichmentProvider and QueryProvider protocols.
  • llm.py — model backend selection and completion.

container/ holds the implementation the core services call:

  • core/ — the Kubernetes client, operation journal, logger, exceptions, and command helpers.
  • assessment/ — the workload security scanner.
  • make_vulnerable/ — the exploit classes, the probe runner, and the shared shell prelude.
  • validation/ — the control validators for admission, network policy and RBAC, plus the probe and reachability logic.
  • remediations/ — remediation generation, finding scope, and output validation.
  • integrations/dynatrace/ — the Dynatrace enrichment and query providers, their data models, and the query strategies.
  • enforcement.py and resource_applier.py — Cilium enforcement management and applying resources from YAML.

domain/models.py holds the shared validation verdict types. prompts/ holds the Jinja templates and the DQL reference used by LLM-backed commands.

All product names and logos are trademarks of their respective owners, used for identification only. No endorsement is implied.