Skip to content

Commit 2cd96ad

Browse files
authored
Create dockerfile.rego
1 parent acb8510 commit 2cd96ad

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

PaS/dockerfile.rego

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package main
2+
3+
deny[msg] {
4+
input[i].Cmd == "from"
5+
val := input[i].Value
6+
contains(val[_], "latest")
7+
msg = "Do not use the 'latest' tag. Use a specific versioned tag."
8+
}
9+
10+
deny[msg] {
11+
not user_exists
12+
msg = "Dockerfile must specify a non-root user with the USER instruction."
13+
}
14+
15+
user_exists {
16+
input[i].Cmd == "user"
17+
}

0 commit comments

Comments
 (0)