Skip to content
Back to skills

Oci Image Platform Audit

ASecurity

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.

  • 50,717 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 2, 2026
ai-agentspythonrustgodockerkubernetesgitdevopssecurity

Works with

  • mcp

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned December 2, 2026

npx -y skills add sickn33/agentic-awesome-skills --skill oci-image-platform-audit --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Oci Image Platform Audit?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Oci Image Platform Audit
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/sickn33-oci-image-platform-audit/badge)](https://www.skillsdirectory.com/skills/sickn33-oci-image-platform-audit)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
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:
- `unified-ai-gateway`: verifies a pinned multi-platform MCP server digest using live `docker pull --platform` and container inspection commands rather than auditing raw local OCI Image Layout JSON/blobs.
- `container-scanning` and `container-security-hardening`: focus on vulnerability scanning (Trivy/Grype), Dockerfile hardening, seccomp/AppArmor, and Kubernetes pod security rather than OCI index/config platform consistency.
- `container-registries` and `docker-expert`: manage remote registry auth/retention and Dockerfile builds rather than offline OCI layout verification.

## When to Use

- Auditing multi-arch OCI layouts (`linux/amd64`, `linux/arm64`, `linux/arm/v7`) before pushing images to a registry or signing digests.
- Catching mismatched platform builds (for example, an `index.json` `linux/arm64` descriptor pointing to an `amd64` config JSON).
- Verifying that SBOM/attestation/referrer descriptors (`application/vnd.oci.empty.v1` or `unknown/unknown` platform) are classified explicitly as non-image artifacts without breaking platform selection.
- Do **not** use this skill to pull remote images, mutate registries, unpack rootfs tarballs, or verify cryptographic signatures / publisher identity.

## Prerequisites

- Python `3.10+` with `jsonschema` and `pytest` (tested with Python `3.12.10`, `jsonschema==4.26.0`, `pytest==9.1.1`).
- A synthetic or exported local OCI layout directory (`oci-layout`, `index.json`, `blobs/sha256/*`).
- **No Docker daemon, registry network requests, or container execution required.**

## 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](references/oci-platform-audit-harness.md):

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](references/oci-platform-audit-harness.md):

```text
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

- Verifies OCI layout descriptors, manifests, configs, and layer blob digests/sizes; does **not** extract, decompress, or validate tar entries inside layer blobs or execute binaries under emulation (`binfmt_misc`).
- Only `sha256` digests are hashed locally; `sha512` or unregistered digest algorithms return `UNSUPPORTED`.
- Nested OCI Image Indexes (`application/vnd.oci.image.index.v1+json` inside `index.manifests`) and Docker manifest list v2 (`application/vnd.docker.distribution.manifest.list.v2+json`) manifests are rejected/classified separately (`UNSUPPORTED` / `UNEXPECTED_MANIFEST_MEDIA_TYPE`).
- Index `descriptor.platform` is optional in the OCI specification for single-architecture images, so `MISSING_INDEX_PLATFORM` enforces a stricter multi-arch index policy rather than a universal OCI grammar failure.

## Safety and Side Effects

- Strictly **offline and read-only** over synthetic or local OCI layout directories, enforcing layout-root containment, symlink/junction refusal, and open-handle regular-file (`S_ISREG`) checks across `oci-layout`, `index.json`, and `blobs/sha256/*`, with a `4 MiB` JSON metadata single-bounded-read limit and a `64 MiB` bounded streaming read limit for layer and artifact blobs.
- Never runs `docker pull`, `docker push`, `docker run`, or `tar` extraction against untrusted layers.

## Sources and related skills

- [OCI Image Index Specification v1.1.1](https://github.com/opencontainers/image-spec/blob/v1.1.1/image-index.md)
- [OCI Image Config Specification v1.1.1](https://github.com/opencontainers/image-spec/blob/v1.1.1/config.md)
- Related skills: [unified-ai-gateway](https://github.com/sickn33/agentic-awesome-skills/blob/e4dcf3977b6d1e18a2539f630bd82c2433d283e2/skills/unified-ai-gateway/SKILL.md), [container-scanning](https://github.com/sickn33/agentic-awesome-skills/blob/e4dcf3977b6d1e18a2539f630bd82c2433d283e2/skills/container-scanning/SKILL.md), [container-security-hardening](https://github.com/sickn33/agentic-awesome-skills/blob/e4dcf3977b6d1e18a2539f630bd82c2433d283e2/skills/container-security-hardening/SKILL.md), [docker-expert](https://github.com/sickn33/agentic-awesome-skills/blob/e4dcf3977b6d1e18a2539f630bd82c2433d283e2/skills/docker-expert/SKILL.md).

Files in this skill

  • SKILL.md8.3 KB
  • references/oci-platform-audit-harness.md30.8 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.