Skip to content

Commit 90987de

Browse files
feat: Kubernetes-based data protection provider (#520)
1 parent 3cd16ce commit 90987de

File tree

14 files changed

+267
-264
lines changed

14 files changed

+267
-264
lines changed

OIDC-Guard.sln

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,47 @@
1-
2-
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio Version 17
4-
VisualStudioVersion = 17.7.33711.374
5-
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "oidc-guard", "src\oidc-guard\oidc-guard.csproj", "{6929C116-97B2-441D-A5D0-183DBCF7FB91}"
7-
EndProject
8-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{0A693076-F1A0-42D6-BC38-FD7EB3717CF8}"
9-
ProjectSection(SolutionItems) = preProject
10-
.releaserc.json = .releaserc.json
11-
.github\workflows\cicd.yml = .github\workflows\cicd.yml
12-
global.json = global.json
13-
README.md = README.md
14-
.github\renovate.json = .github\renovate.json
15-
charts\oidc-guard\values.yaml = charts\oidc-guard\values.yaml
16-
EndProjectSection
17-
EndProject
18-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "oidc-guard-tests", "tests\oidc-guard-tests\oidc-guard-tests.csproj", "{21CCD575-7BEC-4CA8-B6EA-C0A66E2EB330}"
19-
EndProject
20-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "oidc-guard-benchmarks", "benchmarks\oidc-guard-benchmarks\oidc-guard-benchmarks.csproj", "{EEC646DE-2009-4AC4-94E7-AB9108CCE80B}"
21-
EndProject
22-
Global
23-
GlobalSection(SolutionConfigurationPlatforms) = preSolution
24-
Debug|Any CPU = Debug|Any CPU
25-
Release|Any CPU = Release|Any CPU
26-
EndGlobalSection
27-
GlobalSection(ProjectConfigurationPlatforms) = postSolution
28-
{6929C116-97B2-441D-A5D0-183DBCF7FB91}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
29-
{6929C116-97B2-441D-A5D0-183DBCF7FB91}.Debug|Any CPU.Build.0 = Debug|Any CPU
30-
{6929C116-97B2-441D-A5D0-183DBCF7FB91}.Release|Any CPU.ActiveCfg = Release|Any CPU
31-
{6929C116-97B2-441D-A5D0-183DBCF7FB91}.Release|Any CPU.Build.0 = Release|Any CPU
32-
{21CCD575-7BEC-4CA8-B6EA-C0A66E2EB330}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33-
{21CCD575-7BEC-4CA8-B6EA-C0A66E2EB330}.Debug|Any CPU.Build.0 = Debug|Any CPU
34-
{21CCD575-7BEC-4CA8-B6EA-C0A66E2EB330}.Release|Any CPU.ActiveCfg = Release|Any CPU
35-
{21CCD575-7BEC-4CA8-B6EA-C0A66E2EB330}.Release|Any CPU.Build.0 = Release|Any CPU
36-
{EEC646DE-2009-4AC4-94E7-AB9108CCE80B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
37-
{EEC646DE-2009-4AC4-94E7-AB9108CCE80B}.Debug|Any CPU.Build.0 = Debug|Any CPU
38-
{EEC646DE-2009-4AC4-94E7-AB9108CCE80B}.Release|Any CPU.ActiveCfg = Release|Any CPU
39-
{EEC646DE-2009-4AC4-94E7-AB9108CCE80B}.Release|Any CPU.Build.0 = Release|Any CPU
40-
EndGlobalSection
41-
GlobalSection(SolutionProperties) = preSolution
42-
HideSolutionNode = FALSE
43-
EndGlobalSection
44-
GlobalSection(ExtensibilityGlobals) = postSolution
45-
SolutionGuid = {E595A20B-B5ED-400D-80A3-C453B0796AA9}
46-
EndGlobalSection
47-
EndGlobal
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 18
4+
VisualStudioVersion = 18.0.11104.47 d18.0
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "oidc-guard", "src\oidc-guard\oidc-guard.csproj", "{6929C116-97B2-441D-A5D0-183DBCF7FB91}"
7+
EndProject
8+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{0A693076-F1A0-42D6-BC38-FD7EB3717CF8}"
9+
ProjectSection(SolutionItems) = preProject
10+
.releaserc.json = .releaserc.json
11+
.github\workflows\cicd.yml = .github\workflows\cicd.yml
12+
global.json = global.json
13+
README.md = README.md
14+
.github\renovate.json = .github\renovate.json
15+
charts\oidc-guard\values.yaml = charts\oidc-guard\values.yaml
16+
EndProjectSection
17+
EndProject
18+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "oidc-guard-tests", "tests\oidc-guard-tests\oidc-guard-tests.csproj", "{21CCD575-7BEC-4CA8-B6EA-C0A66E2EB330}"
19+
EndProject
20+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "oidc-guard-benchmarks", "benchmarks\oidc-guard-benchmarks\oidc-guard-benchmarks.csproj", "{EEC646DE-2009-4AC4-94E7-AB9108CCE80B}"
21+
EndProject
22+
Global
23+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
24+
Debug|Any CPU = Debug|Any CPU
25+
Release|Any CPU = Release|Any CPU
26+
EndGlobalSection
27+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
28+
{6929C116-97B2-441D-A5D0-183DBCF7FB91}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
29+
{6929C116-97B2-441D-A5D0-183DBCF7FB91}.Debug|Any CPU.Build.0 = Debug|Any CPU
30+
{6929C116-97B2-441D-A5D0-183DBCF7FB91}.Release|Any CPU.ActiveCfg = Release|Any CPU
31+
{6929C116-97B2-441D-A5D0-183DBCF7FB91}.Release|Any CPU.Build.0 = Release|Any CPU
32+
{21CCD575-7BEC-4CA8-B6EA-C0A66E2EB330}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33+
{21CCD575-7BEC-4CA8-B6EA-C0A66E2EB330}.Debug|Any CPU.Build.0 = Debug|Any CPU
34+
{21CCD575-7BEC-4CA8-B6EA-C0A66E2EB330}.Release|Any CPU.ActiveCfg = Release|Any CPU
35+
{21CCD575-7BEC-4CA8-B6EA-C0A66E2EB330}.Release|Any CPU.Build.0 = Release|Any CPU
36+
{EEC646DE-2009-4AC4-94E7-AB9108CCE80B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
37+
{EEC646DE-2009-4AC4-94E7-AB9108CCE80B}.Debug|Any CPU.Build.0 = Debug|Any CPU
38+
{EEC646DE-2009-4AC4-94E7-AB9108CCE80B}.Release|Any CPU.ActiveCfg = Release|Any CPU
39+
{EEC646DE-2009-4AC4-94E7-AB9108CCE80B}.Release|Any CPU.Build.0 = Release|Any CPU
40+
EndGlobalSection
41+
GlobalSection(SolutionProperties) = preSolution
42+
HideSolutionNode = FALSE
43+
EndGlobalSection
44+
GlobalSection(ExtensibilityGlobals) = postSolution
45+
SolutionGuid = {E595A20B-B5ED-400D-80A3-C453B0796AA9}
46+
EndGlobalSection
47+
EndGlobal
Lines changed: 108 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -1,108 +1,108 @@
1-
apiVersion: apps/v1
2-
kind: Deployment
3-
metadata:
4-
name: {{ include "oidc-guard.fullname" . }}
5-
labels:
6-
{{- include "oidc-guard.labels" . | nindent 4 }}
7-
spec:
8-
{{- if not .Values.autoscaling.enabled }}
9-
replicas: {{ .Values.replicaCount }}
10-
{{- end }}
11-
selector:
12-
matchLabels:
13-
{{- include "oidc-guard.selectorLabels" . | nindent 6 }}
14-
template:
15-
metadata:
16-
annotations:
17-
checksum/config: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
18-
{{- with .Values.podAnnotations }}
19-
{{- toYaml . | nindent 8 }}
20-
{{- end }}
21-
labels:
22-
{{- include "oidc-guard.selectorLabels" . | nindent 8 }}
23-
spec:
24-
{{- with .Values.imagePullSecrets }}
25-
imagePullSecrets:
26-
{{- toYaml . | nindent 8 }}
27-
{{- end }}
28-
serviceAccountName: {{ include "oidc-guard.serviceAccountName" . }}
29-
securityContext:
30-
{{- toYaml .Values.podSecurityContext | nindent 8 }}
31-
containers:
32-
- name: {{ .Chart.Name }}
33-
env:
34-
- name: ASPNETCORE_ENVIRONMENT
35-
value: Production
36-
{{- if .Values.settings.sslCertSecretName }}
37-
- name: Certificates__Default__Path
38-
value: /app/ssl/tls.crt
39-
- name: Certificates__Default__KeyPath
40-
value: /app/ssl/tls.key
41-
{{- end }}
42-
{{- if .Values.settings.cookie.clientSecretName }}
43-
- name: settings__cookie__clientSecret
44-
valueFrom:
45-
secretKeyRef:
46-
name: {{ .Values.settings.cookie.clientSecretName }}
47-
key: {{ .Values.settings.cookie.clientSecretKey }}
48-
{{- end }}
49-
- name: settings__name
50-
value: {{ include "oidc-guard.fullname" . }}
51-
- name: settings__namespace
52-
value: {{ .Release.Namespace }}
53-
securityContext:
54-
{{- toYaml .Values.securityContext | nindent 12 }}
55-
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
56-
imagePullPolicy: {{ .Values.image.pullPolicy }}
57-
ports:
58-
- name: http
59-
containerPort: 8080
60-
protocol: TCP
61-
- name: https
62-
containerPort: 8443
63-
protocol: TCP
64-
livenessProbe:
65-
httpGet:
66-
path: /health
67-
port: http
68-
readinessProbe:
69-
httpGet:
70-
path: /health
71-
port: http
72-
resources:
73-
{{- toYaml .Values.resources | nindent 12 }}
74-
volumeMounts:
75-
- mountPath: /tmp
76-
name: tmp-volume
77-
- name: appsettings-volume
78-
mountPath: /app/appsettings.Production.json
79-
subPath: appsettings.Production.json
80-
readOnly: true
81-
{{- if .Values.settings.sslCertSecretName }}
82-
- name: appsettings-ssl
83-
mountPath: /app/ssl/
84-
readOnly: true
85-
{{- end }}
86-
volumes:
87-
- name: tmp-volume
88-
emptyDir: {}
89-
- name: appsettings-volume
90-
secret:
91-
secretName: {{ include "oidc-guard.fullname" . }}
92-
{{- if .Values.settings.sslCertSecretName }}
93-
- name: appsettings-ssl
94-
secret:
95-
secretName: "{{ .Values.settings.sslCertSecretName }}"
96-
{{- end }}
97-
{{- with .Values.nodeSelector }}
98-
nodeSelector:
99-
{{- toYaml . | nindent 8 }}
100-
{{- end }}
101-
{{- with .Values.affinity }}
102-
affinity:
103-
{{- toYaml . | nindent 8 }}
104-
{{- end }}
105-
{{- with .Values.tolerations }}
106-
tolerations:
107-
{{- toYaml . | nindent 8 }}
108-
{{- end }}
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{ include "oidc-guard.fullname" . }}
5+
labels:
6+
{{- include "oidc-guard.labels" . | nindent 4 }}
7+
spec:
8+
{{- if not .Values.autoscaling.enabled }}
9+
replicas: {{ .Values.replicaCount }}
10+
{{- end }}
11+
selector:
12+
matchLabels:
13+
{{- include "oidc-guard.selectorLabels" . | nindent 6 }}
14+
template:
15+
metadata:
16+
annotations:
17+
checksum/config: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
18+
{{- with .Values.podAnnotations }}
19+
{{- toYaml . | nindent 8 }}
20+
{{- end }}
21+
labels:
22+
{{- include "oidc-guard.selectorLabels" . | nindent 8 }}
23+
spec:
24+
{{- with .Values.imagePullSecrets }}
25+
imagePullSecrets:
26+
{{- toYaml . | nindent 8 }}
27+
{{- end }}
28+
serviceAccountName: {{ include "oidc-guard.serviceAccountName" . }}
29+
securityContext:
30+
{{- toYaml .Values.podSecurityContext | nindent 8 }}
31+
containers:
32+
- name: {{ .Chart.Name }}
33+
env:
34+
- name: ASPNETCORE_ENVIRONMENT
35+
value: Production
36+
{{- if .Values.settings.sslCertSecretName }}
37+
- name: Certificates__Default__Path
38+
value: /app/ssl/tls.crt
39+
- name: Certificates__Default__KeyPath
40+
value: /app/ssl/tls.key
41+
{{- end }}
42+
{{- if .Values.settings.cookie.clientSecretName }}
43+
- name: settings__cookie__clientSecret
44+
valueFrom:
45+
secretKeyRef:
46+
name: {{ .Values.settings.cookie.clientSecretName }}
47+
key: {{ .Values.settings.cookie.clientSecretKey }}
48+
{{- end }}
49+
- name: settings__name
50+
value: {{ include "oidc-guard.fullname" . }}
51+
- name: settings__namespace
52+
value: {{ .Release.Namespace }}
53+
securityContext:
54+
{{- toYaml .Values.securityContext | nindent 12 }}
55+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
56+
imagePullPolicy: {{ .Values.image.pullPolicy }}
57+
ports:
58+
- name: http
59+
containerPort: 8080
60+
protocol: TCP
61+
- name: https
62+
containerPort: 8443
63+
protocol: TCP
64+
livenessProbe:
65+
httpGet:
66+
path: /health
67+
port: http
68+
readinessProbe:
69+
httpGet:
70+
path: /health
71+
port: http
72+
resources:
73+
{{- toYaml .Values.resources | nindent 12 }}
74+
volumeMounts:
75+
- mountPath: /tmp
76+
name: tmp-volume
77+
- name: appsettings-volume
78+
mountPath: /app/appsettings.Production.json
79+
subPath: appsettings.Production.json
80+
readOnly: true
81+
{{- if .Values.settings.sslCertSecretName }}
82+
- name: appsettings-ssl
83+
mountPath: /app/ssl/
84+
readOnly: true
85+
{{- end }}
86+
volumes:
87+
- name: tmp-volume
88+
emptyDir: {}
89+
- name: appsettings-volume
90+
secret:
91+
secretName: {{ include "oidc-guard.fullname" . }}
92+
{{- if .Values.settings.sslCertSecretName }}
93+
- name: appsettings-ssl
94+
secret:
95+
secretName: "{{ .Values.settings.sslCertSecretName }}"
96+
{{- end }}
97+
{{- with .Values.nodeSelector }}
98+
nodeSelector:
99+
{{- toYaml . | nindent 8 }}
100+
{{- end }}
101+
{{- with .Values.affinity }}
102+
affinity:
103+
{{- toYaml . | nindent 8 }}
104+
{{- end }}
105+
{{- with .Values.tolerations }}
106+
tolerations:
107+
{{- toYaml . | nindent 8 }}
108+
{{- end }}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: Role
3+
metadata:
4+
name: {{ include "oidc-guard.fullname" . }}
5+
rules:
6+
- apiGroups: [""]
7+
resources: ["secrets"]
8+
verbs: ["list", "create", "delete"]
9+
---
10+
apiVersion: rbac.authorization.k8s.io/v1
11+
kind: RoleBinding
12+
metadata:
13+
name: {{ include "oidc-guard.fullname" . }}
14+
roleRef:
15+
apiGroup: rbac.authorization.k8s.io
16+
kind: Role
17+
name: {{ include "oidc-guard.fullname" . }}
18+
subjects:
19+
- kind: ServiceAccount
20+
name: {{ include "oidc-guard.serviceAccountName" . }}
21+
namespace: {{ .Release.Namespace }}
Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
{{- if .Values.serviceAccount.create -}}
2-
apiVersion: v1
3-
kind: ServiceAccount
4-
metadata:
5-
name: {{ include "oidc-guard.serviceAccountName" . }}
6-
labels:
7-
{{- include "oidc-guard.labels" . | nindent 4 }}
8-
{{- with .Values.serviceAccount.annotations }}
9-
annotations:
10-
{{- toYaml . | nindent 4 }}
11-
{{- end }}
12-
{{- end }}
1+
apiVersion: v1
2+
kind: ServiceAccount
3+
metadata:
4+
name: {{ include "oidc-guard.serviceAccountName" . }}
5+
labels:
6+
{{- include "oidc-guard.labels" . | nindent 4 }}
7+
{{- with .Values.serviceAccount.annotations }}
8+
annotations:
9+
{{- toYaml . | nindent 4 }}
10+
{{- end }}

charts/oidc-guard/values.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,6 @@ settings:
137137
appendToWWWAuthenticateHeader: ""
138138

139139
serviceAccount:
140-
# Specifies whether a service account should be created
141-
create: true
142140
# Annotations to add to the service account
143141
annotations: {}
144142
# The name of the service account to use.

docs/Shield.png

1.17 KB
Loading

0 commit comments

Comments
 (0)