-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PodSecurityPolicies are used to control access to security related settings in deployments. We require 2 security contexts for our containers: * unprivileged: Can run as non-root user without sys privileges. Containers in this category are: * operator * linstor controller * stork + scheduler * etcd * csi controller * csi snapshot controller * privileged: Run as root with sys privileges. Containers in this category are: * linstor satellite + kmod injector * csi node To simplify handling of PSPs, this commit adds the following changes * all pods are associated with a service account * helm can generate the rolebindings that associate a serviceaccount with a PSP role.
- Loading branch information
Showing
25 changed files
with
175 additions
and
25 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
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,8 @@ | ||
# This YAML file contains all RBAC objects that are necessary to run a | ||
# etcd | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: etcd | ||
namespace: {{ .Release.Namespace }} |
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,8 @@ | ||
# This YAML file contains all RBAC objects that are necessary to run a | ||
# LINSTOR controller pod | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: linstor-controller | ||
namespace: {{ .Release.Namespace }} |
This file was deleted.
Oops, something went wrong.
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,31 @@ | ||
{{- define "bind-role" -}} | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
name: {{ .Prefix }}-{{ .Role }} | ||
namespace: {{ .Namespace }} | ||
roleRef: | ||
kind: Role | ||
name: {{ .Role }} | ||
apiGroup: rbac.authorization.k8s.io | ||
subjects: | ||
# Authorize specific service accounts: | ||
{{- range .Accounts }} | ||
- kind: ServiceAccount | ||
name: {{ . }} | ||
namespace: {{ $.Namespace }} | ||
{{- end }} | ||
{{- end -}} | ||
|
||
{{ if .Values.psp.unprivilegedRole }} | ||
--- | ||
{{ $unprivAccounts := list (include "operator.fullname" .) "linstor-controller" "csi-controller" "stork-scheduler-account" "stork-account" "snapshot-controller" "etcd" }} | ||
{{ template "bind-role" (dict "Prefix" .Release.Name "Role" .Values.psp.unprivilegedRole "Namespace" .Release.Namespace "Accounts" $unprivAccounts) }} | ||
--- | ||
{{ end }} | ||
{{ if .Values.psp.privilegedRole }} | ||
--- | ||
{{ $privAccounts := list "linstor-satellite" "csi-node" }} | ||
{{ template "bind-role" (dict "Prefix" .Release.Name "Role" .Values.psp.privilegedRole "Namespace" .Release.Namespace "Accounts" $privAccounts) }} | ||
--- | ||
{{ end }} |
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,8 @@ | ||
# This YAML file contains all RBAC objects that are necessary to run a | ||
# LINSTOR satellite pod | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: linstor-satellite | ||
namespace: {{ .Release.Namespace }} |
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
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,11 @@ | ||
--- | ||
# Source: piraeus/charts/etcd/templates/rbac.yaml | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: etcd | ||
namespace: default | ||
--- | ||
# Source: piraeus/charts/etcd/templates/rbac.yaml | ||
# This YAML file contains all RBAC objects that are necessary to run a | ||
# etcd |
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,11 @@ | ||
--- | ||
# Source: piraeus/templates/controller-rbac.yml | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: linstor-controller | ||
namespace: default | ||
--- | ||
# Source: piraeus/templates/controller-rbac.yml | ||
# This YAML file contains all RBAC objects that are necessary to run a | ||
# LINSTOR controller pod |
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,11 @@ | ||
--- | ||
# Source: piraeus/templates/satellite-rbac.yml | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: linstor-satellite | ||
namespace: default | ||
--- | ||
# Source: piraeus/templates/satellite-rbac.yml | ||
# This YAML file contains all RBAC objects that are necessary to run a | ||
# LINSTOR satellite pod |
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
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