Entropy Analysis for Executable Layers

Imposed rule: Entropy evidence must be included in scan exports and DSSE attestations; opaque regions without provenance cannot be whitelisted without an explicit policy waiver. Status: Partially implemented; target-state sections are retained below (verified 2026-07-19) Owners: Scanner Guild · Policy Guild · UI Guild · Docs Guild

Current implementation boundary (2026-07-19)

1. Overview

Entropy analysis highlights opaque regions inside container layers (packed binaries, stripped blobs, embedded firmware) so Stella Ops can prioritise artefacts that are hard to audit. The scanner computes per-file entropy metrics, reports opaque ratios per layer, and feeds penalties into the trust algebra.

2. Scanner pipeline (SCAN-ENTROPY-186-011/012)

All JSON output is canonical (sorted keys, UTF-8) and included in DSSE attestations/replay bundles.

3. JSON Schemas

3.1 entropy.report.json

{
  "schema": "stellaops.entropy/report@1",
  "generatedAt": "2025-11-26T12:00:00Z",
  "imageDigest": "sha256:…",
  "layerDigest": "sha256:…",
  "files": [
    {
      "path": "/opt/app/libblob.so",
      "size": 5242880,
      "opaqueBytes": 1342177,
      "opaqueRatio": 0.25,
      "flags": ["stripped", "section:.UPX0"],
      "windows": [
        { "offset": 0, "length": 4096, "entropy": 7.45 },
        { "offset": 1024, "length": 4096, "entropy": 7.38 }
      ]
    }
  ]
}

3.2 layer_summary.json

{
  "schema": "stellaops.entropy/layer-summary@1",
  "generatedAt": "2025-11-26T12:00:00Z",
  "imageDigest": "sha256:…",
  "layers": [
    {
      "digest": "sha256:layer4…",
      "opaqueBytes": 2306867,
      "totalBytes": 10485760,
      "opaqueRatio": 0.22,
      "indicators": ["packed", "no-symbols"]
    }
  ],
  "imageOpaqueRatio": 0.18,
  "entropyPenalty": 0.12
}

4. Policy integration (POLICY-RISK-90-001)

5. UI experience (UI-ENTROPY-40-001/002)

6. CLI / API hooks

7. Trust algebra

The penalty is computed as:

[ \text{entropyPenalty} = \min\Bigg(0.3,; K \sum_{\text{layers}} \big( \frac{\text{opaqueBytes}}{\text{totalBytes}} \times \frac{\text{layerBytes}}{\text{imageBytes}} \big)\Bigg) ]

8. Implementation checklist

AreaTask IDNotes
Scanner analysisSCAN-ENTROPY-186-011Sliding window entropy & heuristics
Evidence outputSCAN-ENTROPY-186-012JSON reports + DSSE
Policy integrationPOLICY-RISK-90-001Trust weight + explanations
UIUI-ENTROPY-40-001/002Visualisation & messaging
DocsDOCS-ENTROPY-70-004(this guide)

Update this document as thresholds change or additional packer signatures are introduced.