2019-10-09 18:52:48 -07:00
|
|
|
apiVersion: kyverno.io/v1alpha1
|
|
|
|
kind: ClusterPolicy
|
|
|
|
metadata:
|
2019-10-10 11:08:20 -07:00
|
|
|
name: default-deny-ingress-networkpolicy
|
2019-10-11 18:57:16 -07:00
|
|
|
annotations:
|
|
|
|
policies.kyverno.io/category: NetworkPolicy
|
2019-10-14 16:33:19 -07:00
|
|
|
policies.kyverno.io/description: By default, Kubernetes allows all ingress and egress traffic
|
|
|
|
to and from pods within a cluster. A "default" NetworkPolicy resource for a namespace should
|
|
|
|
be used to deny all ingress traffic to the pods in that namespace. Additional NetworkPolicy
|
|
|
|
resources can then be configured to allow desired traffic to application pods.
|
2019-10-09 18:52:48 -07:00
|
|
|
spec:
|
|
|
|
rules:
|
2019-10-10 11:08:20 -07:00
|
|
|
- name: "default-deny-ingress"
|
2019-10-09 18:52:48 -07:00
|
|
|
match:
|
|
|
|
resources:
|
|
|
|
kinds:
|
|
|
|
- Namespace
|
2019-10-09 23:46:18 -07:00
|
|
|
name: "*"
|
2019-10-09 18:52:48 -07:00
|
|
|
generate:
|
|
|
|
kind: NetworkPolicy
|
2019-10-10 11:08:20 -07:00
|
|
|
name: default-deny-ingress
|
2019-10-09 18:52:48 -07:00
|
|
|
data:
|
|
|
|
spec:
|
|
|
|
# select all pods in the namespace
|
|
|
|
podSelector: {}
|
|
|
|
policyTypes:
|
2019-10-14 10:47:54 -07:00
|
|
|
- Ingress
|