Skip to content

Commit 4871dba

Browse files
mrogala-saucekonraddysputAgaOSaucemarkamsauce
authored
Release 5.4.1 version with Kerberos authentication support (#3354)
* Add Kerberos authentication info to docs * update download links * Update sc_run.md Editorial review --------- Co-authored-by: Konrad Dysput <[email protected]> Co-authored-by: AgaOSauce <[email protected]> Co-authored-by: Marcin Kamiński <[email protected]>
1 parent f1753e7 commit 4871dba

File tree

5 files changed

+153
-18
lines changed

5 files changed

+153
-18
lines changed

docs/dev/cli/sauce-connect-5/sc_run.md

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ Example:
206206
--proxy myproxy.org:3128 --proxy-sauce https://external.com:443 --auth user1:[email protected]:3128,user2:[email protected]:*
207207
```
208208

209+
209210
### `--debug-address` {#debug-address}
210211

211212
* Environment variable: `SAUCE_DEBUG_ADDRESS`
@@ -283,6 +284,14 @@ Establish a tunnel through an upstream proxy.
283284
Proxy for requests to Sauce Labs REST API and Sauce Connect servers only.
284285
See the -x, --proxy flag for more details on the format.
285286

287+
### --proxy-sauce-enable-kerberos-auth {#proxy-sauce-enable-kerberos-auth}
288+
289+
* Environment variable: `SAUCE_PROXY_SAUCE_ENABLE_KERBEROS_AUTH`
290+
* Value Format: `<value>` (you can use empty command line switch to enable)
291+
* Default Value: `false`
292+
293+
Authenticate to proxy specified in `--proxy-sauce` using Kerberos. Kerberos authentication must be enabled and configured for `sc`.
294+
286295
## DNS
287296

288297
### `--dns-round-robin` {#dns-round-robin}
@@ -466,6 +475,132 @@ The following example specifies that the API module logs errors, the proxy modul
466475

467476
Log level.
468477

478+
## Kerberos authentication
479+
480+
### Introduction
481+
482+
Sauce Connect 5 supports Kerberos authentication for both upstream proxy and tested applications.
483+
484+
The `sc` client process connects to your Kerberos KDC server, authenticates as the configured account ("principal name") and retrieves relevant Kerberos service tickets. Kerberos connection and authentication are local only to your `sc` client - Sauce Labs servers do not participate in it.
485+
486+
It is also fully transparent to your tests as `sc` injects relevant HTTP headers with Kerberos authentication tokens automatically for all needed requests forwarded through the tunnel.
487+
488+
Supported modes:
489+
490+
* Kerberos authentication to the upstream proxy defined in `--proxy-sauce` - using `Proxy-Authorization` HTTP header
491+
* Kerberos authentication to the upstream proxy defined in `--proxy` - using `Proxy-Authorization` HTTP header
492+
* Kerberos authentication to tested web applications by injecting `Authorization` header to forwarded HTTP requests
493+
494+
It is possible to have combination of settings - for example when both upstream proxy and tested application require Kerberos authentication
495+
496+
Sauce Connect 5 generates SPNEGO tokens from relevant Kerberos tickets to pass in HTTP headers which is the most popular and standardized way of handling Kerberos HTTP authentication.
497+
498+
Implemented method is called "opportunistic authentication", meaning that `sc` does not try to detect `401` or `407` HTTP error codes and negotiate Kerberos authentication - it uses predefined host names needing Kerberos authentication and it's up to the user to know those hosts in advance. This greatly improves performance and does not interfere with your tests which may require detection and custom handling of `401` and other error codes.
499+
500+
Current implementation uses HTTP request host (or configured proxy hostname) as SPN (Service Principal Name) to request tickets from Kerberos KDC server. For example `app.example.com` is converted to SPN `HTTP/app.example.com` and such SPN is expected to be present in Kerberos KDC server.
501+
502+
To use Kerberos authentication mechanism, you must have both a `krb5.conf` file, which points to proper realms and Kerberos servers and keytab file accessible to `sc` client. Those are standardized format files used in most Kerberos related software suites and are not specific to Sauce Connect 5 client.
503+
504+
### --kerberos-cfg-file {#kerberos-cfg-file}
505+
506+
* Environment variable: `SAUCE_KERBEROS_CFG_FILE`
507+
* Value Format: `<path>`
508+
509+
Path to krb5.conf configuration file with kerberos connection settings.
510+
File format reference:
511+
512+
https://web.mit.edu/kerberos/krb5-1.12/doc/admin/conf_files/krb5_conf.html
513+
514+
515+
### --kerberos-keytab-file {#kerberos-cfg-file}
516+
517+
* Environment variable: `SAUCE_KERBEROS_KEYTAB_FILE`
518+
* Value Format: `<path>`
519+
520+
Path to keytab file holding credentials to an account as which `sc` authenticates to a Kerberos KDC server.
521+
522+
Keytab files are in binary format and can be created and managed for example using `ktutil` tool distributed with MIT Kerberos software:
523+
https://web.mit.edu/kerberos/krb5-latest/doc/admin/admin_commands/ktutil.html#ktutil-1
524+
525+
526+
### --kerberos-user-name {#kerberos-user-name}
527+
528+
* Environment variable: `SAUCE_KERBEROS_USER_NAME`
529+
* Value Format: `<username>`
530+
531+
Name of the account username (principal name using Kerberos nomenclature) as which `sc` will authenticate to a Kerberos KDC server. User and its password (hashed) must be present in keytab file specified in `--kerberos-keytab-file`
532+
533+
### --kerberos-user-realm {#kerberos-user-realm}
534+
535+
* Environment variable: `SAUCE_KERBEROS_USER_REALM`
536+
* Value Format: `<domain name>`
537+
538+
Kerberos realm of the user specified in `--kerberos-user-name`. It depends on Kerberos settings in organisation but in most cases it's the company domain name.
539+
540+
541+
### --kerberos-enabled-hosts {#kerberos-enabled-hosts}
542+
543+
* Environment variable: `SAUCE_KERBEROS_ENABLED_HOSTS`
544+
* Value Format: `host1,host2,host3....`
545+
546+
List of hosts for which Kerberos (SPNEGO) authorization tokens will be injected as `Authorization` header. If a forwarded HTTP request already has such header (or header is added by `sc` by means of other settings, like custom headers or credentials) - this header value will be overwritten by SPNEGO token.
547+
548+
Please note that this host list does not support wildcards.
549+
550+
551+
### --kerberos-auth-upstream-proxy {#kerberos-auth-upstream-proxy}
552+
553+
* Environment variable: `SAUCE_KERBEROS_AUTH_UPSTREAM_PROXY`
554+
* Value Format: `<value>` (you can use empty command-line switch to enable)
555+
* Default Value: `false`
556+
557+
Authenticate to a configured upstream proxy with Kerberos (using `Proxy-Authorization` HTTP header). Please note that if `sc` configuration results in multiple proxies available (like PAC for example), `sc` will try to authenticate with Kerberos to each one of them.
558+
559+
To enable Kerberos authentication for `--proxy-sauce` specified proxy server, see: [--proxy-sauce-enable-kerberos-auth](#proxy-sauce-enable-kerberos-auth)
560+
561+
562+
### --kerberos-run-diagnostics {#kerberos-run-diagnostics}
563+
564+
* Environment variable: `SAUCE_KERBEROS_RUN_DIAGNOSTICS`
565+
* Value Format: `<value>` (you can use empty commant switch to enable)
566+
* Default Value: `false`
567+
568+
569+
Running `sc` with `--kerberos-run-diagnostics` switch will run basic Kerberos diagnostics and exit the process.
570+
571+
Diagnostics will print debugging information about Kerberos connection or known configuration errors - for example an error when there are discrepancies between supported encryption types and keytab entry:
572+
573+
```
574+
msg="fatal error exiting" error="kerberos configuration potential problems: default_tkt_enctypes specifies 17 but this enctype is not available in the client's keytab\ndefault_tkt_enctypes specifies 23 but this enctype is not available in the client's keytab\npreferred_preauth_types specifies 17 but this enctype is not available in the client's keytab\npreferred_preauth_types specifies 15 but this enctype is not available in the client's keytab\npreferred_preauth_types specifies 14 but this enctype is not available in the client's keytab"
575+
```
576+
577+
Diagnostics printout will allow you to match enctype number to string:
578+
579+
```
580+
"DefaultTGSEnctypes": [
581+
"aes256-cts-hmac-sha1-96",
582+
"aes128-cts-hmac-sha1-96",
583+
"des3-cbc-sha1",
584+
"arcfour-hmac-md5",
585+
"camellia256-cts-cmac",
586+
"camellia128-cts-cmac",
587+
"des-cbc-crc",
588+
"des-cbc-md5",
589+
"des-cbc-md4"
590+
],
591+
"DefaultTGSEnctypeIDs": [
592+
18,
593+
17,
594+
23
595+
],
596+
597+
```
598+
599+
(17 is aes128-cts-hmac-sha1-96, etc)
600+
601+
Often having only one enctype in user configuration will work but can break at any time if hosts decide to negotiate something different than usual. For simplification you can restrict supported encryption types to 1-2 entries in krb5.conf file. The enctypes listed in diagnostics mode are sorted from most secure to least secure so in most cases first 1-2 positions are good enough to choose from and check if KDC server supports them. When in doubt - contact your Active Directory or Kerberos administrator.
602+
603+
469604
## Formatting Domains
470605

471606
Here are some guidelines to follow when formatting domain regular expressions:

docs/secure-connections/sauce-connect-5/installation.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Visit the following pages for installation instructions for your platform:
1717

1818
If you prefer to perform a custom installation, you can download the Sauce Connect binaries from the following links.
1919

20-
SHA256 checksums are available [on this page](https://saucelabs.com/downloads/sauce-connect/5.3.1/checksums).
20+
SHA256 checksums are available [on this page](https://saucelabs.com/downloads/sauce-connect/5.4.1/checksums).
2121

2222
<table>
2323
<tr>
@@ -27,51 +27,51 @@ SHA256 checksums are available [on this page](https://saucelabs.com/downloads/sa
2727
<tr>
2828
<td rowspan="3">Linux x86_64</td>
2929
<td>
30-
<a href="https://saucelabs.com/downloads/sauce-connect/5.3.1/sauce-connect-5.3.1_linux.x86_64.tar.gz">https://saucelabs.com/downloads/sauce-connect/5.3.1/sauce-connect-5.3.1_linux.x86_64.tar.gz</a>
30+
<a href="https://saucelabs.com/downloads/sauce-connect/5.4.1/sauce-connect-5.4.1_linux.x86_64.tar.gz">https://saucelabs.com/downloads/sauce-connect/5.4.1/sauce-connect-5.4.1_linux.x86_64.tar.gz</a>
3131
</td>
3232
</tr>
3333
<tr>
3434
<td>
35-
<a href="https://saucelabs.com/downloads/sauce-connect/5.3.1/sauce-connect_5.3.1.linux_amd64.deb">https://saucelabs.com/downloads/sauce-connect/5.3.1/sauce-connect_5.3.1.linux_amd64.deb</a>
35+
<a href="https://saucelabs.com/downloads/sauce-connect/5.4.1/sauce-connect_5.4.1.linux_amd64.deb">https://saucelabs.com/downloads/sauce-connect/5.4.1/sauce-connect_5.4.1.linux_amd64.deb</a>
3636
</td>
3737
</tr>
3838
<tr>
3939
<td>
40-
<a href="https://saucelabs.com/downloads/sauce-connect/5.3.1/sauce-connect-5.3.1_linux.x86_64.rpm">https://saucelabs.com/downloads/sauce-connect/5.3.1/sauce-connect-5.3.1_linux.x86_64.rpm</a>
40+
<a href="https://saucelabs.com/downloads/sauce-connect/5.4.1/sauce-connect-5.4.1_linux.x86_64.rpm">https://saucelabs.com/downloads/sauce-connect/5.4.1/sauce-connect-5.4.1_linux.x86_64.rpm</a>
4141
</td>
4242
</tr>
4343
<tr>
4444
<td rowspan="3">Linux arm64</td>
4545
<td>
46-
<a href="https://saucelabs.com/downloads/sauce-connect/5.3.1/sauce-connect-5.3.1_linux.aarch64.tar.gz">https://saucelabs.com/downloads/sauce-connect/5.3.1/sauce-connect-5.3.1_linux.aarch64.tar.gz</a>
46+
<a href="https://saucelabs.com/downloads/sauce-connect/5.4.1/sauce-connect-5.4.1_linux.aarch64.tar.gz">https://saucelabs.com/downloads/sauce-connect/5.4.1/sauce-connect-5.4.1_linux.aarch64.tar.gz</a>
4747
</td>
4848
</tr>
4949
<tr>
5050
<td>
51-
<a href="https://saucelabs.com/downloads/sauce-connect/5.3.1/sauce-connect_5.3.1.linux_arm64.deb">https://saucelabs.com/downloads/sauce-connect/5.3.1/sauce-connect_5.3.1.linux_arm64.deb</a>
51+
<a href="https://saucelabs.com/downloads/sauce-connect/5.4.1/sauce-connect_5.4.1.linux_arm64.deb">https://saucelabs.com/downloads/sauce-connect/5.4.1/sauce-connect_5.4.1.linux_arm64.deb</a>
5252
</td>
5353
</tr>
5454
<tr>
5555
<td>
56-
<a href="https://saucelabs.com/downloads/sauce-connect/5.3.1/sauce-connect-5.3.1_linux.aarch64.rpm">https://saucelabs.com/downloads/sauce-connect/5.3.1/sauce-connect-5.3.1_linux.aarch64.rpm</a>
56+
<a href="https://saucelabs.com/downloads/sauce-connect/5.4.1/sauce-connect-5.4.1_linux.aarch64.rpm">https://saucelabs.com/downloads/sauce-connect/5.4.1/sauce-connect-5.4.1_linux.aarch64.rpm</a>
5757
</td>
5858
</tr>
5959
<tr>
6060
<td>macOS</td>
6161
<td>
62-
<a href="https://saucelabs.com/downloads/sauce-connect/5.3.1/sauce-connect-5.3.1_darwin.all.zip">https://saucelabs.com/downloads/sauce-connect/5.3.1/sauce-connect-5.3.1_darwin.all.zip</a>
62+
<a href="https://saucelabs.com/downloads/sauce-connect/5.4.1/sauce-connect-5.4.1_darwin.all.zip">https://saucelabs.com/downloads/sauce-connect/5.4.1/sauce-connect-5.4.1_darwin.all.zip</a>
6363
</td>
6464
</tr>
6565
<tr>
6666
<td>Windows x86_64</td>
6767
<td>
68-
<a href="https://saucelabs.com/downloads/sauce-connect/5.3.1/sauce-connect-5.3.1_windows.x86_64.zip">https://saucelabs.com/downloads/sauce-connect/5.3.1/sauce-connect-5.3.1_windows.x86_64.zip</a>
68+
<a href="https://saucelabs.com/downloads/sauce-connect/5.4.1/sauce-connect-5.4.1_windows.x86_64.zip">https://saucelabs.com/downloads/sauce-connect/5.4.1/sauce-connect-5.4.1_windows.x86_64.zip</a>
6969
</td>
7070
</tr>
7171
<tr>
7272
<td>Windows arm64</td>
7373
<td>
74-
<a href="https://saucelabs.com/downloads/sauce-connect/5.3.1/sauce-connect-5.3.1_windows.aarch64.zip">https://saucelabs.com/downloads/sauce-connect/5.3.1/sauce-connect-5.3.1_windows.aarch64.zip</a>
74+
<a href="https://saucelabs.com/downloads/sauce-connect/5.4.1/sauce-connect-5.4.1_windows.aarch64.zip">https://saucelabs.com/downloads/sauce-connect/5.4.1/sauce-connect-5.4.1_windows.aarch64.zip</a>
7575
</td>
7676
</tr>
7777
</table>

docs/secure-connections/sauce-connect-5/installation/linux.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ defaultValue="ARM64"
2424
<TabItem value="ARM64">
2525

2626
```bash
27-
curl -L -o sauce-connect.deb https://saucelabs.com/downloads/sauce-connect/5.3.1/sauce-connect_5.3.1.linux_arm64.deb
27+
curl -L -o sauce-connect.deb https://saucelabs.com/downloads/sauce-connect/5.4.1/sauce-connect_5.4.1.linux_arm64.deb
2828
sudo dpkg -i sauce-connect.deb
2929
```
3030
</TabItem>
3131

3232
<TabItem value="x86-64">
3333

3434
```bash
35-
curl -L -o sauce-connect.deb https://saucelabs.com/downloads/sauce-connect/5.3.1/sauce-connect_5.3.1.linux_amd64.deb
35+
curl -L -o sauce-connect.deb https://saucelabs.com/downloads/sauce-connect/5.4.1/sauce-connect_5.4.1.linux_amd64.deb
3636
sudo dpkg -i sauce-connect.deb
3737
```
3838

@@ -83,14 +83,14 @@ defaultValue="ARM64"
8383
<TabItem value="ARM64">
8484

8585
```bash
86-
sudo rpm -i https://saucelabs.com/downloads/sauce-connect/5.3.1/sauce-connect-5.3.1_linux.aarch64.rpm
86+
sudo rpm -i https://saucelabs.com/downloads/sauce-connect/5.4.1/sauce-connect-5.4.1_linux.aarch64.rpm
8787
```
8888
</TabItem>
8989

9090
<TabItem value="x86-64">
9191

9292
```bash
93-
sudo rpm -i https://saucelabs.com/downloads/sauce-connect/5.3.1/sauce-connect-5.3.1_linux.x86_64.rpm
93+
sudo rpm -i https://saucelabs.com/downloads/sauce-connect/5.4.1/sauce-connect-5.4.1_linux.x86_64.rpm
9494
```
9595

9696
</TabItem>
@@ -136,7 +136,7 @@ defaultValue="ARM64"
136136
<TabItem value="ARM64">
137137

138138
```bash
139-
curl -L -o sauce-connect.tar.gz https://saucelabs.com/downloads/sauce-connect/5.3.1/sauce-connect-5.3.1_linux.aarch64.tar.gz
139+
curl -L -o sauce-connect.tar.gz https://saucelabs.com/downloads/sauce-connect/5.4.1/sauce-connect-5.4.1_linux.aarch64.tar.gz
140140
sudo mkdir -p /opt/sauce-connect
141141
sudo tar -C /opt/sauce-connect -xzf sauce-connect.tar.gz
142142
```
@@ -145,7 +145,7 @@ sudo tar -C /opt/sauce-connect -xzf sauce-connect.tar.gz
145145
<TabItem value="x86-64">
146146

147147
```bash
148-
curl -L -o sauce-connect.tar.gz https://saucelabs.com/downloads/sauce-connect/5.3.1/sauce-connect-5.3.1_linux.x86_64.tar.gz
148+
curl -L -o sauce-connect.tar.gz https://saucelabs.com/downloads/sauce-connect/5.4.1/sauce-connect-5.4.1_linux.x86_64.tar.gz
149149
sudo mkdir -p /opt/sauce-connect
150150
sudo tar -C /opt/sauce-connect -xzf sauce-connect.tar.gz
151151
```

docs/secure-connections/sauce-connect-5/installation/macos.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Sauce Connect provides `.zip` package with a signed binary that can be used on a
4949
### Unpack the zip file
5050

5151
```bash
52-
curl -L -o sauce-connect.zip https://saucelabs.com/downloads/sauce-connect/5.3.1/sauce-connect-5.3.1_darwin.all.zip
52+
curl -L -o sauce-connect.zip https://saucelabs.com/downloads/sauce-connect/5.4.1/sauce-connect-5.4.1_darwin.all.zip
5353
sudo mkdir -p /opt/sauce-connect
5454
sudo unzip -d /opt/sauce-connect sauce-connect.zip
5555
```

docs/secure-connections/sauce-connect-5/installation/windows.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ Sauce Connect provides `.zip` package that can be used on older Windows versions
8282

8383
```powershell
8484
mkdir C:\sauce-connect
85-
Invoke-WebRequest -Uri https://saucelabs.com/downloads/sauce-connect/5.3.1/sauce-connect-5.3.1_windows.x86_64.zip -OutFile sauce-connect.zip
85+
Invoke-WebRequest -Uri https://saucelabs.com/downloads/sauce-connect/5.4.1/sauce-connect-5.4.1_windows.x86_64.zip -OutFile sauce-connect.zip
8686
Expand-Archive -Path sauce-connect.zip -DestinationPath C:\sauce-connect
8787
Rename-Item -Path C:\sauce-connect\sauce-connect.exe -NewName C:\sauce-connect\sauce-connect.exe
8888
```

0 commit comments

Comments
 (0)