feat(irc): migrate from Cilium to Istio AuthorizationPolicies
Best Practices / Kube-score Analysis (push) Failing after 6s
Security Scan / Trivy PR Review (push) Has been skipped
Best Practices / Polaris PR Review (push) Has been skipped
Security Scan / Checkov PR Review (push) Has been skipped
Validate Manifests / YAML Lint (push) Successful in 4s
Validate Manifests / Kustomize Build Test (push) Successful in 3s
Security Scan / Trivy Security Scan (push) Successful in 12s
Best Practices / Polaris Audit (push) Failing after 9s
Best Practices / Resource Usage Analysis (push) Successful in 5s
Best Practices / PR Summary Report (push) Has been skipped
Validate Manifests / Kubernetes Schema Validation (push) Successful in 6s
Security Scan / Checkov IaC Scan (push) Failing after 52s
Best Practices / Kube-score Analysis (push) Failing after 6s
Security Scan / Trivy PR Review (push) Has been skipped
Best Practices / Polaris PR Review (push) Has been skipped
Security Scan / Checkov PR Review (push) Has been skipped
Validate Manifests / YAML Lint (push) Successful in 4s
Validate Manifests / Kustomize Build Test (push) Successful in 3s
Security Scan / Trivy Security Scan (push) Successful in 12s
Best Practices / Polaris Audit (push) Failing after 9s
Best Practices / Resource Usage Analysis (push) Successful in 5s
Best Practices / PR Summary Report (push) Has been skipped
Validate Manifests / Kubernetes Schema Validation (push) Successful in 6s
Security Scan / Checkov IaC Scan (push) Failing after 52s
Replace CiliumNetworkPolicies with Istio AuthorizationPolicies, point the thelounge HTTPRoute at the istio-external gateway, and give each workload a dedicated ServiceAccount for precise mTLS identity. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,15 @@
|
|||||||
|
apiVersion: security.istio.io/v1
|
||||||
|
kind: AuthorizationPolicy
|
||||||
|
metadata:
|
||||||
|
name: thelounge
|
||||||
|
namespace: irc
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app.kubernetes.io/name: thelounge
|
||||||
|
action: ALLOW
|
||||||
|
rules:
|
||||||
|
- from:
|
||||||
|
- source:
|
||||||
|
principals:
|
||||||
|
- cluster.local/ns/gateway-system/sa/istio-external-istio
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
apiVersion: cilium.io/v2
|
|
||||||
kind: CiliumNetworkPolicy
|
|
||||||
metadata:
|
|
||||||
name: thelounge
|
|
||||||
namespace: irc
|
|
||||||
spec:
|
|
||||||
endpointSelector:
|
|
||||||
matchLabels:
|
|
||||||
app.kubernetes.io/name: thelounge
|
|
||||||
ingress:
|
|
||||||
- fromEntities:
|
|
||||||
- ingress
|
|
||||||
- host
|
|
||||||
toPorts:
|
|
||||||
- ports:
|
|
||||||
- port: "9000"
|
|
||||||
protocol: TCP
|
|
||||||
egress:
|
|
||||||
- toEndpoints:
|
|
||||||
- matchLabels:
|
|
||||||
k8s:io.kubernetes.pod.namespace: kube-system
|
|
||||||
k8s:k8s-app: kube-dns
|
|
||||||
toPorts:
|
|
||||||
- ports:
|
|
||||||
- port: "53"
|
|
||||||
protocol: ANY
|
|
||||||
rules:
|
|
||||||
dns:
|
|
||||||
- matchPattern: "*"
|
|
||||||
- toEndpoints:
|
|
||||||
- matchLabels:
|
|
||||||
k8s:io.kubernetes.pod.namespace: auth
|
|
||||||
k8s:app.kubernetes.io/name: authentik-outpost-ldap
|
|
||||||
k8s:goauthentik.io/outpost-type: ldap
|
|
||||||
toPorts:
|
|
||||||
- ports:
|
|
||||||
- port: "389"
|
|
||||||
protocol: TCP
|
|
||||||
- toEndpoints:
|
|
||||||
- matchLabels:
|
|
||||||
k8s:io.kubernetes.pod.namespace: irc
|
|
||||||
k8s:app.kubernetes.io/name: znc
|
|
||||||
toPorts:
|
|
||||||
- ports:
|
|
||||||
- port: "6501"
|
|
||||||
protocol: TCP
|
|
||||||
- toFQDNs:
|
|
||||||
- matchName: "irc.passthepopcorn.me"
|
|
||||||
toPorts:
|
|
||||||
- ports:
|
|
||||||
- port: "6697"
|
|
||||||
protocol: TCP
|
|
||||||
@@ -5,7 +5,7 @@ metadata:
|
|||||||
namespace: irc
|
namespace: irc
|
||||||
spec:
|
spec:
|
||||||
parentRefs:
|
parentRefs:
|
||||||
- name: external
|
- name: istio-external
|
||||||
namespace: gateway-system
|
namespace: gateway-system
|
||||||
hostnames:
|
hostnames:
|
||||||
- ${THELOUNGE_HOSTNAME}
|
- ${THELOUNGE_HOSTNAME}
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
|
- serviceaccount.yaml
|
||||||
- statefulset.yaml
|
- statefulset.yaml
|
||||||
- service.yaml
|
- service.yaml
|
||||||
- httproute.yaml
|
- httproute.yaml
|
||||||
- ciliumnetworkpolicy.yaml
|
- authorizationpolicy.yaml
|
||||||
- config.yaml
|
- config.yaml
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ServiceAccount
|
||||||
|
metadata:
|
||||||
|
name: thelounge
|
||||||
|
namespace: irc
|
||||||
|
automountServiceAccountToken: false
|
||||||
@@ -21,6 +21,7 @@ spec:
|
|||||||
app.kubernetes.io/instance: thelounge
|
app.kubernetes.io/instance: thelounge
|
||||||
spec:
|
spec:
|
||||||
priorityClassName: low-priority
|
priorityClassName: low-priority
|
||||||
|
serviceAccountName: thelounge
|
||||||
automountServiceAccountToken: false
|
automountServiceAccountToken: false
|
||||||
securityContext:
|
securityContext:
|
||||||
runAsNonRoot: true
|
runAsNonRoot: true
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
apiVersion: security.istio.io/v1
|
||||||
|
kind: AuthorizationPolicy
|
||||||
|
metadata:
|
||||||
|
name: znc
|
||||||
|
namespace: irc
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app.kubernetes.io/name: znc
|
||||||
|
action: ALLOW
|
||||||
|
rules:
|
||||||
|
- from:
|
||||||
|
- source:
|
||||||
|
principals:
|
||||||
|
- cluster.local/ns/irc/sa/thelounge
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
apiVersion: cilium.io/v2
|
|
||||||
kind: CiliumNetworkPolicy
|
|
||||||
metadata:
|
|
||||||
name: znc
|
|
||||||
namespace: irc
|
|
||||||
spec:
|
|
||||||
endpointSelector:
|
|
||||||
matchLabels:
|
|
||||||
app.kubernetes.io/name: znc
|
|
||||||
ingress:
|
|
||||||
- fromEndpoints:
|
|
||||||
- matchLabels:
|
|
||||||
k8s:io.kubernetes.pod.namespace: irc
|
|
||||||
k8s:app.kubernetes.io/name: thelounge
|
|
||||||
toPorts:
|
|
||||||
- ports:
|
|
||||||
- port: "6501"
|
|
||||||
protocol: TCP
|
|
||||||
- fromEntities:
|
|
||||||
- host
|
|
||||||
toPorts:
|
|
||||||
- ports:
|
|
||||||
- port: "6501"
|
|
||||||
protocol: TCP
|
|
||||||
egress:
|
|
||||||
- toEndpoints:
|
|
||||||
- matchLabels:
|
|
||||||
k8s:io.kubernetes.pod.namespace: kube-system
|
|
||||||
k8s:k8s-app: kube-dns
|
|
||||||
toPorts:
|
|
||||||
- ports:
|
|
||||||
- port: "53"
|
|
||||||
protocol: ANY
|
|
||||||
rules:
|
|
||||||
dns:
|
|
||||||
- matchPattern: "*"
|
|
||||||
- toFQDNs:
|
|
||||||
- matchName: "irc.passthepopcorn.me"
|
|
||||||
toPorts:
|
|
||||||
- ports:
|
|
||||||
- port: "6697"
|
|
||||||
protocol: TCP
|
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
|
- serviceaccount.yaml
|
||||||
- statefulset.yaml
|
- statefulset.yaml
|
||||||
- service.yaml
|
- service.yaml
|
||||||
- ciliumnetworkpolicy.yaml
|
- authorizationpolicy.yaml
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ServiceAccount
|
||||||
|
metadata:
|
||||||
|
name: znc
|
||||||
|
namespace: irc
|
||||||
|
automountServiceAccountToken: false
|
||||||
@@ -30,6 +30,7 @@ spec:
|
|||||||
app.kubernetes.io/instance: znc
|
app.kubernetes.io/instance: znc
|
||||||
spec:
|
spec:
|
||||||
priorityClassName: low-priority
|
priorityClassName: low-priority
|
||||||
|
serviceAccountName: znc
|
||||||
automountServiceAccountToken: false
|
automountServiceAccountToken: false
|
||||||
containers:
|
containers:
|
||||||
- name: znc
|
- name: znc
|
||||||
|
|||||||
Reference in New Issue
Block a user