Skip to content

Commit 60180bd

Browse files
committed
document pomerium-cli client cert functionality
1 parent 4b0bfec commit 60180bd

File tree

2 files changed

+64
-1
lines changed

2 files changed

+64
-1
lines changed

content/docs/capabilities/tcp.mdx

+36
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,42 @@ pomerium-cli tcp tcp+https://proxy.corp.example.com:8443/redis.internal.example.
113113

114114
The command above connects to `https://pomerium.corp.example.com:8443` and then requests the TCP route for `redis.internal.example.com:6379`.
115115

116+
### Client Certificates
117+
118+
If Pomerium is configured to require client certificates, you will also need to provide a client certificate and private key when invoking the `pomerium-cli` command.
119+
120+
You can specify these either by using PEM files, or (starting in v0.25) by searching for a certificate in the system trust store (macOS and Windows only).
121+
122+
To specify a client certificate and key using PEM files:
123+
124+
```bash
125+
pomerium-cli tcp --client-cert cert.pem --client-key key.pem redis.corp.example.com:6379
126+
```
127+
128+
To search for a client certificate in the system trust store:
129+
130+
```bash
131+
pomerium-cli tcp --client-cert-from-store redis.corp.example.com:6379
132+
```
133+
134+
This will search the Keychain (on macOS) or the Windows certificate store (on Windows) for a client certificate and private key, based on the trusted CA names advertised by Pomerium in the TLS handshake.
135+
136+
If you need to select between multiple matching client certificates, you can additionally filter based on the Distinguished Name of the certificate's Issuer and/or the certificate Subject.
137+
138+
For example, to filter for a certificate directly issued by a CA with the Common Name "My Trusted CA":
139+
140+
```bash
141+
pomerium-cli tcp --client-cert-from-store --client-cert-issuer "CN=My Trusted CA" redis.corp.example.com:6379
142+
```
143+
144+
Or, to filter for a certificate whose Subject contains the Organizational Unit Name "My Department":
145+
146+
```bash
147+
pomerium-cli tcp --client-cert-from-store --client-cert-subject "OU=My Department" redis.corp.example.com:6379
148+
```
149+
150+
See the [reference page](/docs/capabilities/tcp/reference#certificate-name-filters) for more details about the certificate name filter syntax.
151+
116152
## Service-Specific Documentation
117153

118154
We've outlined how to use a TCP tunnel through Pomerium for several popular services that use TCP connections:

content/docs/capabilities/tcp/reference.md

+28-1
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,42 @@ pomerium-cli tcp [destination] [flags]
1818

1919
## Flags
2020

21-
| Flags | Description | Default Value |
21+
| Flags | Description | Type |
2222
| :-- | :-- | --- |
2323
| <a className="entRef-anchor" id="--alternate-ca-path">#</a><a href='#--alternate-ca-path'>--alternate-ca-path</a> | Path to CA certificate to use for HTTP requests. | string |
2424
| <a className="entRef-anchor" id="--browser-cmd">#</a><a href='#--browser-cmd'>--browser-cmd</a> | Custom browser command to run when opening a URL. | string |
2525
| <a className="entRef-anchor" id="--ca-cert">#</a><a href='#--ca-cert'>--ca-cert</a> | Path to CA certificate to use for HTTP requests. | string |
2626
| <a className="entRef-anchor" id="--client-cert">#</a><a href='#--client-cert'>--client-cert</a> | (optional) PEM-encoded client certificate. | string |
2727
| <a className="entRef-anchor" id=" --client-key">#</a><a href='# --client-key'> --client-key</a> | (optional) PEM-encoded client certificate key. | string |
28+
| <a className="entRef-anchor" id="--client-cert-from-store">#</a><a href='#--client-cert-from-store'> --client-cert-from-store</a> | (optional) If provided, pomerium-cli will attempt to use a client certificate from the system trust store (macOS and Windows only), searching for a certificate based on the trusted CA names advertised by Pomerium in the TLS handshake | none |
29+
| <a className="entRef-anchor" id="--client-cert-issuer">#</a><a href='#--client-cert-issuer'> --client-cert-issuer</a> | (optional) When used in combination with --client-cert-from-store, restricts the client certificate search based on a particular attribute of the certificate's [Issuer name](#certificate-name-filters). | string |
30+
| <a className="entRef-anchor" id="--client-cert-subject">#</a><a href='#--client-cert-subject'> --client-cert-subject</a> | (optional) When used in combination with --client-cert-from-store, restricts the client certificate search based on a particular attribute of the certificate's [Subject name](#client-certificate-name-filters). | string |
2831
| <a className="entRef-anchor" id=" --disable-tls-verification">#</a><a href='# --disable-tls-verification'>--disable-tls-verification</a> | Disables TLS verification. | none |
2932
| <a className="entRef-anchor" id="--help">#</a><a href='#--help'>-h, --help</a> | Help for tcp. | none |
3033
| <a className="entRef-anchor" id="--listen">#</a><a href='#--listen'>--listen</a> | Local address to start a listener on (default "127.0.0.1:0"). | string |
3134
| <a className="entRef-anchor" id="--pomerium-url">#</a><a href='#--pomerium-url'>--pomerium-url</a> | The URL of the Pomerium server to connect to. | string |
3235
| <a className="entRef-anchor" id="--version">#</a><a href='#--version'>-v, --version</a> | Version for pomerium-cli. | none |
36+
37+
### Certificate name filters
38+
39+
The certificate name filter syntax is `attribute=value`. A name filter can accept only one name attribute. The value must be an exact match (not a substring match). Make sure to quote name filters as appropriate for your shell.
40+
41+
For example, `--client-cert-issuer "CN=My Trusted CA"` would filter for a certificate directly issued by a CA with the Common Name "My Trusted CA".
42+
43+
Or, `--client-cert-subject "OU=My Department"` would filter for a certificate whose Subject name contains the Organizational Unit Name "My Department".
44+
45+
The supported name attributes are:
46+
47+
- commonName (CN)
48+
- countryName (C)
49+
- localityName (L)
50+
- organizationName (O)
51+
- organizationalUnitName (OU)
52+
- postalCode
53+
- serialNumber
54+
- stateOrProvinceName (ST)
55+
- streetAddress (STREET)
56+
57+
Either the long or short attribute name may be used (e.g. `localityName=New York` or `L=New York`).
58+
59+
Values are case sensitive: `L=new york` will not match the Locality Name "New York".

0 commit comments

Comments
 (0)