Claude 24f816b6a3
Consolidate 22 sibling repos into layered organism structure
Place useful parts of the surrounding repos into sica-fondt by layer, per the
body model (Ada = membrane; brain/endocrine/capabilities/knowledge non-Ada):

- brain/        LLM reasoning + providers (dapr, hermes, MoMoA)
- capabilities/ REPRAG sidecars: hermes tools/skills, dapr tools, parallel
                dispatch, A51 channels, and the OSINT cluster
- knowledge/    LORAG corpus: 754 cyber-skills, agency personas, secure-coding,
                MITRE ATT&CK data
- reference/    defensive threat-reference (C3, shhbruh doc) + AdaYaml parser

License handling: AGPL sources (worldosint, advanced_evolution, mercury,
Reticulum) and GPL DeTTECT are SPEC-only clean-room/port descriptions — no
copyleft code copied. MIT/Apache/data parts copied as working trees.

Safety: shhbruh escape/persistence material and C3 covert-C2 kept as reference
only, not wired into the running organism. See CONSOLIDATION.md.

https://claude.ai/code/session_01UehUqEXXJJCsHoA4voCU5c
2026-06-10 06:53:01 +00:00

83 lines
2.0 KiB
Markdown

# API Reference: Detecting Container Drift at Runtime
## Docker SDK for Python
```python
import docker
client = docker.from_env()
# List running containers
containers = client.containers.list()
# Get container details
container = client.containers.get("container_id")
container.attrs # full inspection dict
container.image.id # image SHA256
container.image.tags # ['app:v1.0']
# Filesystem diff (vs original image)
diff = container.diff()
# Returns: [{"Path": "/tmp/new_file", "Kind": 1}]
# Kind: 0=Modified, 1=Added, 2=Deleted
# Container inspection fields
container.attrs["HostConfig"]["Privileged"] # bool
container.attrs["HostConfig"]["ReadonlyRootfs"] # bool
container.attrs["Config"]["Image"] # image reference
```
## Docker CLI Commands
```bash
# Filesystem changes since creation
docker diff <container> # A=Added, C=Changed, D=Deleted
# Running processes
docker top <container> -eo pid,user,comm,args
# Image digest verification
docker inspect --format='{{.Image}}' <container>
```
## Falco Drift Detection Rules
```yaml
# Detect binary not in original image
condition: spawned_process and container and proc.is_exe_upper_layer = true
# Detect package manager usage
condition: spawned_process and container and proc.name in (apt, yum, pip, npm)
# Detect shell spawn
condition: spawned_process and container and proc.name in (bash, sh, dash)
```
## Kubernetes Security Context
```yaml
securityContext:
readOnlyRootFilesystem: true # prevent drift
allowPrivilegeEscalation: false
runAsNonRoot: true
capabilities:
drop: ["ALL"]
```
## Drift Severity Classification
| Indicator | Severity |
|-----------|----------|
| Privileged container | CRITICAL |
| Sensitive file modified (/etc/shadow) | CRITICAL |
| Binary added to system path | HIGH |
| Package manager executed | HIGH |
| Root shell active | MEDIUM |
| Mutable root filesystem | MEDIUM |
## CLI Usage
```bash
python agent.py --container my-app-container
python agent.py --container abc123 --all
```