-
Notifications
You must be signed in to change notification settings - Fork 18
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
1 parent
7769467
commit 6248fcc
Showing
19 changed files
with
326 additions
and
44 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
23 changes: 23 additions & 0 deletions
23
3-security-context/demo/03-deployment-run-as-user-unprivileged.yaml
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,23 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
run: run-as-user-unprivileged | ||
name: run-as-user-unprivileged | ||
spec: | ||
selector: | ||
matchLabels: | ||
run: run-as-user-unprivileged | ||
strategy: | ||
type: Recreate | ||
template: | ||
metadata: | ||
labels: | ||
run: run-as-user-unprivileged | ||
spec: | ||
containers: | ||
- image: nginxinc/nginx-unprivileged:1.17.2 | ||
name: run-as-user-unprivileged | ||
securityContext: | ||
runAsUser: 100000 | ||
runAsGroup: 100000 |
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: | ||
labels: | ||
run: run-as-user | ||
name: run-as-user | ||
spec: | ||
selector: | ||
matchLabels: | ||
run: run-as-user | ||
template: | ||
metadata: | ||
labels: | ||
run: run-as-user | ||
spec: | ||
containers: | ||
- image: nginx:1.17.2 | ||
name: run-as-user | ||
securityContext: | ||
runAsUser: 100000 | ||
runAsGroup: 100000 |
File renamed without changes.
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: | ||
labels: | ||
run: run-with-seccomp | ||
name: run-with-seccomp | ||
spec: | ||
selector: | ||
matchLabels: | ||
run: run-with-seccomp | ||
template: | ||
metadata: | ||
labels: | ||
run: run-with-seccomp | ||
annotations: | ||
seccomp.security.alpha.kubernetes.io/pod: runtime/default | ||
spec: | ||
containers: | ||
- image: nginx:1.17.2 | ||
name: run-with-seccomp |
22 changes: 22 additions & 0 deletions
22
3-security-context/demo/07-deployment-run-without-caps.yaml
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,22 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
run: run-without-caps | ||
name: run-without-caps | ||
spec: | ||
selector: | ||
matchLabels: | ||
run: run-without-caps | ||
template: | ||
metadata: | ||
labels: | ||
run: run-without-caps | ||
spec: | ||
containers: | ||
- image: nginx:1.17.2 | ||
name: run-without-caps | ||
securityContext: | ||
capabilities: | ||
drop: | ||
- ALL |
27 changes: 27 additions & 0 deletions
27
3-security-context/demo/08-deployment-run-with-certain-caps.yaml
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,27 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
run: run-with-certain-caps | ||
name: run-with-certain-caps | ||
spec: | ||
selector: | ||
matchLabels: | ||
run: run-with-certain-caps | ||
template: | ||
metadata: | ||
labels: | ||
run: run-with-certain-caps | ||
spec: | ||
containers: | ||
- image: nginx:1.17.2 | ||
name: run-with-certain-caps | ||
securityContext: | ||
capabilities: | ||
drop: | ||
- ALL | ||
add: | ||
- CHOWN | ||
- NET_BIND_SERVICE | ||
- SETGID | ||
- SETUID |
22 changes: 22 additions & 0 deletions
22
3-security-context/demo/09-deployment-run-without-caps-unprivileged.yaml
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,22 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
run: run-without-caps-unprivileged | ||
name: run-without-caps-unprivileged | ||
spec: | ||
selector: | ||
matchLabels: | ||
run: run-without-caps-unprivileged | ||
template: | ||
metadata: | ||
labels: | ||
run: run-without-caps-unprivileged | ||
spec: | ||
containers: | ||
- image: nginxinc/nginx-unprivileged:1.17.2 | ||
name: run-without-caps-unprivileged | ||
securityContext: | ||
capabilities: | ||
drop: | ||
- ALL |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,38 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
run: all-at-once | ||
name: all-at-once | ||
spec: | ||
selector: | ||
matchLabels: | ||
run: all-at-once | ||
strategy: | ||
type: Recreate | ||
template: | ||
metadata: | ||
labels: | ||
run: all-at-once | ||
annotations: | ||
seccomp.security.alpha.kubernetes.io/pod: runtime/default | ||
spec: | ||
containers: | ||
# Another suitable example springcommunity/spring-framework-petclinic:5.1.5 | ||
- image: nginxinc/nginx-unprivileged:1.17.2 | ||
name: all-at-once | ||
securityContext: | ||
readOnlyRootFilesystem: true | ||
allowPrivilegeEscalation: false | ||
runAsNonRoot: true | ||
runAsUser: 100000 | ||
runAsGroup: 100000 | ||
capabilities: | ||
drop: | ||
- ALL | ||
volumeMounts: | ||
- name: tmp | ||
mountPath: /tmp | ||
volumes: | ||
- name: tmp | ||
emptyDir: {} |
Oops, something went wrong.