Skip to content

Conversation

@dvdksn
Copy link
Contributor

@dvdksn dvdksn commented Nov 27, 2025

@dvdksn dvdksn added the status/do-not-merge Pull requests that are awaiting some event or decision before they can be merged. label Nov 27, 2025
@github-actions github-actions bot added area/build Relates to Dockerfiles or docker build command area/tests labels Nov 27, 2025
@netlify
Copy link

netlify bot commented Nov 27, 2025

Deploy Preview for docsdocker ready!

Name Link
🔨 Latest commit 92feb6f
🔍 Latest deploy log https://app.netlify.com/projects/docsdocker/deploys/696fa07d4e8bb8000874b7d5
😎 Deploy Preview https://deploy-preview-23782--docsdocker.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@dvdksn dvdksn force-pushed the build-input-policy branch from 640026d to b152a76 Compare January 16, 2026 13:38
@github-actions github-actions bot added the area/cli Relates to the CLI client label Jan 16, 2026
@dvdksn dvdksn force-pushed the build-input-policy branch from b152a76 to 1dcccf6 Compare January 20, 2026 13:41
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
@dvdksn dvdksn force-pushed the build-input-policy branch from 1dcccf6 to 7741d9b Compare January 20, 2026 14:57
@dvdksn dvdksn requested a review from tonistiigi January 20, 2026 14:59
@dvdksn dvdksn marked this pull request as ready for review January 20, 2026 14:59
@dvdksn dvdksn force-pushed the build-input-policy branch 2 times, most recently from 9ef9e13 to 04835cd Compare January 20, 2026 15:22
@dvdksn dvdksn changed the title [WIP] build: rego source policies build: rego source policies Jan 20, 2026
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
@dvdksn dvdksn force-pushed the build-input-policy branch from 04835cd to 92feb6f Compare January 20, 2026 15:34

## Prerequisites

Build policies require:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's mark it that build policies are experimental in the current release.

upstream compromises, malicious dependencies, and unauthorized modifications to
your build inputs.

With build policies, you can perform extended verifications on inputs, such as:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

optional: "you can make your project to always perform"


default allow := false

# Allow any local inputs for this build
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mark: "Example local input is local directory path set as build context"

### Ensure signed releases

Require that all dependencies - whether container images or downloaded files -
have valid signatures from trusted parties. Use GPG signatures, Sigstore
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe let's not combine GPG and Sigstore together as it seems they are interchangeable. Sigstore is for attestations and GPG only for Git atm (maybe for HTTP in the future but not implemented atm).

## How policies work

When you build an image, buildx resolves all the inputs your Dockerfile
references: base images from `FROM` instructions, files from `ADD` or `COPY`,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and build contexts.

```

When using Sigstore signatures, additional fields are available under
`input.image.signature` (singular) with details about the signing workflow.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

}
```

#### `input.git.commitChecksum`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is also checksum isAnnotatedTag.


```rego
allow if {
input.git.ref == "v0.12.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is incorrect I think. Ref would be refs/heads/master or refs/tags/v0.12.0 or refs/pull/123/head


## Environment fields

The `input.env` object provides build context information not specific to a
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"build configuration information set by user on invoking the build, not spe"

**Cause:** `policy eval` doesn't fetch sources, so many fields remain
unresolved.

**Solution:** Use actual builds with `--progress=plain` to see complete field
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solution should be to include --field

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/build Relates to Dockerfiles or docker build command area/cli Relates to the CLI client area/tests status/do-not-merge Pull requests that are awaiting some event or decision before they can be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants