-
Notifications
You must be signed in to change notification settings - Fork 4
/
policy-suggest-intra-k8s-namespaces.yaml
58 lines (56 loc) · 1.99 KB
/
policy-suggest-intra-k8s-namespaces.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
APIVersion: 1
label: recipe:policy-suggest:auto-secure_intra-k8s_namespaces
data:
recipes:
- name: Auto-Secure Intra-Kubernetes Namespaces
description: Creates a Network Ruleset Policy to allow Kubernetes namespace traffic.
label: recipe:policy-suggest:auto-secure_intra-k8s_namespaces
metadata:
- "@aporeto:author=aporeto"
associatedTags:
- "aporeto:recipe:placement=policy-suggest"
- "aporeto:recipe:placement=intra-namespace"
- "aporeto:recipe:placement=kubernetes-level"
deploymentMode: NamespaceUnique
targetIdentities:
- networkrulesetpolicy
propagate: true
longDescription: |-
### Auto-secure intra-kubernetes namespaces
This recipe will create a Network Ruleset Policy to auto-secure
a Kubernetes namespace (fourth-level namespaces).
template: |-
{{`
APIVersion: 1
data:
networkrulesetpolicies:
- name: auto-secure_intra-k8s_namespaces
description: "Ruleset automatically created by an Out of Box template."
propagate: true
subject:
{{- range $index, $orgmeta := .Aporeto.OrganizationalMetadata }}
{{- if eq $index 0 }}
- - {{ $orgmeta | quote }}
{{- else }}
- {{ $orgmeta | quote }}
{{- end }}
{{- end }}
incomingRules:
- action: Allow
protocolPorts:
- any
object:
- - "$identity=processingunit"
{{- range $_, $orgmeta := .Aporeto.OrganizationalMetadata }}
- {{ $orgmeta | quote }}
{{- end }}
outgoingRules:
- action: Allow
protocolPorts:
- any
object:
- - "$identity=processingunit"
{{- range $_, $orgmeta := .Aporeto.OrganizationalMetadata }}
- {{ $orgmeta | quote }}
{{- end }}
`}}