Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
add remaining rotations that do not use oauth
adilson010ef5af0249
diff --git a/backend/src/ee/services/secret-rotation-v2/aws-iam-user-secret/aws-iam-user-secret-rotation-fns.ts b/backend/src/ee/services/secret-rotation-v2/aws-iam-user-secret/aws-iam-user-secret-rotation-fns.tsindex b4782a240f..1bb0d14a50 100644--- a/backend/src/ee/services/secret-rotation-v2/aws-iam-user-secret/aws-iam-user-secret-rotation-fns.ts+++ b/backend/src/ee/services/secret-rotation-v2/aws-iam-user-secret/aws-iam-user-secret-rotation-fns.ts@@ -2,6 +2,7 @@ import {type AccessKeyMetadata,CreateAccessKeyCommand,DeleteAccessKeyCommand,+ GetUserCommand,IAMClient,ListAccessKeysCommand} from "@aws-sdk/client-iam";@@ -12,6 +13,7 @@ import {} from "@app/ee/services/secret-rotation-v2/aws-iam-user-secret/aws-iam-user-secret-rotation-types";import {TRotationFactory,+ TRotationFactoryCheckActiveCredentials,TRotationFactoryGetSecretsPayload,TRotationFactoryIssueCredentials,TRotationFactoryRevokeCredentials,@@ -120,10 +122,31 @@ export const awsIamUserSecretRotationFactory: TRotationFactory<return secrets;};+ const checkActiveCredentials: TRotationFactoryCheckActiveCredentials<+ TAwsIamUserSecretRotationGeneratedCredentials+ > = async ({ accessKeyId, secretAccessKey }) => {+ const { region: resolvedRegion } = await getAwsConnectionConfig(connection, region);+ const iam = new IAMClient({+ credentials: { accessKeyId, secretAccessKey },+ region: resolvedRegion+ });++ try {+ await iam.send(new GetUserCommand({}));+ } catch (err) {+ const errName = (err as { name?: string }).name;+ // AccessDenied means the credentials authenticated successfully but the IAM user+ // lacks iam:GetUser on themselves — the credential is still valid for our purposes.+ if (errName === "AccessDenied") return;+ throw err;+ }+ };+return {issueCredentials,revokeCredentials,rotateCredentials,- getSecretsPayload+ getSecretsPayload,+ checkActiveCredentials};};diff --git a/backend/src/ee/services/secret-rotation-v2/dbt-service-token/dbt-service-token-rotation-fns.ts b/backend/src/ee/services/secret-rotation-v2/dbt-service-token/dbt-service-token-rotation-fns.tsindex ec3a324652..c60b9feda2 100644--- a/backend/src/ee/services/secret-rotation-v2/dbt-service-token/dbt-service-token-rotation-fns.ts+++ b/backend/src/ee/services/secret-rotation-v2/dbt-service-token/dbt-service-token-rotation-fns.ts@@ -3,6 +3,7 @@ import { AxiosError } from "axios";import {TRotationFactory,+ TRotationFactoryCheckActiveCredentials,TRotationFactoryGetSecretsPayload,TRotationFactoryIssueCredentials,TRotationFactoryRevokeCredentials,@@ -209,10 +210,34 @@ export const dbtServiceTokenRotationFactory: TRotationFactory<serviceToken}) => [{ key: secretsMapping.serviceToken, value: serviceToken }];+ const checkActiveCredentials: TRotationFactoryCheckActiveCredentials<+ TDbtServiceTokenRotationGeneratedCredentials+ > = async ({ serviceToken }) => {+ const instanceUrl = await getDbtUrl(connection);++ try {+ await request.get(`${instanceUrl}/api/v2/accounts/${connection.credentials.accountId}/`, {+ headers: {+ Accept: "application/json",+ Authorization: `Bearer ${serviceToken}`+ }+ });+ } catch (error: unknown) {+ if (error instanceof AxiosError) {+ const dbtErrorMessage = createDbtError(error);+ throw new BadRequestError({+ message: `DBT service token verification failed: ${dbtErrorMessage ?? error.message ?? "Unknown error"}`+ });+ }+ throw error;+ }+ };+return {issueCredentials,revokeCredentials,rotateCredentials,- getSecretsPayload+ getSecretsPayload,+ checkActiveCredentials};};diff --git a/backend/src/ee/services/secret-rotation-v2/hp-ilo-rotation/hp-ilo-rotation-fns.ts b/backend/src/ee/services/secret-rotation-v2/hp-ilo-rotation/hp-ilo-rotation-fns.tsindex 36d005a51d..2219d6998a 100644--- a/backend/src/ee/services/secret-rotation-v2/hp-ilo-rotation/hp-ilo-rotation-fns.ts+++ b/backend/src/ee/services/secret-rotation-v2/hp-ilo-rotation/hp-ilo-rotation-fns.ts@@ -268,9 +268,10 @@ export const hpIloRotationFactory: TRotationFactory<];};- const checkActiveCredentials: TRotationFactoryCheckActiveCredentials<- THpIloRotationGeneratedCredentials- > = async ({ username: activeUsername, password }) => {+ const checkActiveCredentials: TRotationFactoryCheckActiveCredentials<THpIloRotationGeneratedCredentials> = async ({+ username: activeUsername,+ password+ }) => {await verifyIloPassword(sshConfig, gatewayV2Service, activeUsername, password);};diff --git a/backend/src/ee/services/secret-rotation-v2/open-router-api-key/open-router-api-key-rotation-fns.ts b/backend/src/ee/services/secret-rotation-v2/open-router-api-key/open-router-api-key-rotation-fns.tsindex e916c1e7fe..cbf8b901ad 100644--- a/backend/src/ee/services/secret-rotation-v2/open-router-api-key/open-router-api-key-rotation-fns.ts+++ b/backend/src/ee/services/secret-rotation-v2/open-router-api-key/open-router-api-key-rotation-fns.ts@@ -2,6 +2,7 @@ import { AxiosError } from "axios";import {TRotationFactory,+ TRotationFactoryCheckActiveCredentials,TRotationFactoryGetSecretsPayload,TRotationFactoryIssueCredentials,TRotationFactoryRevokeCredentials,@@ -173,10 +174,25 @@ export const openRouterApiKeyRotationFactory: TRotationFactory<apiKey}) => [{ key: secretsMapping.apiKey, value: apiKey }];+ const checkActiveCredentials: TRotationFactoryCheckActiveCredentials<+ TOpenRouterApiKeyRotationGeneratedCredentials+ > = async ({ apiKey }) => {+ try {+ await request.get(`${OPEN_ROUTER_API_BASE_URL}/auth/key`, {+ headers: { Authorization: `Bearer ${apiKey}` }+ });+ } catch (error: unknown) {+ throw new BadRequestError({+ message: `OpenRouter API key verification failed: ${createErrorMessage(error)}`+ });+ }+ };+return {issueCredentials,revokeCredentials,rotateCredentials,- getSecretsPayload+ getSecretsPayload,+ checkActiveCredentials};};diff --git a/backend/src/ee/services/secret-rotation-v2/redis-credentials/redis-credentials-rotation-fns.ts b/backend/src/ee/services/secret-rotation-v2/redis-credentials/redis-credentials-rotation-fns.tsindex 7974336f7e..2f533951c5 100644--- a/backend/src/ee/services/secret-rotation-v2/redis-credentials/redis-credentials-rotation-fns.ts+++ b/backend/src/ee/services/secret-rotation-v2/redis-credentials/redis-credentials-rotation-fns.ts@@ -93,7 +93,7 @@ export const redisCredentialsRotationFactory: TRotationFactory<})});- const result = await conn.auth(credentials.username, credentials.password, () => {});+ const result: string = await conn.auth(credentials.username, credentials.password, () => {});if (result !== "OK") {throw new BadRequestError({ message: `Invalid credentials, Redis returned ${result} status` });diff --git a/backend/src/ee/services/secret-rotation-v2/supabase-api-key/supabase-api-key-rotation-fns.ts b/backend/src/ee/services/secret-rotation-v2/supabase-api-key/supabase-api-key-rotation-fns.tsindex 2d898d3f86..81c69e8ae1 100644--- a/backend/src/ee/services/secret-rotation-v2/supabase-api-key/supabase-api-key-rotation-fns.ts+++ b/backend/src/ee/services/secret-rotation-v2/supabase-api-key/supabase-api-key-rotation-fns.ts@@ -2,6 +2,7 @@ import { AxiosError } from "axios";import {TRotationFactory,+ TRotationFactoryCheckActiveCredentials,TRotationFactoryGetSecretsPayload,TRotationFactoryIssueCredentials,TRotationFactoryRevokeCredentials,@@ -9,6 +10,7 @@ import {} from "@app/ee/services/secret-rotation-v2/secret-rotation-v2-types";import { request } from "@app/lib/config/request";import { BadRequestError } from "@app/lib/errors";+import { blockLocalAndPrivateIpAddresses } from "@app/lib/validator";import {getSupabaseAuthHeaders,getSupabaseInstanceUrl@@ -147,10 +149,33 @@ export const supabaseApiKeyRotationFactory: TRotationFactory<apiKey}) => [{ key: secretsMapping.apiKey, value: apiKey }];+ const checkActiveCredentials: TRotationFactoryCheckActiveCredentials<+ TSupabaseApiKeyRotationGeneratedCredentials+ > = async ({ apiKey }) => {+ // Project URL follows Supabase Cloud pattern. Self-hosted instances expose project APIs+ // on user-defined hosts that are not derivable from projectRef alone.+ const projectUrl = `https://${projectRef}.supabase.co`;+ await blockLocalAndPrivateIpAddresses(projectUrl);++ try {+ await request.get(`${projectUrl}/auth/v1/settings`, {+ headers: {+ apikey: apiKey,+ Authorization: `Bearer ${apiKey}`+ }+ });+ } catch (error: unknown) {+ throw new BadRequestError({+ message: `Supabase API key verification failed: ${createErrorMessage(error)}`+ });+ }+ };+return {issueCredentials,revokeCredentials,rotateCredentials,- getSecretsPayload+ getSecretsPayload,+ checkActiveCredentials};};