Architecture
The package lives under src/kimera/. This page describes what is on disk, from the entry points down to the engine.
Entry points
Section titled “Entry points”exploit_k8s.py— a shim for thekimeracommand that loads environment variables and delegates to the click group incli/.mcp/— the MCP server.server.pydefines the seven tools and the click entry point forkimera-mcp;__main__.pylets the module run withpython -m.banner.py— the startup banner shown by the interactive commands.resources.py— resolves the config and prompt directories, and readsKIMERA_CONFIG_DIR.
Command layer
Section titled “Command layer”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.
Configuration
Section titled “Configuration”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 services
Section titled “Core services”core/ is the service layer the CLI and the MCP server share:
assessor.py— the CIS benchmark scanner behindassess.enumerator.py— the namespace inventory behind the attack-surface tool.technique_registry.py— loads technique YAML intoTechniqueDefinitionobjects.technique_engine.py— runs a technique inexecorapimode and builds a result.api_executor.py— issues the Kubernetes API calls forapi-mode techniques.findings.py— the Pydantic result models (Finding,AssessmentReport,TechniqueResult).enrichment.py— theEnrichmentProviderandQueryProviderprotocols.llm.py— model backend selection and completion.
Engine
Section titled “Engine”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.pyandresource_applier.py— Cilium enforcement management and applying resources from YAML.
Supporting packages
Section titled “Supporting packages”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.
