Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
2b2fd92923
|
|||
|
8fa81be750
|
|||
|
205baa7e01
|
|||
|
f3f9238d5f
|
|||
|
5decf79bee
|
|||
|
be2654ac98
|
2
.gitignore
vendored
2
.gitignore
vendored
@@ -64,3 +64,5 @@ poetry.lock
|
||||
|
||||
apps/homekit/homekit.state
|
||||
|
||||
tools/ca/
|
||||
tools/clients/
|
||||
|
||||
@@ -33,7 +33,6 @@ steps:
|
||||
--namespace=$NAMESPACE
|
||||
--dry-run=client -o yaml | kubectl apply -f -
|
||||
- kubectl apply -f deployment/configmap.yaml -n $NAMESPACE
|
||||
- kubectl apply -f deployment/mtls-config.yaml -n $NAMESPACE
|
||||
when:
|
||||
event: [tag]
|
||||
|
||||
|
||||
@@ -100,29 +100,3 @@ spec:
|
||||
targetPort: 8001
|
||||
name: http
|
||||
type: ClusterIP
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: api-ingress
|
||||
annotations:
|
||||
cert-manager.io/cluster-issuer: letsencrypt-production-http
|
||||
# Traefik 2 mTLS Configuration
|
||||
traefik.ingress.kubernetes.io/router.tls.options: homea2-mtls@kubernetescrd
|
||||
traefik.ingress.kubernetes.io/router.middlewares: homea2-mtls-auth@kubernetescrd
|
||||
spec:
|
||||
tls:
|
||||
- hosts:
|
||||
- homea2-api.hottis.de
|
||||
secretName: homea2-api-cert
|
||||
rules:
|
||||
- host: homea2-api.hottis.de
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: api
|
||||
port:
|
||||
number: 80
|
||||
43
deployment/ingress.yaml
Normal file
43
deployment/ingress.yaml
Normal file
@@ -0,0 +1,43 @@
|
||||
apiVersion: cert-manager.io/v1
|
||||
kind: Certificate
|
||||
metadata:
|
||||
name: homea2-cert
|
||||
spec:
|
||||
secretName: homea2-cert
|
||||
issuerRef:
|
||||
name: letsencrypt-production-http
|
||||
kind: ClusterIssuer
|
||||
commonName: homea2.hottis.de
|
||||
dnsNames:
|
||||
- homea2.hottis.de
|
||||
- homea2-api.hottis.de
|
||||
---
|
||||
apiVersion: traefik.containo.us/v1alpha1
|
||||
kind: TLSOptions
|
||||
metadata:
|
||||
name: mtls-required
|
||||
spec:
|
||||
clientAuth:
|
||||
clientAuthType: RequireAndVerifyClientCert
|
||||
secretNames:
|
||||
- mtls-ca-cert
|
||||
---
|
||||
apiVersion: traefik.containo.us/v1alpha1
|
||||
kind: IngressRoute
|
||||
metadata:
|
||||
name: ui
|
||||
spec:
|
||||
entryPoints:
|
||||
- websecure
|
||||
tls:
|
||||
secretName: homea2-cert
|
||||
options:
|
||||
name: mtls-required
|
||||
namespace: default
|
||||
routes:
|
||||
- match: Host(`homea2.hottis.de`)
|
||||
kind: Rule
|
||||
services:
|
||||
- name: ui
|
||||
port: 80
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
apiVersion: traefik.containo.us/v1alpha1
|
||||
kind: TLSOption
|
||||
metadata:
|
||||
name: homea2-mtls
|
||||
spec:
|
||||
clientAuth:
|
||||
secretNames:
|
||||
- mtls-ca-cert
|
||||
clientAuthType: RequireAndVerifyClientCert
|
||||
minVersion: "VersionTLS12"
|
||||
cipherSuites:
|
||||
- "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384"
|
||||
- "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305"
|
||||
- "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256"
|
||||
- "TLS_RSA_WITH_AES_256_GCM_SHA384"
|
||||
- "TLS_RSA_WITH_AES_128_GCM_SHA256"
|
||||
---
|
||||
apiVersion: traefik.containo.us/v1alpha1
|
||||
kind: Middleware
|
||||
metadata:
|
||||
name: mtls-auth
|
||||
spec:
|
||||
headers:
|
||||
customRequestHeaders:
|
||||
X-Client-Cert: ""
|
||||
customResponseHeaders:
|
||||
X-mTLS-Verified: "true"
|
||||
# Optional: Add IP whitelist for additional security
|
||||
# ipWhiteList:
|
||||
# sourceRange:
|
||||
# - "10.0.0.0/8"
|
||||
# - "192.168.0.0/16"
|
||||
---
|
||||
apiVersion: traefik.containo.us/v1alpha1
|
||||
kind: Middleware
|
||||
metadata:
|
||||
name: security-headers
|
||||
spec:
|
||||
headers:
|
||||
customResponseHeaders:
|
||||
X-Frame-Options: "SAMEORIGIN"
|
||||
X-Content-Type-Options: "nosniff"
|
||||
X-XSS-Protection: "1; mode=block"
|
||||
Strict-Transport-Security: "max-age=31536000; includeSubDomains; preload"
|
||||
contentSecurityPolicy: "default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'"
|
||||
@@ -77,29 +77,3 @@ spec:
|
||||
targetPort: 8002
|
||||
name: http
|
||||
type: ClusterIP
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: ui-ingress
|
||||
annotations:
|
||||
cert-manager.io/cluster-issuer: letsencrypt-production-http
|
||||
# Traefik 2 mTLS Configuration
|
||||
traefik.ingress.kubernetes.io/router.tls.options: homea2-mtls@kubernetescrd
|
||||
traefik.ingress.kubernetes.io/router.middlewares: homea2-mtls-auth@kubernetescrd
|
||||
spec:
|
||||
tls:
|
||||
- hosts:
|
||||
- homea2.hottis.de
|
||||
secretName: homea2-ui-cert
|
||||
rules:
|
||||
- host: homea2.hottis.de
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: ui
|
||||
port:
|
||||
number: 80
|
||||
|
||||
Reference in New Issue
Block a user