-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[bitnami/nginx] feat!: π π₯ Improve security defaults (#24371)
* [bitnami/nginx] feat!: π π₯ Improve security defaults Signed-off-by: Alejandro Moreno <[email protected]> * Update README.md with readme-generator-for-helm Signed-off-by: Bitnami Containers <[email protected]> * Update README.md with readme-generator-for-helm Signed-off-by: Bitnami Containers <[email protected]> * feat: β¨ Add tls support Signed-off-by: Javier Salmeron Garcia <[email protected]> * fix: π¨ Add missing copyright Signed-off-by: Javier Salmeron Garcia <[email protected]> --------- Signed-off-by: Alejandro Moreno <[email protected]> Signed-off-by: Bitnami Containers <[email protected]> Signed-off-by: Javier J. SalmerΓ³n-GarcΓa <[email protected]> Signed-off-by: Javier Salmeron Garcia <[email protected]> Co-authored-by: Bitnami Containers <[email protected]> Co-authored-by: Javier J. SalmerΓ³n-GarcΓa <[email protected]>
- Loading branch information
1 parent
417df02
commit 66f3026
Showing
7 changed files
with
264 additions
and
154 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 |
---|---|---|
|
@@ -12,3 +12,6 @@ service: | |
ports: | ||
http: 80 | ||
https: 444 | ||
tls: | ||
enabled: true | ||
autoGenerated: 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
Large diffs are not rendered by default.
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
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,35 @@ | ||
{{- /* | ||
Copyright VMware, Inc. | ||
SPDX-License-Identifier: APACHE-2.0 | ||
*/}} | ||
|
||
{{- if and .Values.tls.enabled (not .Values.tls.existingSecret) }} | ||
{{- $ca := genCA "nginx-ca" 365 }} | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: {{ printf "%s-tls" (include "common.names.fullname" .) }} | ||
namespace: {{ include "common.names.namespace" . | quote }} | ||
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} | ||
{{- if .Values.commonAnnotations }} | ||
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} | ||
{{- end }} | ||
type: kubernetes.io/tls | ||
data: | ||
{{- if .Values.tls.autoGenerated }} | ||
{{- $cert := genSignedCert (include "common.names.fullname" .) nil (list (include "common.names.fullname" .) (printf "%s.%s" (include "common.names.fullname" .) (include "common.names.namespace" .)) (printf "%s.%s.svc" (include "common.names.fullname" .) (include "common.names.namespace" .)) (printf "%s.%s.svc.%s" (include "common.names.fullname" .) (include "common.names.namespace" .) .Values.clusterDomain)) 365 $ca }} | ||
{{ .Values.tls.certFilename }}: {{ include "common.secrets.lookup" (dict "secret" (printf "%s-tls" (include "common.names.fullname" .)) "key" .Values.tls.certFilename "defaultValue" $cert.Cert "context" $) }} | ||
{{ .Values.tls.certKeyFilename }}: {{ include "common.secrets.lookup" (dict "secret" (printf "%s-tls" (include "common.names.fullname" .)) "key" .Values.tls.certKeyFilename "defaultValue" $cert.Key "context" $) }} | ||
{{ .Values.tls.certCAFilename }}: {{ include "common.secrets.lookup" (dict "secret" (printf "%s-tls" (include "common.names.fullname" .)) "key" .Values.tls.certCAFilename "defaultValue" $ca.Cert "context" $) }} | ||
{{- else }} | ||
{{- if .Values.tls.cert }} | ||
{{ .Values.tls.certFilename }}: {{ .Values.tls.cert | b64enc }} | ||
{{- end }} | ||
{{- if .Values.tls.key }} | ||
{{ .Values.tls.certKeyFilename }}: {{ .Values.tls.key | b64enc }} | ||
{{- end }} | ||
{{- if .Values.tls.ca }} | ||
{{ .Values.tls.certCAFilename }}: {{ .Values.tls.ca | b64enc }} | ||
{{- end }} | ||
{{- end }} | ||
{{- 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