Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 3bcf5d1

Browse files
committed
For #133: Kubernetes tweak (AWS)
1 parent 0e2d4b6 commit 3bcf5d1

18 files changed

+152
-357
lines changed

deployment/charts/presidio/Chart.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
apiVersion: v2
22
description: A context aware, born to the cloud, customizable data loss prevention service
33
name: presidio
4+
type: application
45
version: 2.0
5-
appVersion: latest
6+
appVersion: 2.2.21

deployment/charts/presidio/nginx.conf

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
error_log /dev/stdout info;
2+
user nginx;
3+
4+
worker_processes auto;
5+
6+
events {
7+
worker_connections 1024;
8+
}
9+
10+
pid /var/run/nginx.pid;
11+
12+
http {
13+
access_log /dev/stdout;
14+
15+
#Redirect to https, using 307 instead of 301 to preserve post data
16+
17+
server {
18+
listen [::]:{{ .Values.nginxPort }} ssl;
19+
listen {{ .Values.nginxPort }} ssl;
20+
21+
server_name localhost;
22+
23+
# Protect against the BEAST attack by not using SSLv3 at all. If you need to support older browsers (IE6) you may need to add
24+
# SSLv3 to the list of protocols below.
25+
ssl_protocols TLSv1.2;
26+
27+
# Ciphers set to best allow protection from Beast, while providing forwarding secrecy, as defined by Mozilla - https://wiki.mozilla.org/Security/Server_Side_TLS#Nginx
28+
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:ECDHE-RSA-RC4-SHA:ECDHE-ECDSA-RC4-SHA:AES128:AES256:RC4-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!3DES:!MD5:!PSK;
29+
ssl_prefer_server_ciphers on;
30+
31+
# Optimize TLS/SSL by caching session parameters for 10 minutes. This cuts down on the number of expensive TLS/SSL handshakes.
32+
# The handshake is the most CPU-intensive operation, and by default it is re-negotiated on every new/parallel connection.
33+
# By enabling a cache (of type "shared between all Nginx workers"), we tell the client to re-use the already negotiated state.
34+
# Further optimization can be achieved by raising keepalive_timeout, but that shouldn't be done unless you serve primarily HTTPS.
35+
ssl_session_cache shared:SSL:10m; # a 1mb cache can hold about 4000 sessions, so we can hold 40000 sessions
36+
ssl_session_timeout 24h;
37+
38+
39+
# Use a higher keepalive timeout to reduce the need for repeated handshakes
40+
keepalive_timeout 300; # up from 75 secs default
41+
42+
# remember the certificate for a year and automatically connect to HTTPS
43+
add_header Strict-Transport-Security 'max-age=31536000; includeSubDomains';
44+
45+
ssl_certificate /etc/nginx/ssl.crt;
46+
ssl_certificate_key /etc/nginx/ssl.key;
47+
48+
location / {
49+
proxy_pass http://localhost:{{ .Values.appPort }};
50+
51+
proxy_set_header Connection "";
52+
proxy_set_header Host $host;
53+
proxy_set_header X-Real-IP $remote_addr;
54+
proxy_set_header X-Forwarded-For $remote_addr;
55+
}
56+
}
57+
}

