You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f533899
Browse filesBrowse the repository at this point in the historyBrowse files
fix(credentials): harden keyless sign-in for AWS and Databricks
Saving a keyless Databricks connection now refuses a federation policy that
trusts every Sim subject, as AWS roles already were. Keyless stays off when
the issuer isn't https on the default port, and an unpinned issuer is logged.
Docs cover a zero-downtime key rotation, the issuer requirements, finding the
service principal ID, and troubleshooting.
Copy file name to clipboardExpand all lines: apps/docs/content/docs/integrations/aws-credentials.mdx
+15-2Lines changed: 15 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,8 +58,21 @@ To rotate a key, create the new key in AWS, reconnect the credential with it, co
58
58
Keyless roles need two things on a self-hosted deployment:
59
59
60
60
-`WORKLOAD_IDENTITY_SIGNING_KEY`: a PKCS#8 PEM RSA private key that signs Sim's tokens.
61
-
- An issuer AWS can reach over the public internet. It defaults to `<NEXT_PUBLIC_APP_URL>/oidc/workload`; set `WORKLOAD_IDENTITY_ISSUER` to pin it. Trust policies reference this URL, so never change it once roles trust it.
61
+
- An issuer AWS can reach over the public internet: an `https` URL on the default port, served by a certificate from a public CA. It defaults to `<NEXT_PUBLIC_APP_URL>/oidc/workload`; set `WORKLOAD_IDENTITY_ISSUER` to pin it. Trust policies reference this URL, so never change it once roles trust it. Sim keeps keyless off when the issuer isn't `https` or names a port, because AWS can't use it.
62
62
63
-
To rotate the signing key, move the old key to `WORKLOAD_IDENTITY_PREVIOUS_KEY` and set a new `WORKLOAD_IDENTITY_SIGNING_KEY`. Both keys stay published until you remove the old one.
63
+
Generate a key with `openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048`.
64
+
65
+
To rotate the signing key without failed runs:
66
+
67
+
1. Set the new key as `WORKLOAD_IDENTITY_PREVIOUS_KEY` and redeploy. Sim publishes it but keeps signing with the current key.
68
+
2. Wait at least 5 minutes, so every cached copy of the published keys includes the new one.
69
+
3. Swap them: set the new key as `WORKLOAD_IDENTITY_SIGNING_KEY` and the old key as `WORKLOAD_IDENTITY_PREVIOUS_KEY`, and redeploy.
70
+
4. After 5 more minutes, remove `WORKLOAD_IDENTITY_PREVIOUS_KEY`.
64
71
65
72
Without a signing key, the keyless option is unavailable and access keys work as usual.
73
+
74
+
## Troubleshooting
75
+
76
+
-**`InvalidIdentityToken` or "No OpenIDConnect provider found":** the IAM identity provider's URL or audience doesn't match the dialog exactly, or AWS can't reach the issuer. Open `<issuer>/.well-known/openid-configuration` from outside your network; it must load over `https`.
77
+
-**`AccessDenied` when saving:** the role's trust policy doesn't trust this credential's subject. Paste the trust policy from the dialog again; if you chose **Issue a new subject**, update the policy to the new one.
78
+
-**"This role trusts every Sim subject":** the trust policy is missing the `sub` condition. Use the policy from the dialog.
Copy file name to clipboardExpand all lines: apps/docs/content/docs/integrations/databricks-credentials.mdx
+8-3Lines changed: 8 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,15 +29,20 @@ Every option resolves on Sim's servers at run time; tokens never appear in block
29
29
In Sim, add a **Databricks connection**, choose **Service principal (keyless, via Sim OIDC)**, and enter the workspace host and the service principal's **application ID**.
30
30
</Step>
31
31
<Step>
32
-
A Databricks account admin runs the **Federation policy** command from the dialog with the service principal's numeric ID. The policy trusts Sim's issuer, the Sim audience, and this connection's subject only.
32
+
A Databricks account admin runs the **Federation policy** command from the dialog with the service principal's numeric ID (find it with `databricks account service-principals list --filter 'applicationId eq "<application ID>"'`, or on the service principal's page in the account console). The policy trusts Sim's issuer, the Sim audience, and this connection's subject only.
33
33
</Step>
34
34
<Step>
35
-
Make sure the service principal can access the workspace and the resources your workflows use, then save. Sim verifies the connection by exchanging a token and reading the service principal's identity.
35
+
Make sure the service principal can access the workspace and the resources your workflows use, then save. Sim verifies the connection by exchanging a token and reading the service principal's identity, and refuses a policy that would also trust a different subject, since every Sim workspace shares the issuer and audience.
36
36
</Step>
37
37
</Steps>
38
38
39
39
Reconnecting a keyless connection keeps its subject by default, so the federation policy keeps working.
40
40
41
41
## Self-hosted deployments
42
42
43
-
Keyless connections need `WORKLOAD_IDENTITY_SIGNING_KEY` set and an issuer Databricks can reach over the public internet. See [AWS credentials](/integrations/aws-credentials#self-hosted-deployments) for the same settings.
43
+
Keyless connections need `WORKLOAD_IDENTITY_SIGNING_KEY` set and an `https` issuer Databricks can reach over the public internet. See [AWS credentials](/integrations/aws-credentials#self-hosted-deployments) for the same settings and for rotating the signing key.
44
+
45
+
## Troubleshooting
46
+
47
+
-**"Databricks rejected the token request":** the federation policy's issuer, audience, or subject doesn't match the dialog, or the policy is on a different service principal than the application ID you entered.
48
+
-**"This service principal's federation policy trusts every Sim subject":** the policy has no `subject`. Recreate it with the command from the dialog.
|`WORKLOAD_IDENTITY_ISSUER`| Issuer URL clouds trust. Defaults to `<NEXT_PUBLIC_APP_URL>/oidc/workload` and must be reachable from the public internet. Never change it once trust policies reference it. |
171
-
|`WORKLOAD_IDENTITY_PREVIOUS_KEY`|During rotation, the retiring key (private or public PEM), still published so tokens it signed keep verifying|
170
+
|`WORKLOAD_IDENTITY_ISSUER`| Issuer URL clouds trust. Defaults to `<NEXT_PUBLIC_APP_URL>/oidc/workload`; must be `https` on the default port and reachable from the public internet, or keyless stays off. Never change it once trust policies reference it. |
171
+
|`WORKLOAD_IDENTITY_PREVIOUS_KEY`|A second published key (private or public PEM) that never signs: the incoming key before a rotation, or the retiring key after it|
172
172
173
-
See [AWS credentials](/integrations/aws-credentials#self-hosted-deployments).
173
+
See [AWS credentials](/integrations/aws-credentials#self-hosted-deployments) for setup and the rotation steps.
`Sim could not confirm the federation policy limits this service principal to this credential: ${getErrorMessage(error,'Unknown error')}. Try again.`
280
+
)
281
+
}
282
+
thrownewDatabricksCredentialError(
283
+
`This service principal's federation policy trusts every Sim subject. Use the policy shown in the dialog, whose subject is ${config.subject}, so only this credential can use it.`
284
+
)
285
+
}
286
+
226
287
/**
227
288
* Validates the submitted configuration, proves it by calling the workspace's
228
289
* SCIM `Me` endpoint with the resolved token, and returns the encrypted blob
@@ -247,28 +308,15 @@ export async function verifyAndEncryptDatabricksCredential(
0 commit comments