Skip to content

Commit 804f2ad

Browse files
bbhorriganclaude
andcommitted
docs: tighten README — tables, less prose
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent f8610d1 commit 804f2ad

File tree

1 file changed

+57
-174
lines changed

1 file changed

+57
-174
lines changed

README.md

Lines changed: 57 additions & 174 deletions
Original file line numberDiff line numberDiff line change
@@ -1,126 +1,69 @@
11
# vault-plugin-database-snowflake
22

3-
A community-maintained Vault plugin for Snowflake. It is one of the supported plugins for the HashiCorp
4-
Vault Database Secrets Engine and allows for the programmatic generation of unique,
5-
ephemeral Snowflake [Database User](https://docs.snowflake.com/en/user-guide/admin-user-management.html)
6-
credentials in a Snowflake account.
3+
A community-maintained Vault plugin for Snowflake that generates ephemeral
4+
[Database User](https://docs.snowflake.com/en/user-guide/admin-user-management.html) credentials
5+
via the HashiCorp Vault Database Secrets Engine.
76

8-
This project uses the database plugin interface introduced in Vault version 1.6.0.
7+
> **Note:** Community fork of [hashicorp/vault-plugin-database-snowflake](https://github.com/hashicorp/vault-plugin-database-snowflake).
8+
> Requires Vault 1.6+.
99
10-
> **Note:** This is a community-maintained fork of [hashicorp/vault-plugin-database-snowflake](https://github.com/hashicorp/vault-plugin-database-snowflake),
11-
> actively maintained by the Snowflake community. The plugin is included in Vault version 1.7+.
12-
13-
> **Snowflake Password Deprecation:** Snowflake is deprecating single-factor password authentication.
14-
> Key-pair authentication will be required after November 2025. See [Snowflake's announcement](https://docs.snowflake.com/en/release-notes/2025/other/2025-01-17-password-authentication-deprecated)
15-
> for details. Both the service account connection and dynamic user credential type should be
16-
> migrated away from passwords before this date.
10+
> **⚠️ Snowflake is deprecating password authentication after November 2025.**
11+
> Migrate service account connections and dynamic roles to key-pair auth before that date.
1712
1813
## Bugs and Feature Requests
1914

20-
Bugs should be filed under the [Issues](https://github.com/bbhorrigan/vault-plugin-database-snowflake/issues) section of this repo.
21-
22-
Feature requests can be submitted in the Issues section as well.
23-
24-
## Security
25-
26-
If you believe you have found a security issue in this plugin, please open a GitHub issue or contact the maintainer directly.
15+
File issues at [bbhorrigan/vault-plugin-database-snowflake/issues](https://github.com/bbhorrigan/vault-plugin-database-snowflake/issues).
2716

2817
## Quick Links
2918

30-
* [Database Secrets Engine for Snowflake - Docs](https://developer.hashicorp.com/vault/docs/secrets/databases/snowflake)
31-
* [Database Secrets Engine for Snowflake - API Docs](https://developer.hashicorp.com/vault/api-docs/secret/databases/snowflake)
32-
* [Snowflake Website](https://www.snowflake.com/)
33-
* [Vault Website](https://www.vaultproject.io)
19+
- [Database Secrets Engine - Docs](https://developer.hashicorp.com/vault/docs/secrets/databases/snowflake)
20+
- [Database Secrets Engine - API Docs](https://developer.hashicorp.com/vault/api-docs/secret/databases/snowflake)
21+
- [Snowflake Docs](https://docs.snowflake.com)
3422

3523
---
3624

3725
## Service Account Authentication
3826

39-
The plugin connects to Snowflake using a service account. Four authentication methods are supported.
40-
Choose one based on your environment.
41-
42-
### 1. Key-Pair Authentication (Recommended)
43-
44-
The service account authenticates using an RSA private key. This is the recommended method and
45-
will be required after Snowflake's November 2025 password deprecation.
46-
47-
**Prerequisites:**
48-
1. Generate an RSA key pair and assign the public key to your Snowflake service user:
49-
```sql
50-
ALTER USER "VAULT-SERVICE-USER" SET RSA_PUBLIC_KEY='<your-public-key-base64>';
51-
```
52-
2. The public key should be the base64 body only (no PEM headers).
53-
54-
**Configure the connection:**
55-
```sh
56-
vault write database/config/my-snowflake \
57-
plugin_name=vault-plugin-database-snowflake \
58-
connection_url="<account>.snowflakecomputing.com/<database>" \
59-
username="VAULT-SERVICE-USER" \
60-
private_key=@/path/to/rsa_key_pkcs8.pem \
61-
allowed_roles="*"
62-
```
63-
64-
---
27+
Four methods are supported. Set exactly one per connection config.
6528

66-
### 2. Workload Identity Federation (WIF)
29+
| Method | Field(s) | When to use |
30+
|--------|----------|-------------|
31+
| Key-pair | `private_key` | Recommended default |
32+
| WIF | `workload_identity_provider` | Cloud-native environments (AWS/GCP/Azure/OIDC) |
33+
| OAuth 2.0 | `oauth_client_id` + `oauth_client_secret` + `oauth_token_endpoint` | External IdP |
34+
| Password | `password` | **Deprecated** — removed Nov 2025 |
6735

68-
The service account authenticates using a cloud provider identity — no long-lived credentials
69-
required. Supported providers: `AWS`, `GCP`, `AZURE`, `OIDC`.
36+
### Key-Pair
7037

71-
WIF must be enabled in your Snowflake account:
38+
Assign your public key to the Snowflake user first:
7239
```sql
73-
ALTER ACCOUNT SET ENABLE_IDENTIFIER_FIRST_LOGIN = TRUE;
74-
```
75-
76-
**AWS (EC2/ECS/Lambda — uses instance/task role automatically):**
77-
```sh
78-
vault write database/config/my-snowflake \
79-
plugin_name=vault-plugin-database-snowflake \
80-
connection_url="<account>.snowflakecomputing.com/<database>" \
81-
username="VAULT-SERVICE-USER" \
82-
workload_identity_provider="AWS" \
83-
allowed_roles="*"
40+
ALTER USER "VAULT-SERVICE-USER" SET RSA_PUBLIC_KEY='<base64-public-key>';
8441
```
8542

86-
**GCP (Compute Engine/Cloud Run — uses metadata service automatically):**
8743
```sh
8844
vault write database/config/my-snowflake \
8945
plugin_name=vault-plugin-database-snowflake \
9046
connection_url="<account>.snowflakecomputing.com/<database>" \
9147
username="VAULT-SERVICE-USER" \
92-
workload_identity_provider="GCP" \
48+
private_key=@/path/to/rsa_key_pkcs8.pem \
9349
allowed_roles="*"
9450
```
9551

96-
**Azure (Managed Identity — uses IMDS automatically):**
97-
```sh
98-
vault write database/config/my-snowflake \
99-
plugin_name=vault-plugin-database-snowflake \
100-
connection_url="<account>.snowflakecomputing.com/<database>" \
101-
username="VAULT-SERVICE-USER" \
102-
workload_identity_provider="AZURE" \
103-
workload_identity_entra_resource="<optional-entra-resource-url>" \
104-
allowed_roles="*"
105-
```
52+
### Workload Identity Federation (WIF)
10653

107-
**OIDC (any OIDC-compatible IdP — requires an explicit token):**
10854
```sh
10955
vault write database/config/my-snowflake \
11056
plugin_name=vault-plugin-database-snowflake \
11157
connection_url="<account>.snowflakecomputing.com/<database>" \
11258
username="VAULT-SERVICE-USER" \
113-
workload_identity_provider="OIDC" \
114-
workload_identity_token="<oidc-jwt-token>" \
59+
workload_identity_provider="AWS" \ # AWS | GCP | AZURE | OIDC
11560
allowed_roles="*"
11661
```
11762

118-
---
119-
120-
### 3. OAuth 2.0 Client Credentials
63+
OIDC requires an explicit token: `workload_identity_token="<jwt>"`.
64+
Azure supports an optional `workload_identity_entra_resource="<url>"`.
12165

122-
The service account authenticates using OAuth 2.0 client credentials flow. The gosnowflake driver
123-
handles the token exchange with your IdP automatically.
66+
### OAuth 2.0 Client Credentials
12467

12568
```sh
12669
vault write database/config/my-snowflake \
@@ -130,49 +73,25 @@ vault write database/config/my-snowflake \
13073
oauth_client_id="<client-id>" \
13174
oauth_client_secret="<client-secret>" \
13275
oauth_token_endpoint="https://<your-idp>/oauth/token" \
133-
oauth_scope="session:role:SYSADMIN" \
134-
allowed_roles="*"
135-
```
136-
137-
`oauth_scope` is optional. `username` is required for OAuth client credentials.
138-
139-
---
140-
141-
### 4. Password Authentication (Deprecated)
142-
143-
> **Warning:** Snowflake is removing password authentication after November 2025.
144-
> Migrate to key-pair, WIF, or OAuth before that date.
145-
146-
```sh
147-
vault write database/config/my-snowflake \
148-
plugin_name=vault-plugin-database-snowflake \
149-
connection_url="<account>.snowflakecomputing.com/{{username}}:{{password}}@<account>.snowflakecomputing.com/<database>" \
150-
username="VAULT-SERVICE-USER" \
151-
password="<password>" \
76+
oauth_scope="session:role:SYSADMIN" \ # optional
15277
allowed_roles="*"
15378
```
15479

15580
---
15681

15782
## Dynamic User Credential Types
15883

159-
The plugin supports two credential types for dynamically created users. The credential type
160-
is set per role and determines what Vault returns to the caller.
84+
Set `credential_type` on the role to control what Vault issues to callers.
16185

162-
### RSA Key-Pair (Recommended)
86+
| Type | Vault returns | Snowflake auth | Status |
87+
|------|--------------|----------------|--------|
88+
| `rsa_private_key` | Private key | Key-pair | **Recommended** |
89+
| `password` | Password | Password | Deprecated Nov 2025 |
16390

164-
Vault generates a fresh RSA key pair for every credential request. The public key is written
165-
to Snowflake when the user is created. The private key is returned to the caller. No password
166-
is ever set on the dynamic user.
91+
### RSA Key-Pair (Recommended)
16792

168-
**How it works:**
169-
1. `vault read database/creds/<role>` is called
170-
2. Vault core generates a new RSA key pair
171-
3. The plugin runs the creation SQL with `{{public_key}}` substituted (PEM headers stripped per Snowflake requirements)
172-
4. The private key is returned in the `rsa_private_key` field of the response
173-
5. When the lease expires, Vault drops the user from Snowflake
93+
Vault generates a fresh key pair per request. The public key is written to Snowflake at user creation; the private key is returned to the caller.
17494

175-
**Configure the role:**
17695
```sh
17796
vault write database/roles/my-role \
17897
db_name=my-snowflake \
@@ -182,33 +101,15 @@ vault write database/roles/my-role \
182101
max_ttl=24h
183102
```
184103

185-
**Read credentials:**
186104
```sh
187105
vault read database/creds/my-role
106+
# Key Value
107+
# rsa_private_key -----BEGIN PRIVATE KEY-----...
108+
# username v_token_my_role_xxxx_1234567890
188109
```
189-
```
190-
Key Value
191-
--- -----
192-
lease_id database/creds/my-role/...
193-
lease_duration 1h
194-
rsa_private_key -----BEGIN PRIVATE KEY-----
195-
...
196-
-----END PRIVATE KEY-----
197-
username v_token_my_role_xxxxxxxxxxxxxxxxxxxx_1234567890
198-
```
199-
200-
The caller uses the private key to authenticate to Snowflake:
201-
```sh
202-
snowsql -a <account> -u <username> --private-key-path /path/to/private_key.pem
203-
```
204-
205-
---
206110

207111
### Password (Deprecated)
208112

209-
> **Warning:** Snowflake is removing password authentication after November 2025.
210-
> Use `credential_type=rsa_private_key` instead.
211-
212113
```sh
213114
vault write database/roles/my-role \
214115
db_name=my-snowflake \
@@ -219,49 +120,31 @@ vault write database/roles/my-role \
219120

220121
---
221122

222-
## Configure Plugin
123+
## Setup
223124

224-
A [scripted configuration](bootstrap/configure.sh) of the plugin is provided in
225-
this repository. You can use the script or manually configure the secrets engine
226-
using documentation.
227-
228-
To apply the scripted configuration, run the `make configure` target to
229-
register, enable, and configure the plugin with your local Vault instance. You
230-
can specify the plugin name, plugin directory, mount path, connection URL and
231-
private key path. Default values for plugin name and directory from the
232-
Makefile will be used if arguments aren't provided.
125+
A [scripted configuration](bootstrap/configure.sh) is available via `make configure`:
233126

234127
```sh
235-
$ PLUGIN_NAME=vault-plugin-database-snowflake \
236-
PLUGIN_DIR=$GOPATH/vault-plugins \
237-
CONNECTION_URL=foo.snowflakecomputing.com/BAR \
238-
PRIVATE_KEY=/path/to/private/key/file \
239-
SNOWFLAKE_USERNAME=user1 \
240-
make configure
128+
PLUGIN_NAME=vault-plugin-database-snowflake \
129+
PLUGIN_DIR=$GOPATH/vault-plugins \
130+
CONNECTION_URL=foo.snowflakecomputing.com/BAR \
131+
PRIVATE_KEY=/path/to/private/key/file \
132+
SNOWFLAKE_USERNAME=user1 \
133+
make configure
241134
```
242135

243136
---
244137

245138
## Acceptance Testing
246139

247-
In order to perform acceptance testing, you need to set the environment variable `VAULT_ACC=1`
248-
as well as provide all the necessary information to connect to a Snowflake Project. All
249-
`SNOWFLAKE_*` environment variables must be provided in order for the acceptance tests to
250-
run properly. A cluster must be available during the test. A [30-day trial account](https://signup.snowflake.com/)
251-
can be provisioned manually to test.
252-
253-
| Environment Variable | Description |
254-
|----------------------|-------------|
255-
| SNOWFLAKE_ACCOUNT | The account string for your snowflake instance. If you are using a non-AWS provider, or a region that isn't us-west-1 for AWS, region and provider should be included here. (example: `ec#####.east-us-2.azure`) |
256-
| SNOWFLAKE_USER | The accountadmin level user that you are using with Vault |
257-
| SNOWFLAKE_PASSWORD | The password associated with the provided user (optional if using key-pair auth) |
258-
| SNOWFLAKE_PRIVATE_KEY | Path to the private key file for key-pair authentication |
259-
| SNOWFLAKE_DB | optional: The DB you are restricting the connection to |
260-
| SNOWFLAKE_SCHEMA | optional: The schema you are restricting the connection to |
261-
| SNOWFLAKE_WAREHOUSE | optional: The warehouse you are restricting the connection to |
262-
263-
To run the acceptance tests, invoke `make testacc`:
264-
265-
```sh
266-
$ make testacc
267-
```
140+
Set `VAULT_ACC=1` and the following environment variables, then run `make testacc`.
141+
142+
| Variable | Description |
143+
|----------|-------------|
144+
| `SNOWFLAKE_ACCOUNT` | Account identifier (e.g. `ec#####.east-us-2.azure`) |
145+
| `SNOWFLAKE_USER` | ACCOUNTADMIN-level user for Vault |
146+
| `SNOWFLAKE_PASSWORD` | Password (optional if using key-pair) |
147+
| `SNOWFLAKE_PRIVATE_KEY` | Path to private key file |
148+
| `SNOWFLAKE_DB` | optional |
149+
| `SNOWFLAKE_SCHEMA` | optional |
150+
| `SNOWFLAKE_WAREHOUSE` | optional |

0 commit comments

Comments
 (0)