-
Notifications
You must be signed in to change notification settings - Fork 551
/
peer_authentication.pb.html
210 lines (200 loc) · 5.61 KB
/
peer_authentication.pb.html
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
---
title: PeerAuthentication
description: Peer authentication configuration for workloads.
location: https://istio.io/docs/reference/config/security/peer_authentication.html
layout: protoc-gen-docs
generator: protoc-gen-docs
schema: istio.security.v1beta1.PeerAuthentication
aliases: [/docs/reference/config/security/v1beta1/peer_authentication]
number_of_entries: 3
---
<h2 id="PeerAuthentication">PeerAuthentication</h2>
<section>
<p>PeerAuthentication defines mutual TLS (mTLS) requirements for incoming connections.</p>
<p>In sidecar mode, PeerAuthentication determines whether or not mTLS is allowed or required
for connections to an Envoy proxy sidecar.</p>
<p>In ambient mode, security is transparently enabled for a pod by the ztunnel node agent.
(Traffic between proxies uses the HBONE protocol, which includes encryption with mTLS.)
Because of this, <code>DISABLE</code> mode is not supported.
<code>STRICT</code> mode is useful to ensure that connections that bypass the mesh are not possible.</p>
<p>Examples:</p>
<p>Policy to require mTLS traffic for all workloads under namespace <code>foo</code>:</p>
<pre><code class="language-yaml">apiVersion: security.istio.io/v1
kind: PeerAuthentication
metadata:
name: default
namespace: foo
spec:
mtls:
mode: STRICT
</code></pre>
<p>For mesh level, put the policy in root-namespace according to your Istio installation.</p>
<p>Policies to allow both mTLS and plaintext traffic for all workloads under namespace <code>foo</code>, but
require mTLS for workload <code>finance</code>.</p>
<pre><code class="language-yaml">apiVersion: security.istio.io/v1
kind: PeerAuthentication
metadata:
name: default
namespace: foo
spec:
mtls:
mode: PERMISSIVE
---
apiVersion: security.istio.io/v1
kind: PeerAuthentication
metadata:
name: finance
namespace: foo
spec:
selector:
matchLabels:
app: finance
mtls:
mode: STRICT
</code></pre>
<p>Policy that enables strict mTLS for all <code>finance</code> workloads, but leaves the port <code>8080</code> to
plaintext. Note the port value in the <code>portLevelMtls</code> field refers to the port
of the workload, not the port of the Kubernetes service.</p>
<pre><code class="language-yaml">apiVersion: security.istio.io/v1
kind: PeerAuthentication
metadata:
name: default
namespace: foo
spec:
selector:
matchLabels:
app: finance
mtls:
mode: STRICT
portLevelMtls:
8080:
mode: DISABLE
</code></pre>
<p>Policy that inherits mTLS mode from namespace (or mesh) settings, and disables
mTLS for workload port <code>8080</code>.</p>
<pre><code class="language-yaml">apiVersion: security.istio.io/v1
kind: PeerAuthentication
metadata:
name: default
namespace: foo
spec:
selector:
matchLabels:
app: finance
mtls:
mode: UNSET
portLevelMtls:
8080:
mode: DISABLE
</code></pre>
<table class="message-fields">
<thead>
<tr>
<th>Field</th>
<th>Type</th>
<th>Description</th>
<th>Required</th>
</tr>
</thead>
<tbody>
<tr id="PeerAuthentication-selector">
<td><code>selector</code></td>
<td><code><a href="https://istio.io/docs/reference/config/type/workload-selector.html#WorkloadSelector">WorkloadSelector</a></code></td>
<td>
<p>The selector determines the workloads to apply the PeerAuthentication on. The selector will match with workloads in the
same namespace as the policy. If the policy is in the root namespace, the selector will additionally match with workloads in all namespace.</p>
<p>If not set, the policy will be applied to all workloads in the same namespace as the policy. If it is in the root namespace, it would be applied
to all workloads in the mesh.</p>
</td>
<td>
No
</td>
</tr>
<tr id="PeerAuthentication-mtls">
<td><code>mtls</code></td>
<td><code><a href="#PeerAuthentication-MutualTLS">MutualTLS</a></code></td>
<td>
<p>Mutual TLS settings for workload. If not defined, inherit from parent.</p>
</td>
<td>
No
</td>
</tr>
<tr id="PeerAuthentication-port_level_mtls">
<td><code>portLevelMtls</code></td>
<td><code>map<uint32, <a href="#PeerAuthentication-MutualTLS">MutualTLS</a>></code></td>
<td>
<p>Port specific mutual TLS settings. These only apply when a workload selector
is specified. The port refers to the port of the workload, not the port of the
Kubernetes service.</p>
</td>
<td>
No
</td>
</tr>
</tbody>
</table>
</section>
<h2 id="PeerAuthentication-MutualTLS">PeerAuthentication.MutualTLS</h2>
<section>
<p>Mutual TLS settings.</p>
<table class="message-fields">
<thead>
<tr>
<th>Field</th>
<th>Type</th>
<th>Description</th>
<th>Required</th>
</tr>
</thead>
<tbody>
<tr id="PeerAuthentication-MutualTLS-mode">
<td><code>mode</code></td>
<td><code><a href="#PeerAuthentication-MutualTLS-Mode">Mode</a></code></td>
<td>
<p>Defines the mTLS mode used for peer authentication.</p>
</td>
<td>
No
</td>
</tr>
</tbody>
</table>
</section>
<h2 id="PeerAuthentication-MutualTLS-Mode">PeerAuthentication.MutualTLS.Mode</h2>
<section>
<table class="enum-values">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr id="PeerAuthentication-MutualTLS-Mode-UNSET">
<td><code>UNSET</code></td>
<td>
<p>Inherit from parent, if has one. Otherwise treated as <code>PERMISSIVE</code>.</p>
</td>
</tr>
<tr id="PeerAuthentication-MutualTLS-Mode-DISABLE">
<td><code>DISABLE</code></td>
<td>
<p>Connection is not tunneled.</p>
</td>
</tr>
<tr id="PeerAuthentication-MutualTLS-Mode-PERMISSIVE">
<td><code>PERMISSIVE</code></td>
<td>
<p>Connection can be either plaintext or mTLS tunnel.</p>
</td>
</tr>
<tr id="PeerAuthentication-MutualTLS-Mode-STRICT">
<td><code>STRICT</code></td>
<td>
<p>Connection is an mTLS tunnel (TLS with client cert must be presented).</p>
</td>
</tr>
</tbody>
</table>
</section>