fix: harden proxy auth and deployment security

This commit is contained in:
nyan404 committed 2026-10-25 00:40:52 +03:00
1 parent f5e8dde608
commit ebf5d45491
14 files changed
+172 -44

No files matched your search

+2
View File
@@ -40,6 +40,8 @@ spec:
secretKeyRef:
name: belki-vk
key: BELKI_ADMIN_PASSWORD
- name: BELKI_ADMIN_RATE_LIMIT_EXEMPT_PROXY_CIDRS
value: "10.42.0.0/21"
readinessProbe:
httpGet:
path: /health
+12
View File
@@ -123,6 +123,8 @@ spec:
secretKeyRef:
name: belki-runtime
key: BELKI_ADMIN_PASSWORD
- name: BELKI_ADMIN_RATE_LIMIT_EXEMPT_PROXY_CIDRS
value: "10.42.0.0/21"
- name: BELKI_S3_ENDPOINTS
valueFrom: {secretKeyRef: {name: belki-image-store, key: BELKI_S3_ENDPOINTS}}
- name: BELKI_S3_ACCESS_KEY
@@ -147,6 +149,11 @@ spec:
port: http
initialDelaySeconds: 10
periodSeconds: 20
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 10001
---
apiVersion: v1
kind: Service
@@ -252,6 +259,11 @@ spec:
port: callback
initialDelaySeconds: 10
periodSeconds: 20
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 10001
---
apiVersion: v1
kind: Service
+6 -1
View File
@@ -17,10 +17,15 @@ rules:
- persistentvolumeclaims
- pods
- pods/log
- secrets
- serviceaccounts
- services
verbs: [get, list, watch, create, update, patch]
- apiGroups: [""]
resources:
- secrets
resourceNames:
- belki-runtime
verbs: [get, patch]
- apiGroups: ["apps"]
resources:
- deployments
+3 -1
View File
@@ -3,6 +3,8 @@ kind: Secret
metadata:
name: belki-runtime
namespace: belki
# Bootstrap template only: replace every placeholder out of band before creating the Secret.
# CI can patch this named Secret but cannot create it or read other namespace Secrets.
type: Opaque
stringData:
VK_GROUP_TOKEN: replace-out-of-band
@@ -13,7 +15,7 @@ stringData:
BELKI_DATABASE_URL: postgresql://belki:replace-out-of-band@postgres:5432/belki
POSTGRES_PASSWORD: replace-out-of-band
BELKI_ADMIN_PASSWORD: replace-out-of-band
# Create separately as `belki-image-store`; do not add these values to CI-managed belki-runtime.
# Create separately as `belki-image-store`; do not add these values to belki-runtime.
---
apiVersion: v1
kind: Secret