Created
July 7, 2020 18:09
-
-
Save deanwilson/00a2e4db4ece7b6ee3d05f3bd9dda1fe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
deny[msg] { | |
input[i].Cmd == "from" | |
val := input[i].Value | |
image := val[0] | |
trace(image) | |
not re_match(".+@sha256:.{64}$", image) | |
msg = sprintf("FROM commands should use a sha256 hash, not a label %s", [image]) | |
} | |
## Matches the label rules in https://gds-way.cloudapps.digital/manuals/programming-languages/docker.html#using-tags-and-digests-in-from-instructions |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment