Restrict anonymous Nightscout access to LAN

This commit is contained in:
funman300
2026-11-07 17:37:37 -07:00
parent 4a9e87d667
commit 8ceab533a1
5 changed files with 16 additions and 1 deletions
+1
View File
@@ -11,4 +11,5 @@ resources:
- nightscout-deployment.yaml
- nightscout-service.yaml
- nightscout-ingress.yaml
- nightscout-lan-only.yaml
- network-policy.yaml
@@ -9,6 +9,5 @@ data:
INSECURE_USE_HTTP: "true"
HOSTNAME: "0.0.0.0"
ENABLE: "careportal basal iob cob bwp cage sage iage bage boluscalc pump openaps loop profile timeago bgnow delta direction upbat errorcodes ar2 rawbg"
AUTH_DEFAULT_ROLES: "careportal"
THEME: "colors"
NODE_ENV: "production"
@@ -27,6 +27,10 @@ spec:
capabilities:
drop:
- ALL
# Set explicitly so changing anonymous access triggers a pod rollout.
env:
- name: AUTH_DEFAULT_ROLES
value: "readable"
envFrom:
- configMapRef:
name: nightscout-config
+2
View File
@@ -6,6 +6,8 @@ metadata:
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
traefik.ingress.kubernetes.io/router.entrypoints: websecure
# Nightscout grants anonymous read access; keep that access on the trusted LAN only.
traefik.ingress.kubernetes.io/router.middlewares: nightscout-lan-only@kubernetescrd
spec:
ingressClassName: traefik
rules:
+9
View File
@@ -0,0 +1,9 @@
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: nightscout-lan-only
namespace: nightscout
spec:
ipAllowList:
sourceRange:
- 10.10.0.0/24