This repository has been archived by the owner on Oct 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a new command to audit runAsUser fields (#316)
- Loading branch information
Showing
28 changed files
with
543 additions
and
32 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
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: deployment | ||
namespace: run-as-user-0-allowed | ||
spec: | ||
selector: | ||
matchLabels: | ||
name: deployment | ||
template: | ||
metadata: | ||
labels: | ||
name: deployment | ||
audit.kubernetes.io/pod.allow-run-as-root: "SuperuserPrivilegesNeeded" | ||
spec: | ||
containers: | ||
- name: container | ||
image: scratch | ||
securityContext: | ||
runAsUser: 0 |
20 changes: 20 additions & 0 deletions
20
auditors/nonroot/fixtures/run-as-user-0-run-as-non-root-false.yml
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: deployment | ||
namespace: run-as-user-0-run-as-non-root-false | ||
spec: | ||
selector: | ||
matchLabels: | ||
name: deployment | ||
template: | ||
metadata: | ||
labels: | ||
name: deployment | ||
spec: | ||
containers: | ||
- name: container | ||
image: scratch | ||
securityContext: | ||
runAsUser: 0 | ||
runAsNonRoot: false |
20 changes: 20 additions & 0 deletions
20
auditors/nonroot/fixtures/run-as-user-0-run-as-non-root-true.yml
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: deployment | ||
namespace: run-as-user-0-run-as-non-root-true | ||
spec: | ||
selector: | ||
matchLabels: | ||
name: deployment | ||
template: | ||
metadata: | ||
labels: | ||
name: deployment | ||
spec: | ||
containers: | ||
- name: container | ||
image: scratch | ||
securityContext: | ||
runAsUser: 0 | ||
runAsNonRoot: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: deployment | ||
namespace: run-as-user-0 | ||
spec: | ||
selector: | ||
matchLabels: | ||
name: deployment | ||
template: | ||
metadata: | ||
labels: | ||
name: deployment | ||
spec: | ||
containers: | ||
- name: container | ||
image: scratch | ||
securityContext: | ||
runAsUser: 0 |
20 changes: 20 additions & 0 deletions
20
auditors/nonroot/fixtures/run-as-user-1-run-as-non-root-false.yml
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: deployment | ||
namespace: run-as-user-1-run-as-non-root-false | ||
spec: | ||
selector: | ||
matchLabels: | ||
name: deployment | ||
template: | ||
metadata: | ||
labels: | ||
name: deployment | ||
spec: | ||
containers: | ||
- name: container | ||
image: scratch | ||
securityContext: | ||
runAsUser: 1 | ||
runAsNonRoot: false |
20 changes: 20 additions & 0 deletions
20
auditors/nonroot/fixtures/run-as-user-1-run-as-non-root-true.yml
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: deployment | ||
namespace: run-as-user-1-run-as-non-root-true | ||
spec: | ||
selector: | ||
matchLabels: | ||
name: deployment | ||
template: | ||
metadata: | ||
labels: | ||
name: deployment | ||
spec: | ||
containers: | ||
- name: container | ||
image: scratch | ||
securityContext: | ||
runAsUser: 1 | ||
runAsNonRoot: true |
19 changes: 19 additions & 0 deletions
19
auditors/nonroot/fixtures/run-as-user-psc-0-allowed-multi-containers-multi-labels.yml
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: pod | ||
labels: | ||
name: pod | ||
container.audit.kubernetes.io/container1.allow-run-as-root: "SuperuserPrivilegesNeeded" | ||
container.audit.kubernetes.io/container2.allow-run-as-root: "SuperuserPrivilegesNeeded" | ||
namespace: run-as-user-psc-0-allowed-multi-containers-multi-labels | ||
spec: | ||
securityContext: | ||
runAsUser: 0 | ||
containers: | ||
- name: container1 | ||
image: scratch | ||
- name: container2 | ||
image: scratch | ||
securityContext: | ||
runAsUser: 1 |
20 changes: 20 additions & 0 deletions
20
auditors/nonroot/fixtures/run-as-user-psc-0-allowed-multi-containers-single-label.yml
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: pod | ||
labels: | ||
name: pod | ||
container.audit.kubernetes.io/container2.allow-run-as-root: "SuperuserPrivilegesNeeded" | ||
namespace: run-as-user-psc-0-allowed-multi-containers-single-label | ||
spec: | ||
securityContext: | ||
runAsUser: 0 | ||
containers: | ||
- name: container1 | ||
image: scratch | ||
securityContext: | ||
runAsUser: 1 | ||
- name: container2 | ||
image: scratch | ||
securityContext: | ||
runAsUser: 0 |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: pod | ||
labels: | ||
name: pod | ||
audit.kubernetes.io/pod.allow-run-as-root: "SuperuserPrivilegesNeeded" | ||
namespace: run-as-user-psc-0-allowed | ||
spec: | ||
securityContext: | ||
runAsUser: 0 | ||
containers: | ||
- name: container | ||
image: scratch |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: pod | ||
namespace: run-as-user-psc-0-csc-0 | ||
spec: | ||
securityContext: | ||
runAsUser: 0 | ||
containers: | ||
- name: container | ||
image: scratch | ||
securityContext: | ||
runAsUser: 0 |
17 changes: 17 additions & 0 deletions
17
auditors/nonroot/fixtures/run-as-user-psc-0-csc-1-multiple-cont.yml
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: pod | ||
namespace: run-as-user-psc-0-csc-1-multiple-cont | ||
spec: | ||
securityContext: | ||
runAsUser: 0 | ||
containers: | ||
- name: container1 | ||
image: scratch | ||
securityContext: | ||
runAsUser: 1 | ||
- name: container2 | ||
image: scratch | ||
securityContext: | ||
runAsUser: 1 |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: pod | ||
namespace: run-as-user-psc-0-csc-1 | ||
spec: | ||
securityContext: | ||
runAsUser: 0 | ||
containers: | ||
- name: container | ||
image: scratch | ||
securityContext: | ||
runAsUser: 1 |
15 changes: 15 additions & 0 deletions
15
auditors/nonroot/fixtures/run-as-user-psc-0-csc-nil-multiple-cont.yml
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: pod | ||
namespace: run-as-user-psc-0-csc-nil-multiple-cont | ||
spec: | ||
securityContext: | ||
runAsUser: 0 | ||
containers: | ||
- name: container1 | ||
image: scratch | ||
securityContext: | ||
runAsUser: 1 | ||
- name: container2 | ||
image: scratch |
14 changes: 14 additions & 0 deletions
14
auditors/nonroot/fixtures/run-as-user-psc-0-run-as-non-root-psc-false.yml
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: pod | ||
labels: | ||
name: pod | ||
namespace: run-as-user-psc-0-run-as-non-root-psc-false | ||
spec: | ||
securityContext: | ||
runAsUser: 0 | ||
runAsNonRoot: false | ||
containers: | ||
- name: container | ||
image: scratch |
14 changes: 14 additions & 0 deletions
14
auditors/nonroot/fixtures/run-as-user-psc-0-run-as-non-root-psc-true.yml
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: pod | ||
labels: | ||
name: pod | ||
namespace: run-as-user-psc-0-run-as-non-root-psc-true | ||
spec: | ||
securityContext: | ||
runAsUser: 0 | ||
runAsNonRoot: true | ||
containers: | ||
- name: container | ||
image: scratch |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: pod | ||
labels: | ||
name: pod | ||
namespace: run-as-user-psc-0 | ||
spec: | ||
securityContext: | ||
runAsUser: 0 | ||
containers: | ||
- name: container | ||
image: scratch |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: pod | ||
namespace: run-as-user-psc-1-csc-0 | ||
spec: | ||
securityContext: | ||
runAsUser: 1 | ||
containers: | ||
- name: container | ||
image: scratch | ||
securityContext: | ||
runAsUser: 0 |
14 changes: 14 additions & 0 deletions
14
auditors/nonroot/fixtures/run-as-user-psc-1-run-as-non-root-psc-false.yml
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: pod | ||
labels: | ||
name: pod | ||
namespace: run-as-user-psc-1-run-as-non-root-psc-false | ||
spec: | ||
securityContext: | ||
runAsUser: 1 | ||
runAsNonRoot: false | ||
containers: | ||
- name: container | ||
image: scratch |
Oops, something went wrong.