feat: optional Vault AppRole secret_id setting, env var as fallback (#12276)

* feat: add an optional Vault AppRole secret_id setting

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: mask the AppRole secret_id in the instance settings YAML view

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: align secret storage panels with the form guidelines

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: use the card styles from the brand guidelines in the secret storage panels

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore: update ee-repo-ref to 747a8896c7bd2490063ccfe0c0796aa14b57ab67

This commit updates the EE repository reference after PR #966 was merged in windmill-ee-private.

Previous ee-repo-ref: 450e839407e53540186523170127e5b17d110c5c

New ee-repo-ref: 747a8896c7bd2490063ccfe0c0796aa14b57ab67

Automated by sync-ee-ref workflow.

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: windmill-internal-app[bot] <windmill-internal-app[bot]@users.noreply.github.com>
Co-authored-by: Ruben Fiszel <ruben@windmill.dev>
This commit is contained in:
hugocasa
2026-11-09 17:45:03 +01:00
committed by GitHub
co-authored by Claude Opus 5.5 windmill-internal-app[bot] Ruben Fiszel
parent 1f92c4fa44
commit e4671f7d3f
11 changed files with 280 additions and 204 deletions
+1 -1
View File
@@ -1 +1 @@
276f5f5cacc259bad1dc138430ae03c53d3db43d
747a8896c7bd2490063ccfe0c0796aa14b57ab67
+4 -1
View File
@@ -30387,7 +30387,10 @@ components:
description: Mount path for the JWT auth method in Vault (optional, defaults to "jwt"). Set this when the JWT auth method is mounted at a non-default path, e.g. via `vault auth enable -path=<mount> jwt`.
approle_role_id:
type: string
description: AppRole role_id (optional). When set and no static token is given, Windmill logs in with AppRole; the secret_id is read from the `VAULT_APPROLE_SECRET_ID` environment variable of servers and workers.
description: AppRole role_id (optional). When set and no static token is given, Windmill logs in with AppRole.
approle_secret_id:
type: string
description: AppRole secret_id (optional). When empty, the `VAULT_APPROLE_SECRET_ID` environment variable of servers and workers is used; when that is unset too, no secret_id is sent (a role with `bind_secret_id=false`).
approle_mount_path:
type: string
description: Mount path of the AppRole auth method (optional, defaults to "approle").
@@ -1206,6 +1206,7 @@ const NESTED_SENSITIVE_FIELDS: &[(&str, &[&str])] = &[
"secret_backend",
&[
"token",
"approle_secret_id",
"client_secret",
"secret_access_key",
"auth",
@@ -1245,7 +1246,7 @@ fn mask_nested_sensitive(key: &str, value: &serde_json::Value) -> serde_json::Va
// Settings that are maps-of-objects where each child has a sensitive sub-field.
const NESTED_MAP_SENSITIVE: &[(&str, &[&str])] = &[
("oauths", &["secret", "signing_secret"]),
("external_secrets", &["token"]),
("external_secrets", &["token", "approle_secret_id"]),
];
for &(parent_key, child_fields) in NESTED_MAP_SENSITIVE {
if key == parent_key {
@@ -161,11 +161,14 @@ pub struct VaultSettings {
#[serde(skip_serializing_if = "Option::is_none")]
pub jwt_mount_path: Option<String>,
/// AppRole role_id. When set (and no static token), Windmill logs in with
/// AppRole; the secret_id is read from the `VAULT_APPROLE_SECRET_ID`
/// environment variable of servers and workers, never from settings, and
/// is omitted when unset (a role with `bind_secret_id=false`).
/// AppRole.
#[serde(skip_serializing_if = "Option::is_none")]
pub approle_role_id: Option<String>,
/// AppRole secret_id. When empty, the `VAULT_APPROLE_SECRET_ID` environment
/// variable of servers and workers is used, and when that is unset too the
/// login sends none (a role with `bind_secret_id=false`).
#[serde(skip_serializing_if = "Option::is_none")]
pub approle_secret_id: Option<String>,
/// Mount path of the AppRole auth method (defaults to "approle").
#[serde(skip_serializing_if = "Option::is_none")]
pub approle_mount_path: Option<String>,
@@ -29,6 +29,7 @@ mod tests {
jwt_role: Some("windmill-secrets".to_string()),
jwt_mount_path: None,
approle_role_id: None,
approle_secret_id: None,
approle_mount_path: None,
namespace: None,
token: Some("test-root-token".to_string()),
@@ -80,6 +80,7 @@ mod tests {
jwt_role: None, // Static token mode
jwt_mount_path: None,
approle_role_id: None,
approle_secret_id: None,
approle_mount_path: None,
namespace: None,
token: Some(
@@ -99,6 +100,7 @@ mod tests {
jwt_role: Some("windmill-secrets".to_string()), // JWT mode
jwt_mount_path: None,
approle_role_id: None,
approle_secret_id: None,
approle_mount_path: None,
namespace: None,
token: None, // No static token - use JWT
@@ -38,6 +38,7 @@ fn test_vault_settings() -> VaultSettings {
jwt_role: Some("windmill-secrets".to_string()),
jwt_mount_path: None,
approle_role_id: None,
approle_secret_id: None,
approle_mount_path: None,
namespace: None,
token: Some(std::env::var("VAULT_TOKEN").unwrap_or_else(|_| "test-root-token".to_string())),
@@ -1799,13 +1799,13 @@ export const sensitiveKeys: Set<string> = new Set([
// Each entry maps a top-level key to its sensitive sub-field names.
export const nestedSensitiveFields: Record<string, string[]> = {
smtp_settings: ['smtp_password'],
secret_backend: ['token', 'client_secret', 'secret_access_key'],
secret_backend: ['token', 'approle_secret_id', 'client_secret', 'secret_access_key'],
object_store_cache_config: ['secret_key', 'serviceAccountKey', 'accessKey'],
custom_instance_pg_databases: ['user_pwd'],
external_instance_pg: ['password'],
rsa_keys: ['private_key'],
github_enterprise_app: ['private_key'],
external_secrets: ['vault.token']
external_secrets: ['vault.token', 'vault.approle_secret_id']
}
// A field may name one nested level, `parent.child`.
@@ -13,6 +13,7 @@
import EEOnly from '../EEOnly.svelte'
import MultiSelect from '../select/MultiSelect.svelte'
import { resource } from 'runed'
import Tooltip from '../meltComponents/Tooltip.svelte'
interface Props {
values: Writable<Record<string, any>>
@@ -71,12 +72,17 @@
function setAuthMethod(method: string | undefined) {
if (!vault || !method) return
const { token: _t, approle_role_id: _a, jwt_role: _j, ...rest } = vault
const { token: _t, approle_role_id: _a, approle_secret_id: _s, jwt_role: _j, ...rest } = vault
update({
vault: {
...rest,
...(method === 'token' ? { token: vault.token ?? '' } : {}),
...(method === 'approle' ? { approle_role_id: vault.approle_role_id ?? '' } : {}),
...(method === 'approle'
? {
approle_role_id: vault.approle_role_id ?? '',
approle_secret_id: vault.approle_secret_id
}
: {}),
...(method === 'jwt' ? { jwt_role: vault.jwt_role ?? 'windmill-secrets' } : {})
}
})
@@ -106,7 +112,7 @@
{#if !$enterpriseLicense}
<EEOnly>External secret references require Enterprise Edition</EEOnly>
{/if}
<span class="text-2xs text-secondary">
<span class="text-xs text-secondary">
A secret variable can reference an existing secret, as
<code>$external:vault://&lt;path&gt;#&lt;key&gt;</code>, or the whole secret as JSON without
<code>#&lt;key&gt;</code>, instead of holding its value. The value is read from Vault each time
@@ -118,7 +124,7 @@
</Alert>
{#if backendVault}
<div class="flex flex-col gap-2">
<div class="flex flex-col gap-1">
<span class="text-xs font-semibold text-emphasis">Vault connection</span>
<ToggleButtonGroup selected={vault ? 'separate' : 'same'} onSelected={setConnection}>
{#snippet children({ item })}
@@ -139,7 +145,7 @@
{/snippet}
</ToggleButtonGroup>
{#if !vault}
<span class="text-2xs text-secondary">
<span class="text-xs text-secondary">
References are read from {backendVault.address || 'the Vault address above'} with the secret
backend's authentication.
</span>
@@ -157,7 +163,7 @@
{/if}
{#if vault}
<div class="flex flex-col gap-4 p-4 border rounded-lg">
<div class="flex flex-col gap-4 p-4 border rounded-md bg-surface-tertiary">
<div class="flex flex-col gap-1">
<label for="ext_vault_address" class="text-xs font-semibold text-emphasis">
Vault address
@@ -171,21 +177,21 @@
bind:value={() => vault?.address ?? '', (v) => setVaultField('address', v)}
/>
</div>
<div class="flex flex-col gap-2">
<div class="flex flex-col gap-1">
<span class="text-xs font-semibold text-emphasis">Authentication method</span>
<ToggleButtonGroup selected={authMethod} onSelected={(v) => setAuthMethod(v)}>
{#snippet children({ item })}
<ToggleButton
value="approle"
label="AppRole"
tooltip="Log in with an AppRole role_id and secret_id"
value="jwt"
label="JWT auth"
tooltip="Authenticate using Windmill-signed JWTs"
{item}
{disabled}
/>
<ToggleButton
value="jwt"
label="JWT auth"
tooltip="Authenticate using Windmill-signed JWTs"
value="approle"
label="AppRole"
tooltip="Log in with an AppRole role_id and secret_id"
{item}
{disabled}
/>
@@ -200,55 +206,88 @@
</ToggleButtonGroup>
</div>
{#if authMethod === 'approle'}
<div class="flex flex-col gap-2 p-3 bg-surface-secondary rounded-lg">
<label for="ext_vault_role_id" class="text-xs font-semibold text-emphasis">Role ID</label>
<TextInput
inputProps={{ id: 'ext_vault_role_id', disabled }}
bind:value={
() => vault?.approle_role_id ?? '',
(v) => update({ vault: { ...vault, approle_role_id: v ?? '' } })
}
/>
<span class="text-2xs text-secondary">
The secret_id is read from the <code>VAULT_APPROLE_SECRET_ID</code> environment variable
of every server and worker, so it is never stored in Windmill. Leave it unset for a role
with <code>bind_secret_id=false</code>.
</span>
<label for="ext_vault_approle_mount" class="text-xs font-semibold text-emphasis">
AppRole mount path (optional)
</label>
<TextInput
inputProps={{ id: 'ext_vault_approle_mount', placeholder: 'approle', disabled }}
bind:value={
() => vault?.approle_mount_path ?? '', (v) => setVaultField('approle_mount_path', v)
}
/>
<div class="flex flex-col gap-3 p-3 bg-surface-secondary rounded-md">
<div class="flex flex-col gap-1">
<label for="ext_vault_role_id" class="text-xs font-semibold text-emphasis"
>Role ID</label
>
<TextInput
inputProps={{ id: 'ext_vault_role_id', disabled }}
bind:value={
() => vault?.approle_role_id ?? '',
(v) => update({ vault: { ...vault, approle_role_id: v ?? '' } })
}
/>
</div>
<div class="flex flex-col gap-1">
<label for="ext_vault_secret_id" class="text-xs font-semibold text-emphasis">
Secret ID (optional)
</label>
<span class="text-xs text-secondary">
Leave blank to use <code>VAULT_APPROLE_SECRET_ID</code>. With neither set, no
secret_id is sent (<code>bind_secret_id=false</code> roles).
</span>
<Password
id="ext_vault_secret_id"
bind:password={
() => vault?.approle_secret_id ?? '', (v) => setVaultField('approle_secret_id', v)
}
small
{disabled}
/>
</div>
<div class="flex flex-col gap-1">
<label for="ext_vault_approle_mount" class="text-xs font-semibold text-emphasis">
AppRole mount path (optional) <Tooltip
>{#snippet text()}
Path where the AppRole auth method is enabled in Vault. Set it only for a
non-default path (<code>vault auth enable -path=&lt;mount&gt; approle</code>).
{/snippet}</Tooltip
>
</label>
<TextInput
inputProps={{ id: 'ext_vault_approle_mount', placeholder: 'approle', disabled }}
bind:value={
() => vault?.approle_mount_path ?? '', (v) => setVaultField('approle_mount_path', v)
}
/>
</div>
</div>
{:else if authMethod === 'jwt'}
<div class="flex flex-col gap-2 p-3 bg-surface-secondary rounded-lg">
<label for="ext_vault_jwt_role" class="text-xs font-semibold text-emphasis">
JWT auth role
</label>
<TextInput
inputProps={{ id: 'ext_vault_jwt_role', placeholder: 'windmill-secrets', disabled }}
bind:value={
() => vault?.jwt_role ?? '', (v) => update({ vault: { ...vault, jwt_role: v ?? '' } })
}
/>
<label for="ext_vault_jwt_mount" class="text-xs font-semibold text-emphasis">
JWT auth mount path (optional)
</label>
<TextInput
inputProps={{ id: 'ext_vault_jwt_mount', placeholder: 'jwt', disabled }}
bind:value={
() => vault?.jwt_mount_path ?? '', (v) => setVaultField('jwt_mount_path', v)
}
/>
<div class="flex flex-col gap-3 p-3 bg-surface-secondary rounded-md">
<div class="flex flex-col gap-1">
<label for="ext_vault_jwt_role" class="text-xs font-semibold text-emphasis">
JWT auth role
</label>
<TextInput
inputProps={{ id: 'ext_vault_jwt_role', placeholder: 'windmill-secrets', disabled }}
bind:value={
() => vault?.jwt_role ?? '',
(v) => update({ vault: { ...vault, jwt_role: v ?? '' } })
}
/>
</div>
<div class="flex flex-col gap-1">
<label for="ext_vault_jwt_mount" class="text-xs font-semibold text-emphasis">
JWT auth mount path (optional) <Tooltip
>{#snippet text()}
Path where the JWT auth method is enabled in Vault. Set it only for a non-default
path (<code>vault auth enable -path=&lt;mount&gt; jwt</code>).
{/snippet}</Tooltip
>
</label>
<TextInput
inputProps={{ id: 'ext_vault_jwt_mount', placeholder: 'jwt', disabled }}
bind:value={
() => vault?.jwt_mount_path ?? '', (v) => setVaultField('jwt_mount_path', v)
}
/>
</div>
</div>
{:else}
<div class="flex flex-col gap-1 p-3 bg-surface-secondary rounded-lg">
<div class="flex flex-col gap-1 p-3 bg-surface-secondary rounded-md">
<span class="text-xs font-semibold text-emphasis">Vault token</span>
<span class="text-2xs text-secondary">Recommended only for testing.</span>
<span class="text-xs text-secondary">Recommended only for testing.</span>
<Password
bind:password={
() => vault?.token ?? '', (v) => update({ vault: { ...vault, token: v ?? '' } })
@@ -287,7 +326,7 @@
<div class="flex flex-col gap-2">
<span class="text-xs font-semibold text-emphasis">Allowed prefixes</span>
<span class="text-2xs text-secondary">
<span class="text-xs text-secondary">
A reference resolves only under one of these prefixes, matched on whole path segments, for the
listed workspaces (all workspaces when empty). Any admin of a listed workspace can read every
secret under its prefixes, within what Windmill's Vault identity can read.
@@ -117,11 +117,11 @@
}
</script>
<div class="space-y-4 p-4 border rounded-lg">
<div class="space-y-4 p-4 border rounded-md bg-surface-tertiary">
<div class="flex items-center gap-2 mb-4">
<Globe class="text-primary" size={20} />
<div>
<p class="text-sm font-medium text-emphasis">Generic HTTP store configuration</p>
<p class="text-sm font-semibold text-emphasis">Generic HTTP store configuration</p>
<p class="text-xs text-secondary"
>Read secrets from any secret store with an HTTP API. Windmill only reads: values are
managed in the store. To reference a secret, save a secret variable with an empty value, and
@@ -150,7 +150,7 @@
<label for="http_store_ca" class="block text-xs font-semibold text-emphasis"
>CA bundle path (optional)</label
>
<span class="text-2xs text-secondary"
<span class="text-xs text-secondary"
>PEM file of extra CAs trusted for the store's server certificate, re-read when it changes</span
>
<TextInput
@@ -183,7 +183,7 @@
size="xs"
options={{ right: 'Skip TLS certificate verification' }}
/>
<span class="text-2xs text-secondary"
<span class="text-xs text-secondary"
>Only enable for self-signed certificates in development.</span
>
</div>
@@ -193,7 +193,7 @@
<label for="http_store_path" class="block text-xs font-semibold text-emphasis"
>Path template</label
>
<span class="text-2xs text-secondary"
<span class="text-xs text-secondary"
>Appended to the base URL. <code>{'{workspace}'}</code> and <code>{'{path}'}</code> must each
appear here or in a query value, so that workspaces cannot read each other's secrets.</span
>
@@ -219,7 +219,7 @@
</div>
<div class="flex flex-col gap-1">
<span class="block text-xs font-semibold text-emphasis">Path encoding</span>
<span class="text-2xs text-secondary"
<span class="text-xs text-secondary"
>How a variable path becomes the store key: <code>{EXAMPLE_PATH}</code> →
<code>{exampleKey}</code></span
>
@@ -244,7 +244,7 @@
<label for="http_store_pointer" class="block text-xs font-semibold text-emphasis"
>Value pointer (optional)</label
>
<span class="text-2xs text-secondary"
<span class="text-xs text-secondary"
>JSON pointer to the value in the response, e.g. <code>/data/value</code>. Empty means the
whole body is the value.</span
>
@@ -268,7 +268,7 @@
</div>
<span class="block text-xs font-semibold text-emphasis pt-4 border-t">Authentication</span>
<span class="text-2xs text-secondary"
<span class="text-xs text-secondary"
>Credential files must be mounted on servers and workers; agent workers never read them.</span
>
<ToggleButtonGroup
@@ -289,7 +289,7 @@
{/snippet}
</ToggleButtonGroup>
{#if cfg().auth?.type === 'StaticHeader'}
<div class="flex flex-col gap-2 p-3 bg-surface-secondary rounded-lg">
<div class="flex flex-col gap-2 p-3 bg-surface-secondary rounded-md">
<label for="http_store_header_name" class="block text-xs font-semibold text-emphasis"
>Header name</label
>
@@ -301,7 +301,7 @@
<Password bind:password={$values['secret_backend'].auth.header_value} small {disabled} />
</div>
{:else if cfg().auth?.type === 'BearerTokenFile'}
<div class="flex flex-col gap-2 p-3 bg-surface-secondary rounded-lg">
<div class="flex flex-col gap-2 p-3 bg-surface-secondary rounded-md">
<label for="http_store_token_path" class="block text-xs font-semibold text-emphasis"
>Token file path</label
>
@@ -317,7 +317,7 @@
<label for="http_store_token_header" class="block text-xs font-semibold text-emphasis"
>Header name and prefix (optional)</label
>
<span class="text-2xs text-secondary"
<span class="text-xs text-secondary"
>The prefix goes before the token. Left empty, it is <code>Bearer </code> for the Authorization
header and nothing for any other header.</span
>
@@ -339,7 +339,7 @@
<label for="http_store_token_reload" class="block text-xs font-semibold text-emphasis"
>Reload interval in seconds (optional)</label
>
<span class="text-2xs text-secondary"
<span class="text-xs text-secondary"
>The file is re-read at this interval, and sooner after a 401 (default 60)</span
>
<TextInput
@@ -356,11 +356,11 @@
/>
</div>
{:else if cfg().auth?.type === 'ClientCertificate'}
<div class="flex flex-col gap-2 p-3 bg-surface-secondary rounded-lg">
<div class="flex flex-col gap-2 p-3 bg-surface-secondary rounded-md">
<label for="http_store_cert_path" class="block text-xs font-semibold text-emphasis"
>Certificate path</label
>
<span class="text-2xs text-secondary"
<span class="text-xs text-secondary"
>PEM file with the client certificate, optionally followed by its intermediates</span
>
<TextInput
@@ -387,7 +387,7 @@
<label for="http_store_cert_reload" class="block text-xs font-semibold text-emphasis"
>Reload interval in seconds (optional)</label
>
<span class="text-2xs text-secondary"
<span class="text-xs text-secondary"
>The files are re-read at this interval, and sooner after a failed connection (default
300). A new certificate is only used once its key matches.</span
>
@@ -419,7 +419,7 @@
<div class="flex flex-col gap-4 pt-4 border-t">
<span class="block text-xs font-semibold text-emphasis">Test connection</span>
<span class="text-2xs text-secondary"
<span class="text-xs text-secondary"
>Reads one secret that exists in the store, given as the workspace and variable path that map
to it. The value is not shown.</span
>
@@ -436,7 +436,7 @@
<div>
<Button
unifiedSize="md"
variant="accent"
variant="default"
onclick={testConnection}
disabled={disabled ||
!isConfigValid() ||
@@ -449,7 +449,7 @@
</div>
<div class="flex flex-col gap-2 pt-4 border-t">
<span class="block text-xs font-semibold text-emphasis">Secret migration</span>
<div class="p-3 border rounded-lg">
<div class="p-3 border rounded-md">
<div class="flex items-center gap-2 mb-2"
><Globe size={16} /><ArrowLeft size={16} /><Database size={16} /></div
>
@@ -13,6 +13,7 @@
import ConfirmationModal from '../common/confirmationModal/ConfirmationModal.svelte'
import EEOnly from '../EEOnly.svelte'
import HttpStoreSecretBackendConfig from './HttpStoreSecretBackendConfig.svelte'
import Tooltip from '../meltComponents/Tooltip.svelte'
interface Props {
values: Writable<Record<string, any>>
@@ -145,6 +146,7 @@
...$values['secret_backend'],
jwt_role: null,
approle_role_id: undefined,
approle_secret_id: undefined,
token: $values['secret_backend'].token ?? ''
}
} else if (method === 'approle') {
@@ -159,6 +161,7 @@
...$values['secret_backend'],
token: null,
approle_role_id: undefined,
approle_secret_id: undefined,
jwt_role: $values['secret_backend'].jwt_role ?? 'windmill-secrets'
}
}
@@ -172,6 +175,7 @@
jwt_role: $values['secret_backend'].jwt_role,
jwt_mount_path: $values['secret_backend'].jwt_mount_path || undefined,
approle_role_id: $values['secret_backend'].approle_role_id ?? undefined,
approle_secret_id: $values['secret_backend'].approle_secret_id || undefined,
approle_mount_path: $values['secret_backend'].approle_mount_path || undefined,
namespace: $values['secret_backend'].namespace || undefined,
token: $values['secret_backend'].token || undefined,
@@ -511,10 +515,10 @@
</div>
{#if selectedType === 'Database'}
<div class="flex items-center gap-2 p-4 bg-surface-secondary rounded-lg">
<div class="flex items-center gap-2 p-4 border rounded-md bg-surface-tertiary">
<Database class="text-primary" size={20} />
<div>
<p class="text-sm font-medium text-emphasis">Database Storage (Default)</p>
<p class="text-sm font-semibold text-emphasis">Database storage (default)</p>
<p class="text-xs text-secondary"
>Secrets are encrypted using workspace-specific keys and stored in the PostgreSQL
database.</p
@@ -522,11 +526,11 @@
</div>
</div>
{:else if selectedType === 'HashiCorpVault'}
<div class="space-y-4 p-4 border rounded-lg">
<div class="space-y-4 p-4 border rounded-md bg-surface-tertiary">
<div class="flex items-center gap-2 mb-4">
<Lock class="text-primary" size={20} />
<div>
<p class="text-sm font-medium text-emphasis">HashiCorp Vault Configuration</p>
<p class="text-sm font-semibold text-emphasis">HashiCorp Vault configuration</p>
<p class="text-xs text-secondary"
>Store secrets in an external HashiCorp Vault instance.</p
>
@@ -535,7 +539,7 @@
<div class="grid grid-cols-1 gap-4">
<div class="flex flex-col gap-1">
<label for="vault_address" class="block text-xs font-semibold text-emphasis"
>Vault Address</label
>Vault address</label
>
<TextInput
inputProps={{
@@ -549,9 +553,9 @@
</div>
<div class="flex flex-col gap-1">
<label for="vault_mount_path" class="block text-xs font-semibold text-emphasis"
>KV Mount Path</label
>KV mount path</label
>
<span class="text-2xs text-secondary">The KV v2 secrets engine mount path in Vault</span>
<span class="text-xs text-secondary">The KV v2 secrets engine mount path in Vault</span>
<TextInput
inputProps={{ type: 'text', id: 'vault_mount_path', placeholder: 'windmill', disabled }}
bind:value={$values['secret_backend'].mount_path}
@@ -559,14 +563,14 @@
</div>
<div class="flex flex-col gap-1">
<label for="vault_kv_secret_path_prefix" class="block text-xs font-semibold text-emphasis"
>KV Secret Path Prefix (optional)</label
>
<span class="text-2xs text-secondary"
>Optional prefix inserted before the workspace id. When set, secrets are stored at
<code>&lt;mount&gt;/data/&lt;prefix&gt;/&lt;workspace&gt;/&lt;secret&gt;</code>, so you
can keep an existing layout and scope a Vault policy to exactly
<code>{$values['secret_backend']?.mount_path ?? 'windmill'}/data/{kvPolicyPath}</code
>.</span
>KV secret path prefix (optional) <Tooltip
>{#snippet text()}Inserted before the workspace id: secrets are stored at
<code>&lt;mount&gt;/data/&lt;prefix&gt;/&lt;workspace&gt;/&lt;secret&gt;</code>, so
you can keep an existing layout and scope a Vault policy to exactly
<code
>{$values['secret_backend']?.mount_path ?? 'windmill'}/data/{kvPolicyPath}</code
>.{/snippet}</Tooltip
></label
>
<TextInput
inputProps={{
@@ -578,13 +582,13 @@
bind:value={$values['secret_backend'].kv_secret_path_prefix}
/>
</div>
<div class="flex flex-col gap-2">
<span class="block text-xs font-semibold text-emphasis">Authentication Method</span>
<div class="flex flex-col gap-1">
<span class="block text-xs font-semibold text-emphasis">Authentication method</span>
<ToggleButtonGroup selected={authMethod} onSelected={(v) => setAuthMethod(v)}>
{#snippet children({ item: toggleButton })}
<ToggleButton
value="jwt"
label="JWT Auth"
label="JWT auth"
tooltip="Authenticate using Windmill-signed JWTs"
item={toggleButton}
{disabled}
@@ -598,7 +602,7 @@
/>
<ToggleButton
value="token"
label="Static Token"
label="Static token"
tooltip="Use a static Vault token"
item={toggleButton}
{disabled}
@@ -607,80 +611,103 @@
</ToggleButtonGroup>
</div>
{#if authMethod === 'approle'}
<div class="flex flex-col gap-2 p-3 bg-surface-secondary rounded-lg">
<label for="vault_approle_role_id" class="block text-xs font-semibold text-emphasis"
>Role ID</label
>
<TextInput
inputProps={{ type: 'text', id: 'vault_approle_role_id', disabled }}
bind:value={$values['secret_backend'].approle_role_id}
/>
<span class="text-2xs text-secondary"
>The secret_id is read from the <code>VAULT_APPROLE_SECRET_ID</code> environment
variable of every server and worker, so it is never stored in Windmill. Leave it unset
for a role with <code>bind_secret_id=false</code>.</span
>
<label for="vault_approle_mount_path" class="block text-xs font-semibold text-emphasis"
>AppRole Mount Path (optional)</label
>
<TextInput
inputProps={{
type: 'text',
id: 'vault_approle_mount_path',
placeholder: 'approle',
disabled
}}
bind:value={$values['secret_backend'].approle_mount_path}
/>
<div class="flex flex-col gap-3 p-3 bg-surface-secondary rounded-md">
<div class="flex flex-col gap-1">
<label for="vault_approle_role_id" class="block text-xs font-semibold text-emphasis"
>Role ID</label
>
<TextInput
inputProps={{ type: 'text', id: 'vault_approle_role_id', disabled }}
bind:value={$values['secret_backend'].approle_role_id}
/>
</div>
<div class="flex flex-col gap-1">
<label for="vault_approle_secret_id" class="block text-xs font-semibold text-emphasis"
>Secret ID (optional)</label
>
<span class="text-xs text-secondary"
>Leave blank to use <code>VAULT_APPROLE_SECRET_ID</code>. With neither set, no
secret_id is sent (<code>bind_secret_id=false</code> roles).</span
>
<Password
id="vault_approle_secret_id"
bind:password={$values['secret_backend'].approle_secret_id}
small
{disabled}
/>
</div>
<div class="flex flex-col gap-1">
<label
for="vault_approle_mount_path"
class="block text-xs font-semibold text-emphasis"
>AppRole mount path (optional) <Tooltip
>{#snippet text()}Path where the AppRole auth method is enabled in Vault. Set it
only for a non-default path (<code
>vault auth enable -path=&lt;mount&gt; approle</code
>).{/snippet}</Tooltip
></label
>
<TextInput
inputProps={{
type: 'text',
id: 'vault_approle_mount_path',
placeholder: 'approle',
disabled
}}
bind:value={$values['secret_backend'].approle_mount_path}
/>
</div>
</div>
{:else if authMethod === 'token'}
<div class="flex flex-col gap-1 p-3 bg-surface-secondary rounded-lg">
<div class="flex flex-col gap-1 p-3 bg-surface-secondary rounded-md">
<label for="vault_token" class="block text-xs font-semibold text-emphasis"
>Vault Token</label
>Vault token</label
>
<span class="text-2xs text-secondary"
<span class="text-xs text-secondary"
>Static token. Recommended only for testing/development.</span
>
<Password bind:password={$values['secret_backend'].token} small {disabled} />
</div>
{:else}
<div class="flex flex-col gap-2 p-3 bg-surface-secondary rounded-lg">
<label for="vault_jwt_role" class="block text-xs font-semibold text-emphasis"
>JWT Auth Role</label
>
<span class="text-2xs text-secondary"
>The JWT authentication role configured in Vault.</span
>
<TextInput
inputProps={{
type: 'text',
id: 'vault_jwt_role',
placeholder: 'windmill-secrets',
disabled
}}
bind:value={$values['secret_backend'].jwt_role}
/>
<label for="vault_jwt_mount_path" class="block text-xs font-semibold text-emphasis"
>JWT Auth Mount Path (optional)</label
>
<span class="text-2xs text-secondary"
>Mount path of the JWT auth method in Vault. Defaults to <code>jwt</code>. Set this
only if you mounted the JWT auth method at a non-default path (<code
>vault auth enable -path=&lt;mount&gt; jwt</code
>).</span
>
<TextInput
inputProps={{
type: 'text',
id: 'vault_jwt_mount_path',
placeholder: 'jwt',
disabled
}}
bind:value={$values['secret_backend'].jwt_mount_path}
/>
<div class="flex flex-col gap-3 p-3 bg-surface-secondary rounded-md">
<div class="flex flex-col gap-1">
<label for="vault_jwt_role" class="block text-xs font-semibold text-emphasis"
>JWT auth role</label
>
<span class="text-xs text-secondary"
>The JWT authentication role configured in Vault.</span
>
<TextInput
inputProps={{
type: 'text',
id: 'vault_jwt_role',
placeholder: 'windmill-secrets',
disabled
}}
bind:value={$values['secret_backend'].jwt_role}
/>
</div>
<div class="flex flex-col gap-1">
<label for="vault_jwt_mount_path" class="block text-xs font-semibold text-emphasis"
>JWT auth mount path (optional) <Tooltip
>{#snippet text()}Path where the JWT auth method is enabled in Vault. Set it only
for a non-default path (<code>vault auth enable -path=&lt;mount&gt; jwt</code
>).{/snippet}</Tooltip
></label
>
<TextInput
inputProps={{
type: 'text',
id: 'vault_jwt_mount_path',
placeholder: 'jwt',
disabled
}}
bind:value={$values['secret_backend'].jwt_mount_path}
/>
</div>
<details class="mt-2">
<summary class="text-xs font-medium text-secondary cursor-pointer hover:text-primary"
>Vault JWT Setup Instructions</summary
>Vault JWT setup instructions</summary
>
<div class="mt-2 p-2 bg-surface rounded text-2xs text-secondary space-y-2">
<p>Configure Vault to accept JWTs from Windmill:</p>
@@ -726,7 +753,7 @@ vault write auth/{jwtMount}/role/{$values['secret_backend']?.jwt_role || 'windmi
<label for="vault_namespace" class="block text-xs font-semibold text-emphasis"
>Namespace (optional)</label
>
<span class="text-2xs text-secondary">Vault Enterprise namespace</span>
<span class="text-xs text-secondary">Vault Enterprise namespace</span>
<TextInput
inputProps={{
type: 'text',
@@ -745,7 +772,7 @@ vault write auth/{jwtMount}/role/{$values['secret_backend']?.jwt_role || 'windmi
size="xs"
options={{ right: 'Skip TLS certificate verification' }}
/>
<span class="text-2xs text-secondary"
<span class="text-xs text-secondary"
>Disables TLS verification when connecting to Vault. Only enable for self-signed
certificates in development.</span
>
@@ -754,19 +781,19 @@ vault write auth/{jwtMount}/role/{$values['secret_backend']?.jwt_role || 'windmi
<div class="flex flex-col gap-4 pt-4 border-t">
<Button
unifiedSize="md"
variant="accent"
variant="default"
onclick={testVaultConnection}
disabled={disabled || !isVaultConfigValid() || testingConnection}
loading={testingConnection}
startIcon={{ icon: Server }}>Test Connection</Button
startIcon={{ icon: Server }}>Test connection</Button
>
<div class="flex flex-col gap-4 pt-4 border-t">
<span class="block text-xs font-semibold text-emphasis">Secret Migration</span>
<span class="text-2xs text-secondary"
<span class="block text-xs font-semibold text-emphasis">Secret migration</span>
<span class="text-xs text-secondary"
>Original values are NOT deleted to allow for rollback.</span
>
<div class="flex gap-4">
<div class="flex-1 p-3 border rounded-lg">
<div class="flex-1 p-3 border rounded-md">
<div class="flex items-center gap-2 mb-2"
><Database size={16} /><ArrowRight size={16} /><Lock size={16} /></div
>
@@ -779,7 +806,7 @@ vault write auth/{jwtMount}/role/{$values['secret_backend']?.jwt_role || 'windmi
startIcon={{ icon: ArrowRight }}>Migrate to Vault</Button
>
</div>
<div class="flex-1 p-3 border rounded-lg">
<div class="flex-1 p-3 border rounded-md">
<div class="flex items-center gap-2 mb-2"
><Lock size={16} /><ArrowLeft size={16} /><Database size={16} /></div
>
@@ -797,11 +824,11 @@ vault write auth/{jwtMount}/role/{$values['secret_backend']?.jwt_role || 'windmi
</div>
</div>
{:else if selectedType === 'AzureKeyVault'}
<div class="space-y-4 p-4 border rounded-lg">
<div class="space-y-4 p-4 border rounded-md bg-surface-tertiary">
<div class="flex items-center gap-2 mb-4">
<Cloud class="text-primary" size={20} />
<div>
<p class="text-sm font-medium text-emphasis">Azure Key Vault Configuration</p>
<p class="text-sm font-semibold text-emphasis">Azure Key Vault configuration</p>
<p class="text-xs text-secondary">Store secrets in an Azure Key Vault instance.</p>
</div>
</div>
@@ -848,24 +875,23 @@ vault write auth/{jwtMount}/role/{$values['secret_backend']?.jwt_role || 'windmi
bind:value={$values['secret_backend'].client_id}
/>
</div>
<div class="flex flex-col gap-1 p-3 bg-surface-secondary rounded-lg">
<div class="flex flex-col gap-1 p-3 bg-surface-secondary rounded-md">
<label for="azure_client_secret" class="block text-xs font-semibold text-emphasis"
>Client Secret <span class="text-2xs font-normal text-secondary">(optional)</span
></label
>Client secret (optional)</label
>
<span class="text-2xs text-secondary"
<span class="text-xs text-secondary"
>Leave blank to use Azure Workload Identity. Requires
<code>AZURE_FEDERATED_TOKEN_FILE</code> on the Windmill process (auto-injected on AKS by
the workload-identity webhook; set manually on other Kubernetes clusters).</span
>
<Password bind:password={$values['secret_backend'].client_secret} small {disabled} />
</div>
<div class="flex flex-col gap-1 p-3 bg-surface-secondary rounded-lg">
<div class="flex flex-col gap-1 p-3 bg-surface-secondary rounded-md">
<label for="azure_token" class="block text-xs font-semibold text-emphasis"
>Token (optional)</label
>
<span class="text-2xs text-secondary"
>Static Bearer token for testing. If provided, OAuth2 is skipped.</span
<span class="text-xs text-secondary"
>Static bearer token for testing. If provided, OAuth2 is skipped.</span
>
<Password bind:password={$values['secret_backend'].token} small {disabled} />
</div>
@@ -873,19 +899,19 @@ vault write auth/{jwtMount}/role/{$values['secret_backend']?.jwt_role || 'windmi
<div class="flex flex-col gap-4 pt-4 border-t">
<Button
unifiedSize="md"
variant="accent"
variant="default"
onclick={testAzureKvConnection}
disabled={disabled || !isAzureKvConfigValid() || testingAzureKvConnection}
loading={testingAzureKvConnection}
startIcon={{ icon: Server }}>Test Connection</Button
startIcon={{ icon: Server }}>Test connection</Button
>
<div class="flex flex-col gap-4 pt-4 border-t">
<span class="block text-xs font-semibold text-emphasis">Secret Migration</span>
<span class="text-2xs text-secondary"
<span class="block text-xs font-semibold text-emphasis">Secret migration</span>
<span class="text-xs text-secondary"
>Original values are NOT deleted to allow for rollback.</span
>
<div class="flex gap-4">
<div class="flex-1 p-3 border rounded-lg">
<div class="flex-1 p-3 border rounded-md">
<div class="flex items-center gap-2 mb-2"
><Database size={16} /><ArrowRight size={16} /><Cloud size={16} /></div
>
@@ -898,7 +924,7 @@ vault write auth/{jwtMount}/role/{$values['secret_backend']?.jwt_role || 'windmi
startIcon={{ icon: ArrowRight }}>Migrate to Azure KV</Button
>
</div>
<div class="flex-1 p-3 border rounded-lg">
<div class="flex-1 p-3 border rounded-md">
<div class="flex items-center gap-2 mb-2"
><Cloud size={16} /><ArrowLeft size={16} /><Database size={16} /></div
>
@@ -916,11 +942,11 @@ vault write auth/{jwtMount}/role/{$values['secret_backend']?.jwt_role || 'windmi
</div>
</div>
{:else if selectedType === 'AwsSecretsManager'}
<div class="space-y-4 p-4 border rounded-lg">
<div class="space-y-4 p-4 border rounded-md bg-surface-tertiary">
<div class="flex items-center gap-2 mb-4">
<Cloud class="text-primary" size={20} />
<div>
<p class="text-sm font-medium text-emphasis">AWS Secrets Manager Configuration</p>
<p class="text-sm font-semibold text-emphasis">AWS Secrets Manager configuration</p>
<p class="text-xs text-secondary">Store secrets in AWS Secrets Manager.</p>
</div>
</div>
@@ -935,9 +961,9 @@ vault write auth/{jwtMount}/role/{$values['secret_backend']?.jwt_role || 'windmi
</div>
<div class="flex flex-col gap-1">
<label for="aws_sm_access_key_id" class="block text-xs font-semibold text-emphasis"
>Access Key ID (optional)</label
>Access key ID (optional)</label
>
<span class="text-2xs text-secondary"
<span class="text-xs text-secondary"
>If not provided, the default AWS credential chain is used (env vars, instance profile,
EKS pod identity)</span
>
@@ -951,17 +977,17 @@ vault write auth/{jwtMount}/role/{$values['secret_backend']?.jwt_role || 'windmi
bind:value={$values['secret_backend'].access_key_id}
/>
</div>
<div class="flex flex-col gap-1 p-3 bg-surface-secondary rounded-lg">
<div class="flex flex-col gap-1 p-3 bg-surface-secondary rounded-md">
<label for="aws_sm_secret_access_key" class="block text-xs font-semibold text-emphasis"
>Secret Access Key (optional)</label
>Secret access key (optional)</label
>
<Password bind:password={$values['secret_backend'].secret_access_key} small {disabled} />
</div>
<div class="flex flex-col gap-1">
<label for="aws_sm_prefix" class="block text-xs font-semibold text-emphasis"
>Secret Name Prefix (optional)</label
>Secret name prefix (optional)</label
>
<span class="text-2xs text-secondary"
<span class="text-xs text-secondary"
>Prefix for secret names in AWS Secrets Manager (default: windmill/)</span
>
<TextInput
@@ -973,7 +999,7 @@ vault write auth/{jwtMount}/role/{$values['secret_backend']?.jwt_role || 'windmi
<label for="aws_sm_endpoint_url" class="block text-xs font-semibold text-emphasis"
>Endpoint URL (optional)</label
>
<span class="text-2xs text-secondary"
<span class="text-xs text-secondary"
>Custom endpoint for LocalStack or other compatible services</span
>
<TextInput
@@ -990,19 +1016,19 @@ vault write auth/{jwtMount}/role/{$values['secret_backend']?.jwt_role || 'windmi
<div class="flex flex-col gap-4 pt-4 border-t">
<Button
unifiedSize="md"
variant="accent"
variant="default"
onclick={testAwsSmConnection}
disabled={disabled || !isAwsSmConfigValid() || testingAwsSmConnection}
loading={testingAwsSmConnection}
startIcon={{ icon: Server }}>Test Connection</Button
startIcon={{ icon: Server }}>Test connection</Button
>
<div class="flex flex-col gap-4 pt-4 border-t">
<span class="block text-xs font-semibold text-emphasis">Secret Migration</span>
<span class="text-2xs text-secondary"
<span class="block text-xs font-semibold text-emphasis">Secret migration</span>
<span class="text-xs text-secondary"
>Original values are NOT deleted to allow for rollback.</span
>
<div class="flex gap-4">
<div class="flex-1 p-3 border rounded-lg">
<div class="flex-1 p-3 border rounded-md">
<div class="flex items-center gap-2 mb-2"
><Database size={16} /><ArrowRight size={16} /><Cloud size={16} /></div
>
@@ -1015,7 +1041,7 @@ vault write auth/{jwtMount}/role/{$values['secret_backend']?.jwt_role || 'windmi
startIcon={{ icon: ArrowRight }}>Migrate to AWS SM</Button
>
</div>
<div class="flex-1 p-3 border rounded-lg">
<div class="flex-1 p-3 border rounded-md">
<div class="flex items-center gap-2 mb-2"
><Cloud size={16} /><ArrowLeft size={16} /><Database size={16} /></div
>