Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Provenance build-step analysis

Open
#10 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
go

Research direction

No source files or tests are named. Start by locating the image inspection entry points and determining how provenance attestations, sourcemaps, LLB, and image config history are represented; done would require an agreed design for build-step lookup and source mapping, including the proposed Image, BuildStepIdentifier, and BuildStep concepts.

Written by the indexing model from the issue text.

Description

We can use the new SLSA provenance attestations to extract source information from an image.

Example use cases:

  • Provide a more accurate image history view (e.g. on hub)

We should provide a way to lookup build step identifiers (e.g. sha256 digests, diffids, stage numbers, etc) in the sourcemap and return the LLB used to build it, as well as the source-mapping for the original component - I think it should be valid to allow a flexible lookup using different types of identifiers for this?

If SLSA provenance isn't available, we should provide fallbacks using the image config history - we can't reconstruct the LLB, but we can some guesses as to the original source code and build-steps using the layers - though this is definitely outside the initial scope.

For example, a struct might look something like this:

type Image struct {
    // ...
    BuildSteps []BuildStep
}

// GetBuildStep is a helper utility to get a BuildStep using a BuildStepIdentifier, could be an interface or similar that could be the sha256 digest of the layer, the DiffID for that layer, the stage name for that layer, etc.
func (img Image) GetBuildStep(id BuildStepIdentifier) BuildStep { ... }

type BuildStep struct {
    Digest digest.Digest
    DiffID digest.Digest
    Stage string  // e.g. stage0

    LLB
    Source
}

Ideally, if we can, we should represent Source in a VCS-rich way, so not only should it be possible to get the string that represents that snippet, but if we have Git metadata, we can attempt to link it back to source.

Dominant language
Go
Stars
15
Forks
4
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from docker/go-imageinspect

All issues in docker/go-imageinspect

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.