Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions apis/installer/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,9 @@ type EASMonitoring struct {
}

type SecuritySpec struct {
Apparmor ApparmorSpec `json:"apparmor"`
Seccomp SeccompSpec `json:"seccomp"`
CopyAuthenticationConfigMap bool `json:"copyAuthenticationConfigMap"`
Apparmor ApparmorSpec `json:"apparmor"`
Seccomp SeccompSpec `json:"seccomp"`
//+optional
PodSecurityPolicies []string `json:"podSecurityPolicies"`
CreatePSPs CreatePSPSpec `json:"createPSPs"`
Expand Down
1 change: 1 addition & 0 deletions charts/stash-community/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ The following table lists the configurable parameters of the `stash-community` c
| monitoring.backup | Specify whether to monitor Stash backup and recovery | <code>false</code> |
| monitoring.operator | Specify whether to monitor Stash operator | <code>false</code> |
| monitoring.serviceMonitor.labels | Specify the labels for ServiceMonitor. Prometheus crd will select ServiceMonitor using these labels. Only usable when monitoring agent is `prometheus.io/operator`. | <code>{}</code> |
| security.copyAuthenticationConfigMap | | <code>true</code> |
| security.apparmor.enabled | `Optional:` Allows the default AppArmor profile, requires setting the default. | <code>false</code> |
| security.seccomp.enabled | `Optional:` Allows the default seccomp profile, requires setting the default. | <code>false</code> |
| security.podSecurityPolicies | PSP names passed to operator <br> Example: <br> `helm install appscode/stash \` <br> `--set podSecurityPolicies[0]=abc \` <br> `--set podSecurityPolicies[1]=xyz` | <code>["baseline"]</code> |
Expand Down
3 changes: 3 additions & 0 deletions charts/stash-community/values.openapiv3_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1727,6 +1727,8 @@ properties:
enabled:
type: boolean
type: object
copyAuthenticationConfigMap:
type: boolean
createPSPs:
properties:
baseline:
Expand All @@ -1748,6 +1750,7 @@ properties:
type: object
required:
- apparmor
- copyAuthenticationConfigMap
- createPSPs
- seccomp
type: object
Expand Down
1 change: 1 addition & 0 deletions charts/stash-community/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ monitoring:
# Only usable when monitoring agent is `prometheus.io/operator`.
labels: {}
security:
copyAuthenticationConfigMap: true
apparmor:
# `Optional:` Allows the default AppArmor profile, requires setting the default.
enabled: false
Expand Down
2 changes: 1 addition & 1 deletion charts/stash-enterprise/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
description: Enterprise features for Stash by AppsCode
name: stash-enterprise
version: v0.30.0
appVersion: v0.30.0
appVersion: v0.30.1
home: https://stash.run
icon: https://cdn.appscode.com/images/products/stash/stash-enterprise-icon.png
sources:
Expand Down
1 change: 1 addition & 0 deletions charts/stash-enterprise/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ The following table lists the configurable parameters of the `stash-enterprise`
| monitoring.backup | Specify whether to monitor Stash backup and recovery | <code>false</code> |
| monitoring.operator | Specify whether to monitor Stash operator | <code>false</code> |
| monitoring.serviceMonitor.labels | Specify the labels for ServiceMonitor. Prometheus crd will select ServiceMonitor using these labels. Only usable when monitoring agent is `prometheus.io/operator`. | <code>{}</code> |
| security.copyAuthenticationConfigMap | | <code>true</code> |
| security.apparmor.enabled | `Optional:` Allows the default AppArmor profile, requires setting the default. | <code>false</code> |
| security.seccomp.enabled | `Optional:` Allows the default seccomp profile, requires setting the default. | <code>false</code> |
| security.podSecurityPolicies | PSP names passed to operator <br> Example: <br> `helm install appscode/stash \` <br> `--set podSecurityPolicies[0]=abc \` <br> `--set podSecurityPolicies[1]=xyz` | <code>["baseline"]</code> |
Expand Down
11 changes: 10 additions & 1 deletion charts/stash-enterprise/templates/apiregistration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ include "stash-enterprise.fullname" . }}-apiserver-extension-server-authentication-reader
namespace: kube-system
namespace: {{ ternary .Release.Namespace "kube-system" .Values.security.copyAuthenticationConfigMap }}
labels:
{{- include "stash-enterprise.labels" . | nindent 4 }}
roleRef:
Expand All @@ -94,6 +94,15 @@ subjects:
name: {{ include "stash-enterprise.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
---
# copy kube-system/extension-apiserver-authentication into stash operator namespace
{{- if .Values.security.copyAuthenticationConfigMap }}

{{ $obj := lookup "v1" "ConfigMap" "kube-system" "extension-apiserver-authentication" }}
{{ $obj = mergeOverwrite $obj (dict "metadata" (dict "namespace" .Release.Namespace )) }}
{{ toYaml $obj }}

{{- end }}
---
# to delegate authentication and authorization
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
Expand Down
1 change: 1 addition & 0 deletions charts/stash-enterprise/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ spec:
- --image-pull-secrets={{ include "image-pull-secrets" . }}
{{- end }}
- --secure-port=8443
- --authentication-configmap-namespace={{ ternary .Release.Namespace "kube-system" .Values.security.copyAuthenticationConfigMap }}
- --audit-log-path=-
- --tls-cert-file=/var/serving-cert/tls.crt
- --tls-private-key-file=/var/serving-cert/tls.key
Expand Down
3 changes: 3 additions & 0 deletions charts/stash-enterprise/values.openapiv3_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1739,6 +1739,8 @@ properties:
enabled:
type: boolean
type: object
copyAuthenticationConfigMap:
type: boolean
createPSPs:
properties:
baseline:
Expand All @@ -1760,6 +1762,7 @@ properties:
type: object
required:
- apparmor
- copyAuthenticationConfigMap
- createPSPs
- seccomp
type: object
Expand Down
1 change: 1 addition & 0 deletions charts/stash-enterprise/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ monitoring:
# Only usable when monitoring agent is `prometheus.io/operator`.
labels: {}
security:
copyAuthenticationConfigMap: true
apparmor:
# `Optional:` Allows the default AppArmor profile, requires setting the default.
enabled: false
Expand Down
6 changes: 6 additions & 0 deletions charts/stash/values.openapiv3_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2121,6 +2121,8 @@ properties:
enabled:
type: boolean
type: object
copyAuthenticationConfigMap:
type: boolean
createPSPs:
properties:
baseline:
Expand All @@ -2142,6 +2144,7 @@ properties:
type: object
required:
- apparmor
- copyAuthenticationConfigMap
- createPSPs
- seccomp
type: object
Expand Down Expand Up @@ -4015,6 +4018,8 @@ properties:
enabled:
type: boolean
type: object
copyAuthenticationConfigMap:
type: boolean
createPSPs:
properties:
baseline:
Expand All @@ -4036,6 +4041,7 @@ properties:
type: object
required:
- apparmor
- copyAuthenticationConfigMap
- createPSPs
- seccomp
type: object
Expand Down