forked from plexsystems/konstraint
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
47 changed files
with
192 additions
and
123 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -106,7 +106,7 @@ jobs: | |
|
||
- name: setup regal | ||
uses: styrainc/[email protected] | ||
with: | ||
with | ||
version: 0.31.0 | ||
|
||
- name: regal lint | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
package container_deny_added_caps | ||
|
||
test_dropped_all { | ||
import rego.v1 | ||
|
||
test_dropped_all if { | ||
container_dropped_all_capabilities({"securityContext": {"capabilities": {"drop": ["all"]}}}) | ||
} | ||
|
||
test_dropped_none { | ||
test_dropped_none if { | ||
not container_dropped_all_capabilities({"securityContext": {"capabilities": {"drop": ["none"]}}}) | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
package container_deny_escalation | ||
|
||
test_allowescalation_false { | ||
import rego.v1 | ||
|
||
test_allowescalation_false if { | ||
not container_allows_escalation({"securityContext": {"allowPrivilegeEscalation": false}}) | ||
} | ||
|
||
test_allowescalation_true { | ||
test_allowescalation_true if { | ||
container_allows_escalation({"securityContext": {"allowPrivilegeEscalation": true}}) | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
package container_deny_latest_tag | ||
|
||
test_input_as_image_without_latest_tag { | ||
import rego.v1 | ||
|
||
test_input_as_image_without_latest_tag if { | ||
not has_latest_tag({"name": "test", "image": "image:1.0.0"}) | ||
} | ||
|
||
test_input_as_image_with_latest_tag { | ||
test_input_as_image_with_latest_tag if { | ||
has_latest_tag({"name": "test", "image": "image:latest"}) | ||
} | ||
|
||
test_input_as_image_with_no_tag { | ||
test_input_as_image_with_no_tag if { | ||
has_latest_tag({"name": "test", "image": "image"}) | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
package container_deny_privileged | ||
|
||
test_privileged_true { | ||
import rego.v1 | ||
|
||
test_privileged_true if { | ||
container_is_privileged({"securityContext": {"privileged": true}}) | ||
} | ||
|
||
test_privileged_false { | ||
test_privileged_false if { | ||
not container_is_privileged({"securityContext": {"privileged": false}}) | ||
} | ||
|
||
test_added_capability { | ||
test_added_capability if { | ||
container_is_privileged({"securityContext": {"capabilities": {"add": ["CAP_SYS_ADMIN"]}}}) | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
package container_deny_privileged | ||
|
||
test_privileged_true { | ||
import rego.v1 | ||
|
||
test_privileged_true if { | ||
container_is_privileged({"securityContext": {"privileged": true}}) | ||
} | ||
|
||
test_privileged_false { | ||
test_privileged_false if { | ||
not container_is_privileged({"securityContext": {"privileged": false}}) | ||
} | ||
|
||
test_added_capability { | ||
test_added_capability if { | ||
container_is_privileged({"securityContext": {"capabilities": {"add": ["CAP_SYS_ADMIN"]}}}) | ||
} |
This file contains 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
10 changes: 6 additions & 4 deletions
10
examples/container-deny-without-resource-constraints/src_test.rego
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
package container_warn_no_ro_fs | ||
|
||
test_rofs_true { | ||
import rego.v1 | ||
|
||
test_rofs_true if { | ||
not no_read_only_filesystem({"securityContext": {"readOnlyRootFilesystem": true}}) | ||
} | ||
|
||
test_rofs_false { | ||
test_rofs_false if { | ||
no_read_only_filesystem({"securityContext": {"readOnlyRootFilesystem": false}}) | ||
} |
This file contains 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
This file contains 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
Oops, something went wrong.