kekkai-cli 1.0.4__py3-none-any.whl → 1.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- kekkai/cli.py +693 -14
- kekkai/compliance/__init__.py +68 -0
- kekkai/compliance/hipaa.py +235 -0
- kekkai/compliance/mappings.py +136 -0
- kekkai/compliance/owasp.py +517 -0
- kekkai/compliance/owasp_agentic.py +267 -0
- kekkai/compliance/pci_dss.py +205 -0
- kekkai/compliance/soc2.py +209 -0
- kekkai/dojo.py +91 -14
- kekkai/fix/__init__.py +47 -0
- kekkai/fix/audit.py +278 -0
- kekkai/fix/differ.py +427 -0
- kekkai/fix/engine.py +500 -0
- kekkai/fix/prompts.py +251 -0
- kekkai/output.py +10 -12
- kekkai/report/__init__.py +41 -0
- kekkai/report/compliance_matrix.py +98 -0
- kekkai/report/generator.py +365 -0
- kekkai/report/html.py +69 -0
- kekkai/report/pdf.py +63 -0
- kekkai/scanners/container.py +33 -3
- kekkai/scanners/gitleaks.py +3 -1
- kekkai/scanners/semgrep.py +1 -1
- kekkai/scanners/trivy.py +1 -1
- kekkai/threatflow/model_adapter.py +143 -1
- kekkai_cli-1.1.0.dist-info/METADATA +359 -0
- {kekkai_cli-1.0.4.dist-info → kekkai_cli-1.1.0.dist-info}/RECORD +33 -16
- portal/enterprise/__init__.py +15 -2
- portal/enterprise/licensing.py +88 -22
- portal/web.py +9 -0
- kekkai_cli-1.0.4.dist-info/METADATA +0 -135
- {kekkai_cli-1.0.4.dist-info → kekkai_cli-1.1.0.dist-info}/WHEEL +0 -0
- {kekkai_cli-1.0.4.dist-info → kekkai_cli-1.1.0.dist-info}/entry_points.txt +0 -0
- {kekkai_cli-1.0.4.dist-info → kekkai_cli-1.1.0.dist-info}/top_level.txt +0 -0
|
@@ -396,6 +396,143 @@ class RemoteModelAdapter(ModelAdapter):
|
|
|
396
396
|
)
|
|
397
397
|
|
|
398
398
|
|
|
399
|
+
class OllamaModelAdapter(ModelAdapter):
|
|
400
|
+
"""Adapter for Ollama local LLM server.
|
|
401
|
+
|
|
402
|
+
Ollama provides an easy way to run local models with a simple API.
|
|
403
|
+
Install: curl -fsSL https://ollama.ai/install.sh | sh
|
|
404
|
+
Pull model: ollama pull tinyllama
|
|
405
|
+
"""
|
|
406
|
+
|
|
407
|
+
def __init__(
|
|
408
|
+
self,
|
|
409
|
+
model_name: str = "tinyllama",
|
|
410
|
+
api_base: str | None = None,
|
|
411
|
+
) -> None:
|
|
412
|
+
self._model_name = model_name
|
|
413
|
+
self._api_base = api_base or os.environ.get("OLLAMA_HOST") or "http://localhost:11434"
|
|
414
|
+
|
|
415
|
+
@property
|
|
416
|
+
def name(self) -> str:
|
|
417
|
+
return f"ollama:{self._model_name}"
|
|
418
|
+
|
|
419
|
+
@property
|
|
420
|
+
def is_local(self) -> bool:
|
|
421
|
+
return True # Ollama runs locally
|
|
422
|
+
|
|
423
|
+
def generate(
|
|
424
|
+
self,
|
|
425
|
+
system_prompt: str,
|
|
426
|
+
user_prompt: str,
|
|
427
|
+
config: ModelConfig | None = None,
|
|
428
|
+
) -> ModelResponse:
|
|
429
|
+
"""Generate using Ollama API."""
|
|
430
|
+
import urllib.error
|
|
431
|
+
import urllib.request
|
|
432
|
+
|
|
433
|
+
config = config or ModelConfig()
|
|
434
|
+
start_time = time.time()
|
|
435
|
+
|
|
436
|
+
url = f"{self._api_base.rstrip('/')}/api/chat"
|
|
437
|
+
model = config.model_name or self._model_name
|
|
438
|
+
|
|
439
|
+
data = {
|
|
440
|
+
"model": model,
|
|
441
|
+
"messages": [
|
|
442
|
+
{"role": "system", "content": system_prompt},
|
|
443
|
+
{"role": "user", "content": user_prompt},
|
|
444
|
+
],
|
|
445
|
+
"stream": False,
|
|
446
|
+
"options": {
|
|
447
|
+
"temperature": config.temperature,
|
|
448
|
+
"num_predict": config.max_tokens,
|
|
449
|
+
},
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
headers = {"Content-Type": "application/json"}
|
|
453
|
+
|
|
454
|
+
req = urllib.request.Request( # noqa: S310 # nosec B310
|
|
455
|
+
url,
|
|
456
|
+
data=json.dumps(data).encode("utf-8"),
|
|
457
|
+
headers=headers,
|
|
458
|
+
method="POST",
|
|
459
|
+
)
|
|
460
|
+
|
|
461
|
+
try:
|
|
462
|
+
with urllib.request.urlopen( # noqa: S310 # nosec B310
|
|
463
|
+
req, timeout=config.timeout_seconds
|
|
464
|
+
) as resp:
|
|
465
|
+
response_data: dict[str, Any] = json.loads(resp.read().decode("utf-8"))
|
|
466
|
+
|
|
467
|
+
content = response_data.get("message", {}).get("content", "")
|
|
468
|
+
latency_ms = int((time.time() - start_time) * 1000)
|
|
469
|
+
|
|
470
|
+
# Ollama provides token counts in some responses
|
|
471
|
+
prompt_tokens = response_data.get("prompt_eval_count", 0)
|
|
472
|
+
completion_tokens = response_data.get("eval_count", 0)
|
|
473
|
+
|
|
474
|
+
return ModelResponse(
|
|
475
|
+
content=content,
|
|
476
|
+
model_name=response_data.get("model", model),
|
|
477
|
+
prompt_tokens=prompt_tokens,
|
|
478
|
+
completion_tokens=completion_tokens,
|
|
479
|
+
total_tokens=prompt_tokens + completion_tokens,
|
|
480
|
+
latency_ms=latency_ms,
|
|
481
|
+
raw_response=response_data,
|
|
482
|
+
)
|
|
483
|
+
except urllib.error.URLError as e:
|
|
484
|
+
error_msg = str(e)
|
|
485
|
+
if "Connection refused" in error_msg:
|
|
486
|
+
logger.error("Ollama not running. Start with: ollama serve")
|
|
487
|
+
return ModelResponse(
|
|
488
|
+
content="[OLLAMA NOT RUNNING - Start with: ollama serve]",
|
|
489
|
+
model_name=model,
|
|
490
|
+
latency_ms=int((time.time() - start_time) * 1000),
|
|
491
|
+
)
|
|
492
|
+
logger.error("Ollama API error: %s", e)
|
|
493
|
+
return ModelResponse(
|
|
494
|
+
content="",
|
|
495
|
+
model_name=model,
|
|
496
|
+
latency_ms=int((time.time() - start_time) * 1000),
|
|
497
|
+
)
|
|
498
|
+
except Exception as e:
|
|
499
|
+
logger.error("Ollama request failed: %s", e)
|
|
500
|
+
return ModelResponse(
|
|
501
|
+
content="",
|
|
502
|
+
model_name=model,
|
|
503
|
+
latency_ms=int((time.time() - start_time) * 1000),
|
|
504
|
+
)
|
|
505
|
+
|
|
506
|
+
def health_check(self) -> bool:
|
|
507
|
+
"""Check if Ollama is running and model is available."""
|
|
508
|
+
import urllib.request
|
|
509
|
+
|
|
510
|
+
try:
|
|
511
|
+
url = f"{self._api_base.rstrip('/')}/api/tags"
|
|
512
|
+
req = urllib.request.Request(url, method="GET") # noqa: S310 # nosec B310
|
|
513
|
+
with urllib.request.urlopen(req, timeout=5) as resp: # noqa: S310 # nosec B310
|
|
514
|
+
data: dict[str, list[dict[str, str]]] = json.loads(resp.read().decode())
|
|
515
|
+
models = [m.get("name", "") for m in data.get("models", [])]
|
|
516
|
+
# Check if our model is available (with or without :latest tag)
|
|
517
|
+
model_base = self._model_name.split(":")[0]
|
|
518
|
+
return any(model_base in m for m in models)
|
|
519
|
+
except Exception:
|
|
520
|
+
return False
|
|
521
|
+
|
|
522
|
+
def list_models(self) -> list[str]:
|
|
523
|
+
"""List available models in Ollama."""
|
|
524
|
+
import urllib.request
|
|
525
|
+
|
|
526
|
+
try:
|
|
527
|
+
url = f"{self._api_base.rstrip('/')}/api/tags"
|
|
528
|
+
req = urllib.request.Request(url, method="GET") # noqa: S310 # nosec B310
|
|
529
|
+
with urllib.request.urlopen(req, timeout=5) as resp: # noqa: S310 # nosec B310
|
|
530
|
+
data: dict[str, list[dict[str, str]]] = json.loads(resp.read().decode())
|
|
531
|
+
return [m.get("name", "") for m in data.get("models", [])]
|
|
532
|
+
except Exception:
|
|
533
|
+
return []
|
|
534
|
+
|
|
535
|
+
|
|
399
536
|
class MockModelAdapter(ModelAdapter):
|
|
400
537
|
"""Mock adapter for testing."""
|
|
401
538
|
|
|
@@ -461,7 +598,7 @@ def create_adapter(
|
|
|
461
598
|
"""Create a model adapter based on mode.
|
|
462
599
|
|
|
463
600
|
Args:
|
|
464
|
-
mode: "local", "openai", "anthropic", or "mock"
|
|
601
|
+
mode: "local", "ollama", "openai", "anthropic", or "mock"
|
|
465
602
|
config: Configuration for the adapter
|
|
466
603
|
|
|
467
604
|
Returns:
|
|
@@ -473,6 +610,11 @@ def create_adapter(
|
|
|
473
610
|
return MockModelAdapter()
|
|
474
611
|
elif mode == "local":
|
|
475
612
|
return LocalModelAdapter(model_path=config.model_path)
|
|
613
|
+
elif mode == "ollama":
|
|
614
|
+
return OllamaModelAdapter(
|
|
615
|
+
model_name=config.model_name or "tinyllama",
|
|
616
|
+
api_base=config.api_base,
|
|
617
|
+
)
|
|
476
618
|
elif mode == "openai":
|
|
477
619
|
return RemoteModelAdapter(
|
|
478
620
|
api_key=config.api_key,
|
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: kekkai-cli
|
|
3
|
+
Version: 1.1.0
|
|
4
|
+
Summary: Kekkai monorepo (local-first AppSec orchestration + compliance checker)
|
|
5
|
+
Requires-Python: >=3.12
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
Requires-Dist: rich>=13.0.0
|
|
8
|
+
Requires-Dist: jsonschema>=4.20.0
|
|
9
|
+
Requires-Dist: textual>=0.50.0
|
|
10
|
+
Requires-Dist: httpx>=0.24.0
|
|
11
|
+
|
|
12
|
+
<p align="center">
|
|
13
|
+
<img src="https://raw.githubusercontent.com/kademoslabs/assets/main/logos/kekkai-slim.png" alt="Kekkai CLI Logo" width="250"/>
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
<p align="center"><strong>Security orchestration at developer speed.</strong></p>
|
|
17
|
+
<p align="center"><i>One tool for the entire AppSec lifecycle: Predict, Detect, Triage, Manage.</i></p>
|
|
18
|
+
|
|
19
|
+
<p align="center">
|
|
20
|
+
<img src="https://img.shields.io/github/actions/workflow/status/kademoslabs/kekkai/docker-publish.yml?logo=github"/>
|
|
21
|
+
<img src="https://img.shields.io/circleci/build/github/kademoslabs/kekkai?logo=circleci"/>
|
|
22
|
+
<img src="https://img.shields.io/pypi/v/kekkai-cli?pypiBaseUrl=https%3A%2F%2Fpypi.org&logo=pypi"/>
|
|
23
|
+
</p>
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
# Kekkai
|
|
28
|
+
|
|
29
|
+
Stop juggling security tools. **Kekkai orchestrates your entire AppSec lifecycle** — from AI-powered threat modeling to vulnerability management — in a single CLI.
|
|
30
|
+
|
|
31
|
+

|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## The Five Pillars
|
|
36
|
+
|
|
37
|
+
| Pillar | Feature | Command | Description |
|
|
38
|
+
|--------|---------|---------|-------------|
|
|
39
|
+
| 🔮 **Predict** | AI Threat Modeling | `kekkai threatflow` | Generate STRIDE threat models before writing code |
|
|
40
|
+
| 🔍 **Detect** | Unified Scanning | `kekkai scan` | Run Trivy, Semgrep, Gitleaks in isolated containers |
|
|
41
|
+
| ✅ **Triage** | Interactive Review | `kekkai triage` | Review findings in a terminal UI, mark false positives |
|
|
42
|
+
| 🚦 **Gate** | CI/CD Policy | `kekkai scan --ci` | Break builds on severity thresholds |
|
|
43
|
+
| 📊 **Manage** | DefectDojo | `kekkai dojo up` | Spin up vulnerability management in 60 seconds |
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Quick Start (60 Seconds)
|
|
48
|
+
|
|
49
|
+
### 1. Install
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
pipx install kekkai-cli
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### 2. Predict (Threat Model)
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
kekkai threatflow --repo . --model-mode local
|
|
59
|
+
# Generates THREATS.md with STRIDE analysis and Data Flow Diagram
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### 3. Detect (Scan)
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
kekkai scan
|
|
66
|
+
# Runs Trivy (CVEs), Semgrep (code), Gitleaks (secrets)
|
|
67
|
+
# Outputs unified kekkai-report.json
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### 4. Triage (Review)
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
kekkai triage
|
|
74
|
+
# Interactive TUI to accept, reject, or ignore findings
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### 5. Manage (DefectDojo)
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
kekkai dojo up --wait
|
|
81
|
+
kekkai upload
|
|
82
|
+
# Full vulnerability management platform + automated import
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Why Kekkai?
|
|
88
|
+
|
|
89
|
+
| Capability | Manual Approach | Kekkai |
|
|
90
|
+
|------------|-----------------|--------|
|
|
91
|
+
| **Tooling** | Install/update 5+ tools individually | One binary, auto-pulls scanner containers |
|
|
92
|
+
| **Output** | Parse 5 different JSON formats | Unified `kekkai-report.json` |
|
|
93
|
+
| **Threat Modeling** | Expensive consultants or whiteboarding | AI-generated `THREATS.md` locally |
|
|
94
|
+
| **DefectDojo** | 200-line docker-compose + debugging | `kekkai dojo up` (one command) |
|
|
95
|
+
| **Triage** | Read JSON files manually | Interactive terminal UI |
|
|
96
|
+
| **CI/CD** | Complex bash scripts | `kekkai scan --ci --fail-on high` |
|
|
97
|
+
| **PR Feedback** | Manual security review comments | Auto-comments on GitHub PRs |
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Feature Deep Dives
|
|
102
|
+
|
|
103
|
+
### 🔮 ThreatFlow — AI-Powered Threat Modeling
|
|
104
|
+
|
|
105
|
+
Generate STRIDE-aligned threat models and Mermaid.js Data Flow Diagrams from your codebase.
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
# Ollama (recommended - easy setup, privacy-preserving)
|
|
109
|
+
ollama pull mistral
|
|
110
|
+
kekkai threatflow --repo . --model-mode ollama --model-name mistral
|
|
111
|
+
|
|
112
|
+
# Local GGUF model (requires llama-cpp-python)
|
|
113
|
+
kekkai threatflow --repo . --model-mode local --model-path ./mistral-7b.gguf
|
|
114
|
+
|
|
115
|
+
# Remote API (faster, requires API key)
|
|
116
|
+
export KEKKAI_THREATFLOW_API_KEY="sk-..."
|
|
117
|
+
kekkai threatflow --repo . --model-mode openai
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
**Output:** `THREATS.md` containing:
|
|
121
|
+
- Attack surface analysis
|
|
122
|
+
- STRIDE threat classification
|
|
123
|
+
- Mermaid.js architecture diagram
|
|
124
|
+
- Recommended mitigations
|
|
125
|
+
|
|
126
|
+
[Full ThreatFlow Documentation →](docs/threatflow/README.md)
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
### 🔍 Unified Scanning
|
|
131
|
+
|
|
132
|
+
Run industry-standard scanners without installing them individually. Each scanner runs in an isolated Docker container with security hardening.
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
kekkai scan # Scan current directory
|
|
136
|
+
kekkai scan --repo /path/to/project # Scan specific path
|
|
137
|
+
kekkai scan --output results.json # Custom output path
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
**Scanners Included:**
|
|
141
|
+
| Scanner | Finds | Image |
|
|
142
|
+
|---------|-------|-------|
|
|
143
|
+
| Trivy | CVEs in dependencies | `aquasec/trivy:latest` |
|
|
144
|
+
| Semgrep | Code vulnerabilities | `semgrep/semgrep:latest` |
|
|
145
|
+
| Gitleaks | Hardcoded secrets | `zricethezav/gitleaks:latest` |
|
|
146
|
+
|
|
147
|
+
**Container Security:**
|
|
148
|
+
- Read-only filesystem
|
|
149
|
+
- No network access
|
|
150
|
+
- Memory limited (2GB)
|
|
151
|
+
- No privilege escalation
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
### ✅ Interactive Triage TUI
|
|
156
|
+
|
|
157
|
+
Stop reading JSON. Review security findings in your terminal.
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
kekkai triage
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
**Features:**
|
|
164
|
+
- Navigate findings with keyboard
|
|
165
|
+
- Mark as: Accept, Reject, False Positive, Ignore
|
|
166
|
+
- Filter by severity, scanner, or status
|
|
167
|
+
- Persist decisions in `.kekkai-ignore`
|
|
168
|
+
- Export triaged results
|
|
169
|
+
|
|
170
|
+
<!-- Screenshot placeholder:  -->
|
|
171
|
+
|
|
172
|
+
[Full Triage Documentation →](docs/triage/README.md)
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
### 🚦 CI/CD Policy Gate
|
|
177
|
+
|
|
178
|
+
Automate security enforcement in your pipelines.
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
# Fail on any critical or high findings
|
|
182
|
+
kekkai scan --ci --fail-on high
|
|
183
|
+
|
|
184
|
+
# Fail only on critical
|
|
185
|
+
kekkai scan --ci --fail-on critical
|
|
186
|
+
|
|
187
|
+
# Custom threshold: fail on 5+ medium findings
|
|
188
|
+
kekkai scan --ci --fail-on medium --max-findings 5
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
**Exit Codes:**
|
|
192
|
+
| Code | Meaning |
|
|
193
|
+
|------|---------|
|
|
194
|
+
| 0 | No findings above threshold |
|
|
195
|
+
| 1 | Findings exceed threshold |
|
|
196
|
+
| 2 | Scanner error |
|
|
197
|
+
|
|
198
|
+
**GitHub Actions Example:**
|
|
199
|
+
|
|
200
|
+
```yaml
|
|
201
|
+
- name: Security Scan
|
|
202
|
+
run: |
|
|
203
|
+
pipx install kekkai-cli
|
|
204
|
+
kekkai scan --ci --fail-on high
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
[Full CI Documentation →](docs/ci/ci-mode.md)
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
### 📊 DefectDojo Integration
|
|
212
|
+
|
|
213
|
+
Spin up a complete vulnerability management platform locally.
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
kekkai dojo up --wait # Start DefectDojo (Nginx, Postgres, Redis, Celery)
|
|
217
|
+
kekkai dojo status # Check service health
|
|
218
|
+
kekkai upload # Import scan results
|
|
219
|
+
kekkai dojo down # Stop and clean up (removes volumes)
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
**What You Get:**
|
|
223
|
+
- DefectDojo web UI at `http://localhost:8080`
|
|
224
|
+
- Automatic credential generation
|
|
225
|
+
- Pre-configured for Kekkai imports
|
|
226
|
+
- Clean teardown (no orphaned volumes)
|
|
227
|
+
|
|
228
|
+
[Full Dojo Documentation →](docs/dojo/dojo.md)
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
### 🔔 GitHub PR Comments
|
|
233
|
+
|
|
234
|
+
Get security feedback directly in pull requests.
|
|
235
|
+
|
|
236
|
+
```bash
|
|
237
|
+
export GITHUB_TOKEN="ghp_..."
|
|
238
|
+
kekkai scan --github-comment
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
Kekkai will:
|
|
242
|
+
1. Run all scanners
|
|
243
|
+
2. Post findings as PR review comments
|
|
244
|
+
3. Annotate specific lines with inline comments
|
|
245
|
+
|
|
246
|
+
---
|
|
247
|
+
|
|
248
|
+
## Installation
|
|
249
|
+
|
|
250
|
+
### pipx (Recommended)
|
|
251
|
+
|
|
252
|
+
Isolated environment, no conflicts with system Python.
|
|
253
|
+
|
|
254
|
+
```bash
|
|
255
|
+
pipx install kekkai-cli
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
### Homebrew (macOS/Linux)
|
|
259
|
+
|
|
260
|
+
```bash
|
|
261
|
+
brew install kademoslabs/tap/kekkai
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
### Scoop (Windows)
|
|
265
|
+
|
|
266
|
+
```bash
|
|
267
|
+
scoop bucket add kademoslabs https://github.com/kademoslabs/scoop-bucket
|
|
268
|
+
scoop install kekkai
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
### Docker (No Python Required)
|
|
272
|
+
|
|
273
|
+
```bash
|
|
274
|
+
docker pull kademoslabs/kekkai:latest
|
|
275
|
+
alias kekkai='docker run --rm -v "$(pwd):/repo" kademoslabs/kekkai:latest'
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
### pip (Traditional)
|
|
279
|
+
|
|
280
|
+
```bash
|
|
281
|
+
pip install kekkai-cli
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
---
|
|
285
|
+
|
|
286
|
+
## Enterprise Features — Kekkai Portal
|
|
287
|
+
|
|
288
|
+
For teams that need centralized management, **Kekkai Portal** provides:
|
|
289
|
+
|
|
290
|
+
| Feature | Description |
|
|
291
|
+
|---------|-------------|
|
|
292
|
+
| **SAML 2.0 SSO** | Integrate with Okta, Azure AD, Google Workspace ([Setup Guide](docs/portal/saml-setup.md)) |
|
|
293
|
+
| **Role-Based Access Control** | Fine-grained permissions per team/project ([RBAC Guide](docs/portal/rbac.md)) |
|
|
294
|
+
| **Multi-Tenant Architecture** | Isolated environments per organization ([Architecture](docs/portal/multi-tenant.md)) |
|
|
295
|
+
| **Aggregated Dashboards** | Centralized view of all CLI scan results |
|
|
296
|
+
| **Audit Logging** | Cryptographically signed compliance trails |
|
|
297
|
+
|
|
298
|
+
**Upgrade Path:**
|
|
299
|
+
- CLI users can sync results to Portal: `kekkai upload` ([Sync Guide](docs/portal/cli-sync.md))
|
|
300
|
+
- Portal provides dashboards for security managers
|
|
301
|
+
- Self-hosted or Kademos-managed options ([Deployment Guide](docs/portal/deployment.md))
|
|
302
|
+
|
|
303
|
+
[Contact us for Portal access →](mailto:sales@kademos.org)
|
|
304
|
+
|
|
305
|
+
---
|
|
306
|
+
|
|
307
|
+
## Security
|
|
308
|
+
|
|
309
|
+
Kekkai is designed with security as a core principle:
|
|
310
|
+
|
|
311
|
+
- **Container Isolation**: Scanners run in hardened Docker containers
|
|
312
|
+
- **No Network Access**: Containers cannot reach external networks
|
|
313
|
+
- **Local-First AI**: ThreatFlow can run entirely on your machine
|
|
314
|
+
- **SLSA Level 3**: Release artifacts include provenance attestations
|
|
315
|
+
- **Signed Images**: Docker images are Cosign-signed
|
|
316
|
+
|
|
317
|
+
For vulnerability reports, see [SECURITY.md](SECURITY.md).
|
|
318
|
+
|
|
319
|
+
---
|
|
320
|
+
|
|
321
|
+
## Documentation
|
|
322
|
+
|
|
323
|
+
| Guide | Description |
|
|
324
|
+
|-------|-------------|
|
|
325
|
+
| [Installation](docs/README.md#installation-methods) | All installation methods |
|
|
326
|
+
| [ThreatFlow](docs/threatflow/README.md) | AI threat modeling setup |
|
|
327
|
+
| [Dojo Quick Start](docs/dojo/dojo-quickstart.md) | DefectDojo in 5 minutes |
|
|
328
|
+
| [CI Mode](docs/ci/ci-mode.md) | Pipeline integration |
|
|
329
|
+
| [Portal](docs/portal/README.md) | Enterprise features overview |
|
|
330
|
+
| [Portal SSO](docs/portal/saml-setup.md) | SAML 2.0 SSO configuration |
|
|
331
|
+
| [Portal RBAC](docs/portal/rbac.md) | Role-based access control |
|
|
332
|
+
| [Portal Deployment](docs/portal/deployment.md) | Self-hosted deployment |
|
|
333
|
+
| [Security](docs/security/slsa-provenance.md) | SLSA provenance verification |
|
|
334
|
+
|
|
335
|
+
---
|
|
336
|
+
|
|
337
|
+
## CI/CD Status
|
|
338
|
+
|
|
339
|
+
[](https://github.com/kademoslabs/kekkai/actions/workflows/kekkai-pr-scan.yml)
|
|
340
|
+
[](https://github.com/kademoslabs/kekkai/actions/workflows/docker-publish.yml)
|
|
341
|
+
[](https://github.com/kademoslabs/kekkai/actions/workflows/docker-security-scan.yml)
|
|
342
|
+
[](https://github.com/kademoslabs/kekkai/actions/workflows/test-cross-platform.yml)
|
|
343
|
+
[](https://github.com/kademoslabs/kekkai/actions/workflows/release-slsa.yml)
|
|
344
|
+
|
|
345
|
+
---
|
|
346
|
+
|
|
347
|
+
## Contributing
|
|
348
|
+
|
|
349
|
+
We welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
|
350
|
+
|
|
351
|
+
---
|
|
352
|
+
|
|
353
|
+
## License
|
|
354
|
+
|
|
355
|
+
Apache-2.0 — See [LICENSE](LICENSE) for details.
|
|
356
|
+
|
|
357
|
+
---
|
|
358
|
+
|
|
359
|
+
<p align="center"><i>Built by <a href="https://kademos.org">Kademos Labs</a></i></p>
|
|
@@ -1,13 +1,25 @@
|
|
|
1
1
|
kekkai/__init__.py,sha256=_VrBvJRyqHiXs31S8HOhATk_O2iy-ac0_9X7rHH75j8,143
|
|
2
|
-
kekkai/cli.py,sha256=
|
|
2
|
+
kekkai/cli.py,sha256=uCqs5KBqmOjNn9dCkj04H3Vq2lixQRsy2R4lCf_TJv8,60141
|
|
3
3
|
kekkai/config.py,sha256=LE7bKsmv5dim5KnZya0V7_LtviNQ1V0pMN_6FyAsMpc,13084
|
|
4
|
-
kekkai/dojo.py,sha256=
|
|
4
|
+
kekkai/dojo.py,sha256=erLdTMOioTyzVhXYW8xgdbU5Ro-KQx1OcTQN7_zemmY,18634
|
|
5
5
|
kekkai/dojo_import.py,sha256=oI-vwpLITA7-U2_MxhaTp_PYfr5HqvcFy3VzKsWA6IY,6911
|
|
6
6
|
kekkai/manifest.py,sha256=Ph5xGDKuVxMW1GVIisRhxUelaiVZQe-W5sZWsq4lHqs,1887
|
|
7
|
-
kekkai/output.py,sha256=
|
|
7
|
+
kekkai/output.py,sha256=R-yyJm6tdD_uTA_8LoD6JHHO518vsQqZc4_jT7mGV-I,5500
|
|
8
8
|
kekkai/paths.py,sha256=EcyG3CEOQFQygowu7O5Mp85dKkXWWvnm1h0j_BetGxY,1190
|
|
9
9
|
kekkai/policy.py,sha256=0XCUH-SbnO1PsM-exjSFHYHRnLkiNa50QfkyPakwNko,9792
|
|
10
10
|
kekkai/runner.py,sha256=MBFUiJ4sSVEGNbJ6cv-8p1WHaHqjio6yWEfr_K4GuTs,2037
|
|
11
|
+
kekkai/compliance/__init__.py,sha256=FLcAb9Jr7AWwoesX8m8DlkZjdziVHWAB7iQLKEa4rmQ,1888
|
|
12
|
+
kekkai/compliance/hipaa.py,sha256=-lWOeV0kZcbz7-5o76vW6VIS73vC3WsniLO7QUw-W7E,8470
|
|
13
|
+
kekkai/compliance/mappings.py,sha256=Ky8lGnqvkHn2WpUFmMNg4bHvmtRSPWGHRbcXe9B54kM,4202
|
|
14
|
+
kekkai/compliance/owasp.py,sha256=E0JxaW_w3abc8kBRz0dJohF1871RQY0k8EoJn1tV_Kk,13606
|
|
15
|
+
kekkai/compliance/owasp_agentic.py,sha256=4GgjkiVOZ54ifg9xa_PBwHIanEDYe8WJDRARQGVd_Eg,8940
|
|
16
|
+
kekkai/compliance/pci_dss.py,sha256=rQIhuO-ArcSUfxBs1O-eohMImaA5Q-kOIZoppJGuDwc,7789
|
|
17
|
+
kekkai/compliance/soc2.py,sha256=Cj6UPSU-G1Wit36sa-zkIgLE5jUSV3u56mYKfz6TT-0,7435
|
|
18
|
+
kekkai/fix/__init__.py,sha256=pjYo-9NACM6uX5K5ridTC6U1ZQ4P-arRd4VHbayHWyY,1305
|
|
19
|
+
kekkai/fix/audit.py,sha256=3kch_5mUsMWRSqkhCADnmsQ0OFBJTpj1EiDl3nMXfI0,8747
|
|
20
|
+
kekkai/fix/differ.py,sha256=RA-zQMdX7f8nK5fq7Blz498TghYEKz0c9leq7_bfBVE,13283
|
|
21
|
+
kekkai/fix/engine.py,sha256=iQEP-MIrGUu95zda-ip9Cjj-O7wmK3UXMDsNByblD8M,16860
|
|
22
|
+
kekkai/fix/prompts.py,sha256=oByag-PrQTwWh1FMTflUNIO9y0hr2cQL0zqLyueHu6s,7965
|
|
11
23
|
kekkai/github/__init__.py,sha256=3EQ7LkRqgQwr5uTt7hNvVXLiKTpzE47woc8lZQjy5cE,386
|
|
12
24
|
kekkai/github/commenter.py,sha256=v19pEctYJvUvA7e-t6eOA5dZaNIt16ocCxC92IUxQeM,5906
|
|
13
25
|
kekkai/github/models.py,sha256=baW5prDEVncKrfC8aLoKjaTpPKYtRzZOBOg4Zje3qug,1340
|
|
@@ -18,13 +30,18 @@ kekkai/installer/extract.py,sha256=r4wYGCZ7zV2lIki5kns7t9bFRV1fahqOral8Jl7LZcQ,5
|
|
|
18
30
|
kekkai/installer/manager.py,sha256=FqHTmHvTc2YkWWISvdS1uW7IZV6bHqyEg33TDb4Ldtc,7881
|
|
19
31
|
kekkai/installer/manifest.py,sha256=oZFquI9pUtgtB4ZXontQND5D7m4WzjjJuybhlePk3k4,5544
|
|
20
32
|
kekkai/installer/verify.py,sha256=ThtWfKnjrdx90_XBJclBGiw4yzTFs5HKoFJ0IyVPsMM,2186
|
|
33
|
+
kekkai/report/__init__.py,sha256=TTjXFMAKSboWTLBiQ_kkarfneHwNY4nsjjXfjtRn5Ag,1036
|
|
34
|
+
kekkai/report/compliance_matrix.py,sha256=WOz7Fr6Hkfl7agY2DKea7Ir0z6PtC2qT0RQgfUy_A_Q,3305
|
|
35
|
+
kekkai/report/generator.py,sha256=E1hMqUm_tB1jFLa6yWQFytukl4w-LIgTQ9gsA1LpCsc,11893
|
|
36
|
+
kekkai/report/html.py,sha256=6VJoyW08qPUWotzA0pDoO3s1Ll8E-2ypA7ldwBD_Pig,2363
|
|
37
|
+
kekkai/report/pdf.py,sha256=zGwfEQo6419MpNz2TeB5sgLG_bsLsok0v6ellCMd0FA,1751
|
|
21
38
|
kekkai/scanners/__init__.py,sha256=uKJqnBgcf47eJlDB3mvHpLsobR6M6N6uO2L0Dor1MaE,1552
|
|
22
39
|
kekkai/scanners/base.py,sha256=uy7HgOaQxNcp6-X1gfXAecSYpKXaEsuVeluf6SwkbwM,2678
|
|
23
|
-
kekkai/scanners/container.py,sha256=
|
|
40
|
+
kekkai/scanners/container.py,sha256=A_qBZkUNVAowWeEQUVn8VPW4obRM8KtOk9rSqX7GQUA,5328
|
|
24
41
|
kekkai/scanners/falco.py,sha256=Y0kjg9QArIZnXw8Q-EEZv8o7iUOehOY3jTKh3AMR1yU,7384
|
|
25
|
-
kekkai/scanners/gitleaks.py,sha256=
|
|
26
|
-
kekkai/scanners/semgrep.py,sha256=
|
|
27
|
-
kekkai/scanners/trivy.py,sha256=
|
|
42
|
+
kekkai/scanners/gitleaks.py,sha256=grm15elwFl9rtPFHImowxUTA72qnR24pqPIBIoujebY,7285
|
|
43
|
+
kekkai/scanners/semgrep.py,sha256=0qE3F6kwfxvd3PsYqXBF2NCqz15IY4f3ZS9i3eQiEDE,6756
|
|
44
|
+
kekkai/scanners/trivy.py,sha256=D8l7BnGc2GUKI2ykr7lTRmRXYM5W1rt0yOWD6CHS05w,7786
|
|
28
45
|
kekkai/scanners/url_policy.py,sha256=0V4ESDd2R1MSyI1bs_WtFZxZpKX33O154qFIrD6uk5U,5209
|
|
29
46
|
kekkai/scanners/zap.py,sha256=64NHzM-GF3oOV4UZ_W9N2v55mz91FPPg_k6hgcwlX1I,10932
|
|
30
47
|
kekkai/scanners/backends/__init__.py,sha256=Rdo17FeCPGTI-1QeKtBSkg4NrW26RnvX9vgzdsxY5fg,372
|
|
@@ -36,7 +53,7 @@ kekkai/threatflow/artifacts.py,sha256=8h3IGk798U4Wkco4x0uKgzUsZCh7VfTOufwrxs7rTT
|
|
|
36
53
|
kekkai/threatflow/chunking.py,sha256=0FNVnaQoU3FEmtjYHVaiLsKBSzHx6Vo4oozVwwWkOHM,9981
|
|
37
54
|
kekkai/threatflow/core.py,sha256=CYLUI38n30zEq3DbUNI_H9mqBwwlPoL7TtFOiiwC3wI,15421
|
|
38
55
|
kekkai/threatflow/mermaid.py,sha256=Brp-x-LUHMRjC7OBh4Vxzlk3NeCcdmWfWXlv7WL1ZdE,11579
|
|
39
|
-
kekkai/threatflow/model_adapter.py,sha256=
|
|
56
|
+
kekkai/threatflow/model_adapter.py,sha256=Vl0wBWvBUxEGTmFghjwpp-N7Zt3qkpUSxrPVjKC5QgA,20647
|
|
40
57
|
kekkai/threatflow/prompts.py,sha256=lgbj7FJ1c3UYj4ofGnlLoRmywYBfdAKY0QEHmIB_JFw,8525
|
|
41
58
|
kekkai/threatflow/redaction.py,sha256=mGUcNQB6YPVKArtMrEYcXCWslgUiCkloiowY9IlZ1iY,7622
|
|
42
59
|
kekkai/threatflow/sanitizer.py,sha256=uQsxYZ5VDXutZoj-WMl7fo5T07uHuQZqgVzoVMoaKec,22688
|
|
@@ -70,10 +87,10 @@ portal/api.py,sha256=4_hQwkUnP8P3EjCdB5Tb7uRcuH3H7M6GxTvwTTmhLv4,4066
|
|
|
70
87
|
portal/auth.py,sha256=4K_Ya9W_2sZl2MF0FNVr9QASjTOKAO3CMdgGUuYbb9s,3102
|
|
71
88
|
portal/tenants.py,sha256=91SOqzjGefcHXodfN8LIHER8boeSB-Jb-WoHPTWI5GI,11394
|
|
72
89
|
portal/uploads.py,sha256=WhosreaTKFYHNKXW9F4jOmB_OwUl1YGtT5DeaXnRMqk,7352
|
|
73
|
-
portal/web.py,sha256=
|
|
74
|
-
portal/enterprise/__init__.py,sha256=
|
|
90
|
+
portal/web.py,sha256=_9td07YYRiuCZZTpTzeKeoZzRBIwCXfWrjA7RBtJ5_8,14495
|
|
91
|
+
portal/enterprise/__init__.py,sha256=V_JYiIaVv46MynUAhXs_w2aWjfY9x_WZ9tjOqUESaeQ,1000
|
|
75
92
|
portal/enterprise/audit.py,sha256=VTm-M4gVKOxcBREqIJBs4r5wyqqqf1eCOsHi3FFiDcI,13772
|
|
76
|
-
portal/enterprise/licensing.py,sha256=
|
|
93
|
+
portal/enterprise/licensing.py,sha256=RSs_gPrJ33a3DDfAQY8VDJj51uXg4av43AgNsaGl-1Q,13775
|
|
77
94
|
portal/enterprise/rbac.py,sha256=vrZoyIVmWM0C90CIgZaprwqhiDbAM-ggNNg36Zu-5lU,8548
|
|
78
95
|
portal/enterprise/saml.py,sha256=TXHBbILI7qMe0ertcFPnuSUSPbJzEeBiHmZzhY9-Ix8,20367
|
|
79
96
|
portal/ops/__init__.py,sha256=ZyEYmFM_4LFWfQfgp9Kh2vqmolSjVKFdk1vX1vkhjqc,1391
|
|
@@ -83,8 +100,8 @@ portal/ops/monitoring.py,sha256=xhLbKjVaob709K4x0dEsOo4lh7Ddm2A4UE2ZmhfmMtI,1790
|
|
|
83
100
|
portal/ops/restore.py,sha256=rgzKoBIilgoPPv5gZhSSBuLKG1skKw5ryoCRR3d7CPQ,17058
|
|
84
101
|
portal/ops/secrets.py,sha256=wu2bUfJGctbGjyuGUgvUc_Y6IH1SCW16dExtqcKu_kg,14338
|
|
85
102
|
portal/ops/upgrade.py,sha256=fXsIXCJYYABdWDECDXkt7F2PidzNtO6Zr-g0Y5PLlVU,20106
|
|
86
|
-
kekkai_cli-1.0.
|
|
87
|
-
kekkai_cli-1.0.
|
|
88
|
-
kekkai_cli-1.0.
|
|
89
|
-
kekkai_cli-1.0.
|
|
90
|
-
kekkai_cli-1.0.
|
|
103
|
+
kekkai_cli-1.1.0.dist-info/METADATA,sha256=-5dvVJg243pTFzu4MPaQQPICRaWzIwZTPXMH0h9hvC0,10828
|
|
104
|
+
kekkai_cli-1.1.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
105
|
+
kekkai_cli-1.1.0.dist-info/entry_points.txt,sha256=WUEX6IISnRcwlQAdhisPfIIV3Us2MYCwtJoyPpLJO44,75
|
|
106
|
+
kekkai_cli-1.1.0.dist-info/top_level.txt,sha256=u0J4T-Rnb0cgs0LfzZAUNt6nx1d5l7wKn8vOuo9FBEY,26
|
|
107
|
+
kekkai_cli-1.1.0.dist-info/RECORD,,
|
portal/enterprise/__init__.py
CHANGED
|
@@ -4,22 +4,34 @@ Provides:
|
|
|
4
4
|
- RBAC (Role-Based Access Control)
|
|
5
5
|
- SAML 2.0 SSO integration
|
|
6
6
|
- Audit logging
|
|
7
|
-
- Enterprise license gating
|
|
7
|
+
- Enterprise license gating (ECDSA asymmetric signing)
|
|
8
8
|
"""
|
|
9
9
|
|
|
10
10
|
from __future__ import annotations
|
|
11
11
|
|
|
12
12
|
from .audit import AuditEvent, AuditEventType, AuditLog
|
|
13
|
-
from .licensing import
|
|
13
|
+
from .licensing import (
|
|
14
|
+
EnterpriseLicense,
|
|
15
|
+
LicenseCheckResult,
|
|
16
|
+
LicenseSigner,
|
|
17
|
+
LicenseStatus,
|
|
18
|
+
LicenseValidator,
|
|
19
|
+
generate_keypair,
|
|
20
|
+
)
|
|
14
21
|
from .rbac import AuthorizationResult, Permission, RBACManager, Role
|
|
15
22
|
from .saml import SAMLAssertion, SAMLConfig, SAMLError, SAMLProcessor
|
|
16
23
|
|
|
24
|
+
ENTERPRISE_AVAILABLE = True
|
|
25
|
+
|
|
17
26
|
__all__ = [
|
|
27
|
+
"ENTERPRISE_AVAILABLE",
|
|
18
28
|
"AuditEvent",
|
|
19
29
|
"AuditEventType",
|
|
20
30
|
"AuditLog",
|
|
21
31
|
"AuthorizationResult",
|
|
22
32
|
"EnterpriseLicense",
|
|
33
|
+
"LicenseCheckResult",
|
|
34
|
+
"LicenseSigner",
|
|
23
35
|
"LicenseStatus",
|
|
24
36
|
"LicenseValidator",
|
|
25
37
|
"Permission",
|
|
@@ -29,4 +41,5 @@ __all__ = [
|
|
|
29
41
|
"SAMLConfig",
|
|
30
42
|
"SAMLError",
|
|
31
43
|
"SAMLProcessor",
|
|
44
|
+
"generate_keypair",
|
|
32
45
|
]
|