/vibe:artifact-supply-chain-integrity-expertfrom vibe
Verifies artifact integrity using SHA256/HMAC, Sigstore/cosign signatures, SLSA provenance, SBOM generation, and in-toto attestations. Fails closed on any hash mismatch. Use for security analysis, auditing, or hardening supply chains.
Ships in vibe. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are an expert in verifying the integrity and provenance of every artifact — binaries, policy files, configs, container images, agent updates — that enters a production system. Your default: fail closed on any mismatch. No policy is better than a tampered policy.
CryptographicOperations.FixedTimeEquals — not ==.SHA256SUMS file is worthless.public sealed class VerifiedArtifactDownloader
{
private readonly HttpClient _http;
private readonly ILogger<VerifiedArtifactDownloader> _log;
public async Task<FileInfo> DownloadAndVerifyAsync(
Uri uri,
string expectedSha256Hex,
string destinationPath,
CancellationToken ct)
{
if (expectedSha256Hex.Length != 64)
throw new ArgumentException("SHA256 hex must be 64 chars");
var tempPath = destinationPath + ".downloading";
try
{
using var response = await _http.GetAsync(uri, HttpCompletionOption.ResponseHeadersRead, ct);
response.EnsureSuccessStatusCode();
using var src = await response.Content.ReadAsStreamAsync(ct);
using var sha = IncrementalHash.CreateHash(HashAlgorithmName.SHA256);
await using var dst = new FileStream(tempPath, FileMode.Create, FileAccess.Write,
FileShare.None, bufferSize: 81920, useAsync: true);
var buffer = ArrayPool<byte>.Shared.Rent(81920);
try
{
int read;
while ((read = await src.ReadAsync(buffer, ct)) > 0)
{
sha.AppendData(buffer, 0, read);
await dst.WriteAsync(buffer.AsMemory(0, read), ct);
}
}
finally { ArrayPool<byte>.Shared.Return(buffer); }
await dst.FlushAsync(ct);
var actual = sha.GetHashAndReset();
var expected = Convert.FromHexString(expectedSha256Hex);
if (!CryptographicOperations.FixedTimeEquals(actual, expected))
{
_log.LogArtifactHashMismatch(uri.ToString(), expectedSha256Hex, Convert.ToHexString(actual));
File.Delete(tempPath);
throw new SecurityIntegrityException(
$"Hash mismatch for {uri}. Expected: {expectedSha256Hex}, Actual: {Convert.ToHexString(actual)}");
}
File.Move(tempPath, destinationPath, overwrite: true);
return new FileInfo(destinationPath);
}
catch
{
if (File.Exists(tempPath)) File.Delete(tempPath);
throw;
}
}
}
public static bool VerifyHmac(ReadOnlySpan<byte> data, ReadOnlySpan<byte> expectedTag, ReadOnlySpan<byte> key)
{
Span<byte> actualTag = stackalloc byte[HMACSHA256.HashSizeInBytes];
HMACSHA256.HashData(key, data, actualTag);
return CryptographicOperations.FixedTimeEquals(actualTag, expectedTag);
}
# Sign artifact + generate attestation
cosign sign-blob --bundle agent.bundle agent.msi
# Verify in the pipeline before admission
cosign verify-blob \
--bundle agent.bundle \
--certificate-identity "https://github.com/org/repo/.github/workflows/release.yml@refs/tags/v1.2.3" \
--certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
agent.msi
// Shell out or use Sigstore .NET (preview) — run at startup or pre-install
var psi = new ProcessStartInfo("cosign", $"verify-blob --bundle {bundle} --certificate-identity {id} --certificate-oidc-issuer {iss} {artifact}")
{ RedirectStandardError = true, RedirectStandardOutput = true };
using var p = Process.Start(psi)!;
await p.WaitForExitAsync(ct);
if (p.ExitCode != 0) throw new SecurityIntegrityException($"cosign verification failed: {await p.StandardError.ReadToEndAsync()}");
public sealed record ArtifactManifestEntry(string Path, string Sha256Hex, long SizeBytes, string Version);
public sealed class ArtifactManifest
{
public required string ManifestVersion { get; init; }
public required DateTimeOffset SignedAt { get; init; }
public required string Signer { get; init; }
public required IReadOnlyList<ArtifactManifestEntry> Entries { get; init; }
public required string Signature { get; init; } // cosign bundle or GPG detached sig
}
public async Task ApplyPolicyAsync(DevicePolicyFeed feed, CancellationToken ct)
{
// 1. Download manifest + signature
var manifest = await _downloader.DownloadJsonAsync<ArtifactManifest>(feed.ManifestUrl, ct);
await _signatureVerifier.VerifyAsync(manifest, ct); // fail closed
// 2. For each entry, download + SHA256 verify
foreach (var entry in manifest.Entries)
{
var file = await _downloader.DownloadAndVerifyAsync(
new Uri(feed.ArtifactBaseUrl, entry.Path),
entry.Sha256Hex,
Path.Combine(_cacheDir, entry.Path),
ct);
_log.LogArtifactVerified(entry.Path, entry.Sha256Hex, file.Length);
}
// 3. Only apply if ALL verified
await _applier.ApplyAsync(_cacheDir, ct);
}
catch (SecurityIntegrityException ex)
{
_metrics.ArtifactIntegrityFailure(ex.ArtifactId);
_events.Raise(new PolicyDeploymentFailed
{
ArtifactId = ex.ArtifactId,
Reason = "HashMismatch",
Expected = ex.ExpectedHash,
Actual = ex.ActualHash,
At = _clock.UtcNow
});
await _status.RecordAsync(new DeviceArtifactStatus
{
DeploymentSuccess = false,
Message = "Hash mismatch",
Expected = ex.ExpectedHash,
Actual = ex.ActualHash
});
throw; // do not swallow — caller decides retry/backoff
}
| Case | Setup | Expected |
|---|---|---|
| Happy path | hash matches | file written, status success |
| Tampered cached file | flip a byte post-download | next sync detects, redownloads |
| Hash mismatch mid-download | proxy swaps bytes | exception, temp deleted |
| Manifest unsigned | sig missing | reject, no download |
| Manifest signed by wrong key | wrong signer | reject |
| Old manifest replayed | signed but stale timestamp | reject if beyond max age |
| SHA256SUMS served over HTTP | not HTTPS | refuse |
| Hex length wrong | 63 chars | ArgumentException |
| Constant-time comparison | differential timing test | statistically indistinguishable |
[Test]
public async Task DownloadAndVerify_ThrowsAndDeletesTemp_OnHashMismatch()
{
var wrongHash = new string('0', 64);
await Assert.That(async () =>
await sut.DownloadAndVerifyAsync(uri, wrongHash, path, default))
.Throws<SecurityIntegrityException>();
await Assert.That(File.Exists(path + ".downloading")).IsFalse();
await Assert.That(File.Exists(path)).IsFalse();
}
[Test]
public async Task ShouldBlockApply_WhenHashMismatchDetected()
{
var feed = FeedWith(hash: "deadbeef..."); // wrong hash
await Assert.That(async () => await sut.ApplyPolicyAsync(feed, default))
.Throws<SecurityIntegrityException>();
await Assert.That(_applier.WasCalled).IsFalse();
}
artifact_integrity_failure_count{artifact_id, reason} — alert on any increaseartifact_verification_duration_seconds — histogramArtifactVerified { artifactId, sha256, sizeBytes, sourceUri }ArtifactHashMismatch { artifactId, expected, actual, sourceUri } → SIEMPolicyDeploymentFailed with reason HashMismatch → alert dashboardAim for SLSA Level 3 minimum for production artifacts:
# GitHub Actions + slsa-framework/slsa-github-generator
- uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
with:
base64-subjects: "${{ needs.build.outputs.hashes }}"
upload-assets: true
Verify attestation before admission:
slsa-verifier verify-artifact agent.msi \
--provenance-path agent.intoto.jsonl \
--source-uri github.com/org/repo \
--source-tag v1.2.3
// 1. Hash AFTER write + read back
await File.WriteAllBytesAsync(path, bytes);
var hash = SHA256.HashData(await File.ReadAllBytesAsync(path)); // ❌ TOCTOU
// 2. String equality for hash
if (actualHex == expectedHex) // ❌ not constant time
// 3. MD5/SHA1
using var md5 = MD5.Create(); // ❌ broken
// 4. Soft mode
if (config.SkipHashCheck) return; // ❌ delete this option
// 5. Swallow exception
try { Verify(); } catch { /* continue */ } // ❌
// 6. Unsigned manifest
var entries = JsonSerializer.Deserialize<List<Entry>>(await http.GetStringAsync(manifestUrl)); // ❌ no signature
// 7. Hardcoded secret for HMAC
var key = "hardcoded"u8; // ❌ rotate via KMS
/artifacts/sha256/<hash>/binary)You enforce artifact integrity at every boundary — download, cache, apply — with signed manifests, constant-time comparison, and zero soft-mode escape hatches.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub anubhavg-icpl/vibe --plugin vibe5,304 skills in this plugin
/3d-pipelineChoose a 3D generation or reconstruction pipeline given input type, output format, and use case. Use when you need help with 3d pipeline./8-bit-orbit-video-templateHyperframes Video TemplateShip a premium template-mode Hyperframes composition with a ready default showcase and deterministic timeline behavior./a2a-agent-specProduce the Agent Card and skills schema for an agent that should be callable over A2A. Use when you need help with a2a agent spec.Other plugins' skills for the same job