# Audit container image SBOMs by digest before deploy

URL: https://docs.hanzo.ai/docs/guides/cyber/container-sbom-audit

> Retrieve complete Software Bill of Materials (SBOM) manifests for container images by digest or tag via GET /v1/sbom/{ref} before cluster promotion.

**Never promote a container image whose dependency tree you cannot enumerate.** `GET /v1/sbom/{ref}` inspects every package inside an OCI image addressed by immutable SHA-256 digest.

## Architecture & contract

Address images by digest (`registry/repo@sha256:...`) rather than mutable `:latest` tags so the SBOM you audit in CI is byte-identical to the image Kubernetes pulls.

**Primary endpoint:** `GET /v1/sbom/{ref}` · \*_Status:_\* `shipped` · \*_Level:_\* `practitioner`

## Run it across all four surfaces

**CLI**

```bash
# Check SBOM service health and query an image manifest
curl -s https://api.hanzo.ai/v1/sbom/health -H "Authorization: Bearer $HANZO_API_KEY" | jq '.'
```

**SDK**

**TypeScript**

```ts
const res = await fetch('https://api.hanzo.ai/v1/sbom/ghcr.io/hanzoai/cloud:latest', {
  headers: { Authorization: `Bearer ${process.env.HANZO_API_KEY}` },
});
console.log(await res.json());
```

**Python**

```python
import os, requests

r = requests.get(
    "https://api.hanzo.ai/v1/sbom/ghcr.io/hanzoai/cloud:latest",
    headers={"Authorization": f"Bearer {os.environ['HANZO_API_KEY']}"},
)
print(r.json())
```

**HTTP**

```bash
curl -s https://api.hanzo.ai/v1/sbom/health \
  -H "Authorization: Bearer $HANZO_API_KEY" | jq '.'

curl -s "https://api.hanzo.ai/v1/sbom/ghcr.io/hanzoai/cloud:latest" \
  -H "Authorization: Bearer $HANZO_API_KEY" | jq '.'
```

**MCP**

```bash
curl -s -X POST https://api.hanzo.ai/v1/mcp \
  -H "Authorization: Bearer $HANZO_API_KEY" -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "trust",
      "arguments": {"op": "get_trust_controls", "input": {}}
    }
  }'
```

## Verify the outcome

- Assert every deployed production image carries an archived SBOM artifact linked to its exact digest.

## Production guardrails

- Reject floating cluster tags in GitOps manifests; pin every image by `@sha256:...`.

## Next steps & Hanzo University

- [Security Assessments](https://docs.hanzo.ai/docs/cybersecurity/assessments)

- **[CYB 201 — Agentic Cybersecurity](https://hanzo.university/agentic-cybersecurity)** ([Launch interactive lab on hanzo.app/learn](https://hanzo.app/learn/agentic-cybersecurity))
