Home / Market / oci image platform audit

oci image platform audit

Audit local OCI Image Layout v1.1.1 directories offline for index/manifest media types, blob digests and sizes, platform vs. config OS/arch/variant alignment, and non-image artifacts.

skill★ 508920 dlgithubCC-BY-4.0 content; MIT code; upstream exceptions applyInstall in CosmosUpstream Source

Documentation & Preview

--- name: oci-image-platform-audit description: "Audit local OCI Image Layout v1.1.1 directories offline for index/manifest media types, blob digests and sizes, platform vs. config OS/arch/variant alignment, and non-image artifacts." category: devops risk: safe source: self source_type: self date_added: "2026-12-01" author: Koushik-Katkam tags: [oci, container-image, multi-arch, platform, digest, audit]

---

OCI Image Platform Audit

Overview

Inspect local OCI Image Layout v1.1.1 directories strictly offline without starting a Docker daemon, pulling from remote registries, extracting filesystem layer tarballs, or executing containers. Verifies oci-layout, index.json, media types, sha256 blob existence and byte sizes, platform descriptor vs. image config os/architecture/variant alignment, duplicate/ambiguous platform entries, and non-image artifact descriptors.

Distinction from existing container and gateway skills:

When to Use

Prerequisites

How It Works

1. Validate OCI layout containment and index structure

  1. Read oci-layout ({"imageLayoutVersion": "1.0.0"}) and index.json strictly as regular, layout-contained JSON objects (rejecting symlinks, junctions, non-regular files, and path escapes outside the layout root) using a single bounded read (4 MiB limit enforced at the read boundary); malformed JSON, non-object documents (e.g., JSON arrays), unsafe metadata paths, or missing required files classify as INVALID_INPUT.
  2. Enforce strict sha256:<64-lowercase-hex> digest format (UNSUPPORTED for non-sha256 algorithms), non-negative integer descriptor size (rejecting booleans/strings/negatives), and regular-file layout containment ensuring blobs, blobs/sha256, and target blob files remain non-symlink regular files strictly inside the layout root.
  3. Validate index.json mediaType (application/vnd.oci.image.index.v1+json when present) and schemaVersion: 2. Nested OCI indexes (application/vnd.oci.image.index.v1+json inside index.manifests) are explicitly marked UNSUPPORTED.

2. Audit image manifests, blobs, and platform alignment

Run the local suite in OCI platform audit harness:

  1. Blob existence, byte size, and SHA-256 digest: Verify every referenced manifest, config, and layer blob exists inside blobs/sha256/ as a contained regular file, stays within its declared read-boundary byte limit (4 MiB for JSON metadata, 64 MiB bounded streaming read for layers and artifact payloads), matches descriptor.size, and hashes to the declared sha256 digest.
  2. Verified image manifests vs. non-image artifacts: Inspect manifest.mediaType, config.mediaType (application/vnd.oci.empty.v1+json or custom artifactType), and platform (unknown/unknown Buildx attestation pattern) after verifying the artifact manifest's referenced config (when present) and layers blobs, so valid non-image descriptors are classified cleanly as non_image_artifacts without failing image config-arch checks, while missing or corrupted artifact blobs fail the audit.
  3. Platform vs. config cross-check: For runnable image manifests (application/vnd.oci.image.manifest.v1+json + application/vnd.oci.image.config.v1+json), assert descriptor.platform.os == config.os, descriptor.platform.architecture == config.architecture, and descriptor.platform.variant == config.variant when variant is present. Missing optional platform on an index image descriptor fails strict multi-arch selection audit (MISSING_INDEX_PLATFORM).
  4. Duplicate/ambiguous platform detection: Flag two or more runnable descriptors sharing the same (os, architecture, variant) tuple as AMBIGUOUS_PLATFORM (FAIL).

3. Preserve integrity vs. authenticity boundary

State explicitly in every audit report that matching sha256 digests verify internal content integrity against the local index only — digest verification never proves publisher authenticity, build provenance, cryptographic signature trust, or runnable container execution.

Examples

Run the self-contained verification suite in OCI platform audit harness:

User request: "Check our exported multi-arch OCI directory before pushing to ECR."
Inputs: Local OCI Image Layout v1.1.1 directory containing linux/amd64, linux/arm64, and an SBOM artifact descriptor.
Expected result: PASS for valid matched amd64 + arm64 + non-image artifact layout (with content-integrity-only
  note); FAIL with PLATFORM_CONFIG_MISMATCH if linux/arm64 references an amd64 config, or AMBIGUOUS_PLATFORM
  on duplicate platform descriptors.

Limitations

Safety and Side Effects

Sources and related skills