deployment/charts/presidio/templates/NOTES.txt

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 3 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,8 @@
1-
{{/* vim: set filetype=mustache */}}
2-
{{/*
3-
Expand the name of the chart.
4-
*/}}
5-
{{- define "presidio.name" -}}
6-
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
7-
{{- end -}}
8-
9-
{{/*
10-
Create a default fully qualified app name.
11-
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
12-
*/}}
13-
{{- define "presidio.fullname" -}}
14-
{{- $name := default .Chart.Name .Values.nameOverride -}}
15-
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
16-
{{- end -}}
17-
18-
{{- define "presidio.analyzer.fullname" -}}
19-
{{ include "presidio.fullname" . | printf "%s-analyzer" }}
20-
{{- end -}}
21-
{{- define "presidio.anonymizer.fullname" -}}
22-
{{ include "presidio.fullname" . | printf "%s-anonymizer" }}
23-
{{- end -}}
24-
{{- define "presidio.anonymizerimage.fullname" -}}
25-
{{ include "presidio.fullname" . | printf "%s-image-redactor" }}
26-
{{- end -}}
27-
{{- define "presidio.ingress.fullname" -}}
28-
{{ printf "presidio-ingress" }}
29-
{{- end -}}
30-
{{- define "presidio.ingress.cert.secretname" -}}
31-
{{ include "presidio.fullname" . | printf "%s-ingress-cert" }}
32-
{{- end -}}
33-
34-
{{- define "presidio.analyzer.address" -}}
35-
{{template "presidio.analyzer.fullname" .}}:{{.Values.analyzer.service.externalPort}}
36-
{{- end -}}
37-
38-
{{- define "presidio.anonymizer.address" -}}
39-
{{template "presidio.anonymizer.fullname" .}}:{{.Values.anonymizer.service.externalPort}}
40-
{{- end -}}
41-
42-
{{- define "presidio.anonymizerimage.address" -}}
43-
{{template "presidio.anonymizerimage.fullname" .}}:{{.Values.anonymizerimage.service.externalPort}}
44-
{{- end -}}
45-
46-
{{- define "presidio.rbac.version" }}rbac.authorization.k8s.io/v1{{ end -}}
47-
481
{{/* Generate certificates for custom-metrics api server */}}
492
{{- define "tcx-presidio.gen-certs" -}}
503
{{- $ca := genCA (.Values.caCommonName) 365 -}}
514
{{- $altNames := list (.Values.certDomainName) -}}
52-
{{- $cert := genSignedCert (.Values.certDomainName) nil $altNames 365 $ca -}}
53-
tls.crt: {{ $cert.Cert | b64enc }}
54-
tls.key: {{ $cert.Key | b64enc }}
5+
{{- $cert := genSignedCert (.Values.certDomainName) nil $altNames 365 $ca }}
6+
ssl.crt: {{ $cert.Cert | b64enc }}
7+
ssl.key: {{ $cert.Key | b64enc }}
558
{{- end -}}

deployment/charts/presidio/templates/analyzer-deployment.yaml

Lines changed: 0 additions & 38 deletions
This file was deleted.

deployment/charts/presidio/templates/analyzer-service.yaml

Lines changed: 0 additions & 20 deletions
This file was deleted.

deployment/charts/presidio/templates/anonymizer-deployment.yaml

Lines changed: 0 additions & 38 deletions
This file was deleted.

deployment/charts/presidio/templates/anonymizer-image-deployment.yaml

Lines changed: 0 additions & 38 deletions
This file was deleted.

deployment/charts/presidio/templates/anonymizer-image-service.yaml

Lines changed: 0 additions & 20 deletions
This file was deleted.

deployment/charts/presidio/templates/anonymizer-service.yaml

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: "{{ .Values.appName }}"
5+
namespace: "{{ .Release.Namespace }}"
6+
spec:
7+
selector:
8+
matchLabels:
9+
app: "{{ .Values.appName }}"
10+
replicas: {{ .Values.replicaCount }}
11+
template:
12+
metadata:
13+
name: "{{ .Values.appName }}"
14+
labels:
15+
app: "{{ .Values.appName }}"
16+
spec:
17+
containers:
18+
- name: "{{ .Values.appName }}"
19+
image: "{{ .Values.imageName }}"
20+
imagePullPolicy: Always
21+
- name: nginx
22+
image: nginx:{{ .Values.nginxImageTag }}
23+
imagePullPolicy: Always
24+
ports:
25+
- containerPort: {{ .Values.nginxPort }}
26+
protocol: TCP
27+
volumeMounts:
28+
- name: nginx-config
29+
mountPath: /etc/nginx
30+
volumes:
31+
- name: nginx-config
32+
secret:
33+
secretName: "{{ .Values.appName }}"

deployment/charts/presidio/templates/ingress-cert.yaml

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)