@@ -18,7 +18,7 @@ Teleport today supports per-session MFA for enhanced security. However, when a
18
18
user needs to run queries on multiple database hosts simultaneously, they have
19
19
to perform a tap for every connection.
20
20
21
- A relaxed mode of per-session MFA will be introduced so that a MFA challenge is
21
+ A relaxed mode of per-session MFA will be introduced so that an MFA challenge is
22
22
still required for connecting to target databases but the MFA response can be
23
23
reused for a short period of time without the need to prompt the user again in
24
24
that period.
@@ -67,8 +67,7 @@ Executing command for 'mysql-db2':
67
67
mysql-db2-hostname
68
68
```
69
69
70
- I would like to search databases by labels, run the sql scripts in parallel, and
71
- record the outputs to a directory:
70
+ I would like to search databases by labels and run the sql scripts in parallel:
72
71
``` bash
73
72
$ tsh db exec --search-by-labels env=dev --db-user mysql --exec-query " source my_script.sql" --log-dir exec-logs --max-connections 3
74
73
Found 5 databases:
@@ -132,6 +131,7 @@ spec:
132
131
+ # supported for `tsh db exec` command with WebAuthn as the second factor.
133
132
+ requie_session_mfa_mode: "multi-session"
134
133
```
134
+
135
135
Mode defaults to ` per-session ` if not set. If a resource matches a role set with
136
136
some roles on ` per-session ` but others on ` multi-session ` , the stricter mode
137
137
` per-session ` should be applied.
@@ -181,15 +181,18 @@ General flow of the command:
181
181
- Fetch roles and use access checker to determine MFA requirement.
182
182
- For each database:
183
183
- Prompt MFA if necessary.
184
- - Starts a local proxy in tunnel mode for this database.
184
+ - Starts a local proxy in tunnel mode for this database (regardless of cluster
185
+ proxy listener mode).
185
186
- Craft a command for ` os.exec ` . The command is not interactive (e.g. does not
186
- take in ` stdin ` input). Outputs are printed to ` stdout ` unless ` --log-dir `
187
+ take in ` stdin ` for input). Outputs are printed to ` stdout ` unless ` --log-dir `
187
188
is specified.
188
189
- Execute the command.
189
190
190
191
The command supports searching database by specifying one the following flags:
191
- - ` --search ` : List of comma separated search keywords or phrases enclosed in quotations, e.g. ` --search=foo,bar `
192
- - ` --search-by-labels ` : List of comma separated labels to filter by labels, e.g. ` key1=value1,key2=value2 `
192
+ - ` --search ` : List of comma separated search keywords or phrases enclosed in
193
+ quotations, e.g. ` --search=foo,bar ` .
194
+ - ` --search-by-labels ` : List of comma separated labels to filter by labels, e.g.
195
+ ` key1=value1,key2=value2 ` .
193
196
- ` --search-by-query ` : Query by predicate language enclosed in single quotes.
194
197
195
198
The command presents the search results then asks user to confirm before
@@ -199,7 +202,7 @@ Some other details:
199
202
- If the multi-session MFA response is expired, the command should ask for MFA
200
203
again.
201
204
- For MVP implementation, only PostgreSQL and MySQL databases will be supported.
202
- - A warning will be printed if the target databases have different protocols
205
+ And a warning will be printed if the target databases have different protocols
203
206
(e.g. ` postgres ` vs ` mysql ` ).
204
207
- For databases that require per-session MFA, a prompt will still be presented
205
208
per database.
@@ -210,9 +213,27 @@ Some other details:
210
213
database or per search.
211
214
- ` tsh db exec --exec-command ` to support custom command template like `$ tsh
212
215
db exec --exec-command "bash -c './myscript {{.DB_SERVICE}} {{.DB_USER}}
213
- {{.DB_LOCAL_PORT}}'"` . An env var ` TSH_UNSTABLE_DB_EXEC_COMMAND` can be
214
- supported for the initial MVP.
216
+ {{.DB_NAME}} {{. DB_LOCAL_PORT}}'"` . An env var ` TSH_UNSTABLE_DB_EXEC_COMMAND`
217
+ can be supported for the initial MVP.
215
218
216
219
### Security
217
220
218
- TODO
221
+ There is no change regarding security for existing users, unless their Teleport
222
+ admins set the ` multi-session ` mode in the role option.
223
+
224
+ Since the mode is configured at the role level, the mode will only be applied to
225
+ the resources that matches the role (e.g. ` role.allow.db_labels ` ). And if
226
+ another role matching the resource has the stricter mode ` per-session ` , the
227
+ stricter mode will be applied.
228
+
229
+ The negative implications of the ` multi-session ` is the same as outlined in [ RFD
230
+ 155 Scoped Webauthn
231
+ Credentials] ( https://github.com/gravitational/teleport/blob/master/rfd/0155-scoped-webauthn-credentials.md ) :
232
+
233
+ 1 . The webauthn credential's scope is provided by the client
234
+ 2 . Reuse is requested by the client
235
+ 3 . Reuse is permitted for the action - server enforced
236
+ 4 . The expiration of the credentials - server enforced (5 minutes)
237
+
238
+ However, the new scope ` SCOPE_DATABASE_MULTI_SESSION ` will be limited to only
239
+ database sessions.
0 commit comments