Compare commits

...

15 Commits

Author SHA1 Message Date
Raiko Oll
76a89520e1 NetworkPolicy 2026-02-17 15:17:53 +02:00
Raiko Oll
6ab4467a25 NetworkPolicy 2026-02-17 15:03:42 +02:00
Raiko Oll
9aeea7b830 NetworkPolicy 2026-02-17 15:03:22 +02:00
Raiko Oll
23ea92636e NetworkPolicy 2026-02-17 14:59:08 +02:00
Raiko Oll
1384b3ab50 NetworkPolicy 2026-02-17 14:56:24 +02:00
Raiko Oll
3d6b022cad NetworkPolicy 2026-02-17 14:53:58 +02:00
Raiko Oll
46807f93d9 NetworkPolicy 2026-02-17 14:45:26 +02:00
Raiko Oll
a62e3aba2f Network policy 2026-02-17 14:35:47 +02:00
Raiko Oll
77ef9348f9 Network policy 2026-02-17 14:34:53 +02:00
Raiko Oll
0cf4f155de asd 2026-02-17 13:36:24 +02:00
Raiko Oll
a95fad4423 kyverno 2026-02-17 13:21:26 +02:00
Raiko Oll
06307b4047 kyverno 2026-02-17 13:20:52 +02:00
Raiko Oll
6569a6c33b kyverno dont allow root 2026-02-17 13:04:14 +02:00
Raiko Oll
04f351706c oidc fix 2026-02-17 09:57:23 +02:00
Raiko Oll
314c75d8df oidc fix 2026-02-17 09:50:19 +02:00
3 changed files with 148 additions and 0 deletions

View File

@@ -0,0 +1,75 @@
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: dragonfly
namespace: memelord-raiko
spec:
podSelector:
matchLabels:
app: memelord-raiko-redis
policyTypes:
- Ingress
ingress:
# App -> Redis
- from:
- podSelector:
matchLabels:
app: memelord-raiko
ports:
- protocol: TCP
port: 6379
- from:
- podSelector:
matchLabels:
app: memelord-raiko-redis
ports:
- protocol: TCP
port: 6379
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: postgres
namespace: memelord-raiko
spec:
podSelector:
matchLabels:
cnpg.io/cluster: memelord-raiko-database
policyTypes:
- Ingress
ingress:
- from:
- podSelector:
matchLabels:
app: memelord
- podSelector: # Primary-secondary replication!
matchLabels:
cnpg.io/cluster: memelord-raiko-database
ports:
- protocol: TCP
port: 5432
- ports: # Probes do work now!
- protocol: TCP
port: 8000
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: memelord
namespace: memelord-raiko
spec:
podSelector:
matchLabels:
app: memelord
policyTypes:
- Ingress
ingress:
- from:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: traefik
ports:
- protocol: TCP
port: 8000

View File

@@ -175,3 +175,22 @@ spec:
number: 80
tls:
- secretName: {{ .Release.Name }}-tls
---
apiVersion: codemowers.cloud/v1beta1
kind: OIDCClient
metadata:
name: {{ .Release.Name }}
spec:
displayName: Memelord Raiko
uri: https://{{ .Values.hostname }}/oidc/authenticate/
redirectUris:
- https://{{ .Values.hostname }}/oidc/callback/
grantTypes:
- authorization_code
- refresh_token
responseTypes:
- code
availableScopes:
- openid
- profile
pkce: false

54
templates/kyverno.yaml Normal file
View File

@@ -0,0 +1,54 @@
# ---
# apiVersion: kyverno.io/v1
# kind: Policy
# metadata:
# name: add-default-securitycontext
# namespace: memelord-raiko
# spec:
# rules:
# - name: add-default-securitycontext
# match:
# any:
# - resources:
# kinds:
# - Pod
# mutate:
# patchStrategicMerge:
# spec:
# securityContext:
# +(runAsNonRoot): true
# +(runAsUser): 1000
# +(runAsGroup): 3000
# +(fsGroup): 2000
#
# ---
# apiVersion: kyverno.io/v1
# kind: Policy
# metadata:
# name: require-run-as-non-root-user
# namespace: memelord-raiko
# spec:
# validationFailureAction: Enforce
# background: false
# rules:
# - name: run-as-non-root-user
# match:
# any:
# - resources:
# kinds:
# - Pod
# validate:
# message: Running as root is not allowed. The fields spec.securityContext.runAsUser, spec.containers[*].securityContext.runAsUser, spec.initContainers[*].securityContext.runAsUser, and spec.ephemeralContainers[*].securityContext.runAsUser must be unset or set to a number greater than zero.
# pattern:
# spec:
# "=(securityContext)":
# "=(runAsUser)": ">0"
# "=(ephemeralContainers)":
# - "=(securityContext)":
# "=(runAsUser)": ">0"
# "=(initContainers)":
# - "=(securityContext)":
# "=(runAsUser)": ">0"
# containers:
# - "=(securityContext)":
# "=(runAsUser)": ">0"