Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

feat(secrets-17): address feedback

Tre Dubrava33a285b82e2e
diff --git a/backend/src/ee/services/dynamic-secret/providers/clickhouse.ts b/backend/src/ee/services/dynamic-secret/providers/clickhouse.ts
index aded11a808..fc4f0d41cb 100644
--- a/backend/src/ee/services/dynamic-secret/providers/clickhouse.ts
+++ b/backend/src/ee/services/dynamic-secret/providers/clickhouse.ts
@@ -25,7 +25,7 @@ const DEFAULT_PASSWORD_REQUIREMENTS: PasswordRequirements = {
lowercase: 1,
uppercase: 1,
digits: 1,
- symbols: 0
+ symbols: 1
},
allowedSymbols: "-_.~!*"
};
@@ -109,8 +109,18 @@ export const ClickhouseProvider = ({
const validateProviderInputs = async (inputs: unknown) => {
const providerInputs = await DynamicSecretClickhouseSchema.parseAsync(inputs);
+ let { host } = providerInputs;
+ let hostProtocol: string | undefined;
+ if (host.startsWith("https://")) {
+ host = host.slice("https://".length);
+ hostProtocol = "https";
+ } else if (host.startsWith("http://")) {
+ host = host.slice("http://".length);
+ hostProtocol = "http";
+ }
+
const [hostIp] = await verifyHostInputValidity({
- host: providerInputs.host,
+ host,
isGateway: Boolean(providerInputs.gatewayId),
isDynamicSecret: true
});
@@ -129,11 +139,13 @@ export const ClickhouseProvider = ({
allowedExpressions: (val) => ["username", "database"].includes(val)
});
- return { ...providerInputs, hostIp };
+ return { ...providerInputs, host, hostIp, hostProtocol };
};
- const $getClient = async (providerInputs: z.infer<typeof DynamicSecretClickhouseSchema> & { hostIp: string }) => {
- const protocol = (providerInputs.sslEnabled ?? Boolean(providerInputs.ca)) ? "https" : "http";
+ const $getClient = async (
+ providerInputs: z.infer<typeof DynamicSecretClickhouseSchema> & { hostIp: string; hostProtocol?: string }
+ ) => {
+ const protocol = providerInputs.hostProtocol ?? (providerInputs.ca ? "https" : "http");
const url = `${protocol}://${providerInputs.host}:${providerInputs.port}`;
const client = createClient({
diff --git a/backend/src/ee/services/dynamic-secret/providers/models.ts b/backend/src/ee/services/dynamic-secret/providers/models.ts
index 8c108e76ce..38703ae7bb 100644
--- a/backend/src/ee/services/dynamic-secret/providers/models.ts
+++ b/backend/src/ee/services/dynamic-secret/providers/models.ts
@@ -179,7 +179,7 @@ export const DynamicSecretSqlDBSchema = z.object({
});
export const DynamicSecretClickhouseSchema = z.object({
- host: z.string().trim().toLowerCase(),
+ host: z.string().trim(),
port: z.number(),
database: z.string().trim(),
username: z.string().trim(),
@@ -210,7 +210,6 @@ export const DynamicSecretClickhouseSchema = z.object({
revocationStatement: z.string().trim(),
renewStatement: z.string().trim().optional(),
ca: z.string().optional(),
- sslEnabled: z.boolean().optional(),
gatewayId: z.string().nullable().optional()
});
diff --git a/docs/documentation/platform/dynamic-secrets/clickhouse.mdx b/docs/documentation/platform/dynamic-secrets/clickhouse.mdx
index 85030078c9..42ca6a6e62 100644
--- a/docs/documentation/platform/dynamic-secrets/clickhouse.mdx
+++ b/docs/documentation/platform/dynamic-secrets/clickhouse.mdx
@@ -11,15 +11,6 @@ The Infisical ClickHouse dynamic secret allows you to generate ClickHouse databa
Create a user with the required permissions in your ClickHouse instance. This user will be used to create new accounts on-demand.
-```sql
-CREATE USER 'infisical' IDENTIFIED WITH sha256_password BY '<strong-password>';
-GRANT CREATE USER, DROP USER, GRANT OPTION ON *.* TO 'infisical';
-```
-
-<Note>
- The `GRANT OPTION` privilege is required so that the service user can grant permissions to the dynamically created users.
-</Note>
-
## Set up Dynamic Secrets with ClickHouse
<Steps>
@@ -50,11 +41,11 @@ GRANT CREATE USER, DROP USER, GRANT OPTION ON *.* TO 'infisical';
</ParamField>
<ParamField path="Host" type="string" required>
- ClickHouse server hostname or IP address
+ ClickHouse server hostname or IP address (e.g., `https://your-host.clickhouse.cloud`)
</ParamField>
<ParamField path="Port" type="number" required>
- ClickHouse HTTP interface port. Defaults to `8123` (HTTP) or `8443` (HTTPS).
+ ClickHouse HTTP interface port. Use `8123` for HTTP or `8443` for HTTPS / ClickHouse Cloud.
</ParamField>
<ParamField path="User" type="string" required>
@@ -74,7 +65,7 @@ GRANT CREATE USER, DROP USER, GRANT OPTION ON *.* TO 'infisical';
</ParamField>
<ParamField path="CA (SSL)" type="string">
- A CA certificate may be required if your ClickHouse instance uses TLS with a self-signed or private certificate. Providing a CA also enables HTTPS automatically.
+ Only needed if your ClickHouse instance uses a self-signed or private CA certificate. ClickHouse Cloud uses publicly trusted certificates, so no CA is required — just include `https://` in the host. Providing a CA also enables HTTPS automatically.
</ParamField>
![ClickHouse Dynamic Secret Setup Modal](../../../images/platform/dynamic-secrets/dynamic-secret-clickhouse-form.png)
diff --git a/docs/snippets/DynamicSecretsBrowser.jsx b/docs/snippets/DynamicSecretsBrowser.jsx
index 650e47c3cb..b9027fe3b2 100644
--- a/docs/snippets/DynamicSecretsBrowser.jsx
+++ b/docs/snippets/DynamicSecretsBrowser.jsx
@@ -13,6 +13,7 @@ export const DynamicSecretsBrowser = () => {
{"name": "Azure SQL Database", "slug": "azure-sql-database", "path": "/documentation/platform/dynamic-secrets/azure-sql-database", "description": "Learn how to generate dynamic Azure SQL Database credentials on-demand.", "category": "Databases"},
{"name": "GCP IAM", "slug": "gcp-iam", "path": "/documentation/platform/dynamic-secrets/gcp-iam", "description": "Learn how to generate dynamic GCP IAM credentials on-demand.", "category": "Cloud Providers"},
{"name": "Cassandra", "slug": "cassandra", "path": "/documentation/platform/dynamic-secrets/cassandra", "description": "Learn how to generate dynamic Cassandra database credentials on-demand.", "category": "Databases"},
+ {"name": "ClickHouse", "slug": "clickhouse", "path": "/documentation/platform/dynamic-secrets/clickhouse", "description": "Learn how to generate dynamic ClickHouse database credentials on-demand.", "category": "Databases"},
{"name": "Couchbase", "slug": "couchbase", "path": "/documentation/platform/dynamic-secrets/couchbase", "description": "Learn how to generate dynamic Couchbase database credentials on-demand.", "category": "Databases"},
{"name": "MongoDB", "slug": "mongodb", "path": "/documentation/platform/dynamic-secrets/mongo-db", "description": "Learn how to generate dynamic MongoDB database credentials on-demand.", "category": "Databases"},
{"name": "MongoDB Atlas", "slug": "mongodb-atlas", "path": "/documentation/platform/dynamic-secrets/mongo-atlas", "description": "Learn how to generate dynamic MongoDB Atlas database credentials on-demand.", "category": "Databases"},
diff --git a/frontend/src/hooks/api/dynamicSecret/types.ts b/frontend/src/hooks/api/dynamicSecret/types.ts
index 94dedaf6ca..97a4b37c1b 100644
--- a/frontend/src/hooks/api/dynamicSecret/types.ts
+++ b/frontend/src/hooks/api/dynamicSecret/types.ts
@@ -437,7 +437,6 @@ export type TDynamicSecretProvider =
revocationStatement: string;
renewStatement?: string;
ca?: string;
- sslEnabled?: boolean;
gatewayId?: string;
passwordRequirements?: {
length: number;
diff --git a/frontend/src/pages/secret-manager/SecretDashboardPage/components/ActionBar/CreateDynamicSecretForm/ClickHouseInputForm.tsx b/frontend/src/pages/secret-manager/SecretDashboardPage/components/ActionBar/CreateDynamicSecretForm/ClickHouseInputForm.tsx
index e9e7508073..6b992f951e 100644
--- a/frontend/src/pages/secret-manager/SecretDashboardPage/components/ActionBar/CreateDynamicSecretForm/ClickHouseInputForm.tsx
+++ b/frontend/src/pages/secret-manager/SecretDashboardPage/components/ActionBar/CreateDynamicSecretForm/ClickHouseInputForm.tsx
@@ -55,7 +55,7 @@ const passwordRequirementsSchema = z
const formSchema = z.object({
provider: z.object({
- host: z.string().toLowerCase().min(1),
+ host: z.string().min(1),
port: z.coerce.number(),
database: z.string().min(1),
username: z.string().min(1),
@@ -64,7 +64,6 @@ const formSchema = z.object({
creationStatement: z.string().min(1),
revocationStatement: z.string().min(1),
renewStatement: z.string().optional(),
- sslEnabled: z.boolean().optional(),
ca: z.string().optional(),
gatewayId: z.string().optional()
}),
@@ -100,6 +99,17 @@ const formSchema = z.object({
type TForm = z.infer<typeof formSchema>;
+const DEFAULT_PASSWORD_REQUIREMENTS = {
+ length: 48,
+ required: {
+ lowercase: 1,
+ uppercase: 1,
+ digits: 1,
+ symbols: 1
+ },
+ allowedSymbols: "-_.~!*"
+};
+
type Props = {
onCompleted: () => void;
onCancel: () => void;
@@ -135,16 +145,7 @@ export const ClickHouseInputForm = ({
"CREATE USER '{{username}}' IDENTIFIED WITH sha256_password BY '{{password}}';\nGRANT SELECT ON {{database}}.* TO '{{username}}';",
revocationStatement: "DROP USER IF EXISTS '{{username}}';",
renewStatement: "",
- passwordRequirements: {
- length: 48,
- required: {
- lowercase: 1,
- uppercase: 1,
- digits: 1,
- symbols: 0
- },
- allowedSymbols: "-_.~!*"
- }
+ passwordRequirements: DEFAULT_PASSWORD_REQUIREMENTS
},
environment: isSingleEnvironmentMode ? environments[0] : undefined,
usernameTemplate: "{{randomUsername}}"
@@ -305,7 +306,7 @@ export const ClickHouseInputForm = ({
isError={Boolean(error?.message)}
errorText={error?.message}
>
- <Input {...field} />
+ <Input {...field} placeholder="https://your-host.clickhouse.cloud" />
</FormControl>
)}
/>
@@ -374,7 +375,7 @@ export const ClickHouseInputForm = ({
render={({ field, fieldState: { error } }) => (
<FormControl
isOptional
- label="CA (SSL)"
+ label="CA (SSL) - optionally needed for self-signed certificates"
isError={Boolean(error?.message)}
errorText={error?.message}
>
diff --git a/frontend/src/pages/secret-manager/SecretDashboardPage/components/DynamicSecretListView/CreateDynamicSecretLease.tsx b/frontend/src/pages/secret-manager/SecretDashboardPage/components/DynamicSecretListView/CreateDynamicSecretLease.tsx
index 99e66e8b7d..247063142c 100644
--- a/frontend/src/pages/secret-manager/SecretDashboardPage/components/DynamicSecretListView/CreateDynamicSecretLease.tsx
+++ b/frontend/src/pages/secret-manager/SecretDashboardPage/components/DynamicSecretListView/CreateDynamicSecretLease.tsx
@@ -139,7 +139,8 @@ const renderOutputForm = (
provider === DynamicSecretProviders.MongoDB ||
provider === DynamicSecretProviders.Vertica ||
provider === DynamicSecretProviders.SapAse ||
- provider === DynamicSecretProviders.AzureSqlDatabase
+ provider === DynamicSecretProviders.AzureSqlDatabase ||
+ provider === DynamicSecretProviders.Clickhouse
) {
const { DB_PASSWORD, DB_USERNAME } = data as { DB_USERNAME: string; DB_PASSWORD: string };
return (
diff --git a/frontend/src/pages/secret-manager/SecretDashboardPage/components/DynamicSecretListView/EditDynamicSecretForm/EditDynamicSecretClickHouseForm.tsx b/frontend/src/pages/secret-manager/SecretDashboardPage/components/DynamicSecretListView/EditDynamicSecretForm/EditDynamicSecretClickHouseForm.tsx
index 60c5082601..bb1f3b8fbe 100644
--- a/frontend/src/pages/secret-manager/SecretDashboardPage/components/DynamicSecretListView/EditDynamicSecretForm/EditDynamicSecretClickHouseForm.tsx
+++ b/frontend/src/pages/secret-manager/SecretDashboardPage/components/DynamicSecretListView/EditDynamicSecretForm/EditDynamicSecretClickHouseForm.tsx
@@ -53,7 +53,7 @@ const passwordRequirementsSchema = z
const formSchema = z.object({
inputs: z
.object({
- host: z.string().toLowerCase().min(1),
+ host: z.string().min(1),
port: z.number(),
database: z.string().min(1),
username: z.string().min(1),
@@ -112,7 +112,7 @@ const DEFAULT_PASSWORD_REQUIREMENTS = {
lowercase: 1,
uppercase: 1,
digits: 1,
- symbols: 0
+ symbols: 1
},
allowedSymbols: "-_.~!*"
};
@@ -307,7 +307,7 @@ export const EditDynamicSecretClickHouseForm = ({
isError={Boolean(error?.message)}
errorText={error?.message}
>
- <Input {...field} />
+ <Input {...field} placeholder="https://your-host.clickhouse.cloud" />
</FormControl>
)}
/>
@@ -380,7 +380,7 @@ export const EditDynamicSecretClickHouseForm = ({
render={({ field, fieldState: { error } }) => (
<FormControl
isOptional
- label="CA (SSL)"
+ label="CA (SSL) - optionally needed for self-signed certificates"
isError={Boolean(error?.message)}
errorText={error?.message}
>