Skip to content

Instantly share code, notes, and snippets.

@mauriciovasquezbernal
Last active May 26, 2021 18:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mauriciovasquezbernal/530f20658beacbe1abaf22f60690b63a to your computer and use it in GitHub Desktop.
Save mauriciovasquezbernal/530f20658beacbe1abaf22f60690b63a to your computer and use it in GitHub Desktop.
Cilium-SPIFFE integration tools
apiVersion: "cilium.io/v2"
kind: CiliumNetworkPolicy
metadata:
name: "deny-all-egress"
spec:
endpointSelector:
{}
egress:
- {}
# Allow pods running with the default service account to contact pods
# running with the foo service account.
apiVersion: "cilium.io/v2"
kind: CiliumNetworkPolicy
metadata:
name: "spiffe-based"
spec:
endpointSelector:
matchLabels:
spiffe://example.org/ns/default/sa/default: ""
egress:
- toEndpoints:
- matchLabels:
spiffe://example.org/ns/default/sa/foo: ""
apiVersion: "cilium.io/v2"
kind: CiliumNetworkPolicy
metadata:
name: "tls-upgrade"
spec:
endpointSelector:
matchLabels:
type: mypod
egress:
- toPorts:
- ports:
- port: "8443"
protocol: "TCP"
originatingTLS:
spiffe:
peerIDs:
- spiffe://example.org/server
rules:
http:
- {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment