-
Notifications
You must be signed in to change notification settings - Fork 8.1k
build: rego source policies #23782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
build: rego source policies #23782
Conversation
✅ Deploy Preview for docsdocker ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
640026d to
b152a76
Compare
b152a76 to
1dcccf6
Compare
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
1dcccf6 to
7741d9b
Compare
9ef9e13 to
04835cd
Compare
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
04835cd to
92feb6f
Compare
|
|
||
| ## Prerequisites | ||
|
|
||
| Build policies require: |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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`, |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
| } | ||
| ``` | ||
|
|
||
| #### `input.git.commitChecksum` |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
Description
Buildx support for rego policies for validating build inputs (local, http, git, image).
Preview: https://deploy-preview-23782--docsdocker.netlify.app/build/policies/
Related issues or tickets