approval-engine/deploy/networkpolicies.yaml

90 lines
2.5 KiB
YAML
Raw Normal View History

apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: approval-engine-default-deny
namespace: approval-engine
spec:
podSelector: {}
policyTypes: [Ingress, Egress]
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: approval-engine-callers
namespace: approval-engine
spec:
podSelector:
matchLabels:
app.kubernetes.io/name: approval-engine
policyTypes: [Ingress]
ingress:
- from:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: secrets-engine
- namespaceSelector:
matchLabels:
railiance.io/approval-engine-client: "true"
ports:
- {protocol: TCP, port: 8080}
---
# NetKingdom bounded executor (NK-WP-0056, APPROVAL-WP-0007; hub request
# 39a3bffa). One Job per admission in namespace sso, ServiceAccount
# nk-bind-executor. It GETs and consumes its own approval on 8080.
# Pod-scoped on purpose: namespaceSelector and podSelector sit in ONE `from`
# element, so both must match. Labelling all of sso as an approval-engine
# client would also admit KeyCape, Authelia and LLDAP. Network admission is
# not authority: the executor still needs its KeyCape token and scopes.
# Prepared in source; live apply is founder-run.
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: approval-engine-bounded-executor
namespace: approval-engine
spec:
podSelector:
matchLabels:
app.kubernetes.io/name: approval-engine
policyTypes: [Ingress]
ingress:
- from:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: sso
podSelector:
matchLabels:
app.kubernetes.io/name: bounded-executor
ports:
- {protocol: TCP, port: 8080}
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: approval-engine-egress
namespace: approval-engine
spec:
podSelector:
matchLabels:
app.kubernetes.io/name: approval-engine
policyTypes: [Egress]
egress:
- to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: sso
ports:
- {protocol: TCP, port: 8080}
- to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: audit-core
ports:
- {protocol: TCP, port: 8080}
- to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: kube-system
ports:
- {protocol: UDP, port: 53}
- {protocol: TCP, port: 53}