Skip to content

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

fix(honey-tokens): requested changes

Daniel0eabc0e5ad8e
diff --git a/backend/src/ee/routes/v1/honey-token-routers/honey-token-endpoints.ts b/backend/src/ee/routes/v1/honey-token-routers/honey-token-endpoints.ts
index b5a6bf94f2..41e4e2cb17 100644
--- a/backend/src/ee/routes/v1/honey-token-routers/honey-token-endpoints.ts
+++ b/backend/src/ee/routes/v1/honey-token-routers/honey-token-endpoints.ts
@@ -6,7 +6,6 @@ import {
THoneyTokenConfigByType,
THoneyTokenTestConnectionResponseByType
} from "@app/ee/services/honey-token/honey-token-provider-types";
-import { logger } from "@app/lib/logger";
import { readLimit, writeLimit } from "@app/server/config/rateLimiter";
import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
import { AuthMode } from "@app/services/auth/auth-type";
@@ -141,8 +140,6 @@ export const registerHoneyTokenEndpoints = <TType extends HoneyTokenType>({
}
},
handler: async (req) => {
- logger.info({ payload: req.body, headers: req.headers, type }, `Honey token trigger received [type=${type}]`);
-
const { acknowledged } = await server.services.honeyToken.handleTrigger({
type,
signature: req.headers["x-infisical-signature"] as string | undefined,
diff --git a/backend/src/ee/services/honey-token-config/honey-token-config-service.ts b/backend/src/ee/services/honey-token-config/honey-token-config-service.ts
index 49cea05ed3..198667114a 100644
--- a/backend/src/ee/services/honey-token-config/honey-token-config-service.ts
+++ b/backend/src/ee/services/honey-token-config/honey-token-config-service.ts
@@ -1,7 +1,7 @@
import { ForbiddenError } from "@casl/ability";
import { OrganizationActionScope } from "@app/db/schemas";
-import { BadRequestError, NotFoundError } from "@app/lib/errors";
+import { BadRequestError } from "@app/lib/errors";
import { HoneyTokenType } from "../honey-token/honey-token-enums";
import {
@@ -58,13 +58,23 @@ export const honeyTokenConfigServiceFactory = (deps: THoneyTokenConfigServiceFac
);
const providerType = assertSupportedHoneyTokenType(type);
+ const providerDefinition = getHoneyTokenProviderDefinition(providerType);
const provider = honeyTokenConfigProviderByType[providerType];
+
if (!provider) {
throw new BadRequestError({ message: "Unsupported honey token type" });
}
- const appConnection = await deps.appConnectionDAL.findById(connectionId);
- if (!appConnection || appConnection.orgId !== orgPermission.orgId) {
- throw new NotFoundError({ message: `Could not find App Connection with ID ${connectionId}` });
+
+ const appConnection = await deps.appConnectionService.validateAppConnectionUsageById(
+ providerDefinition.connectionApp,
+ { connectionId, projectId: orgPermission.orgId },
+ orgPermission
+ );
+
+ if (appConnection.projectId) {
+ throw new BadRequestError({
+ message: `Honey token integrations only support organization-level app connections. Please use an organization-level app connection.`
+ });
}
assertHoneyTokenConnectionType(providerType, appConnection.app);
diff --git a/backend/src/ee/services/honey-token-config/honey-token-config-types.ts b/backend/src/ee/services/honey-token-config/honey-token-config-types.ts
index d1ca01e9fb..bfbe86d352 100644
--- a/backend/src/ee/services/honey-token-config/honey-token-config-types.ts
+++ b/backend/src/ee/services/honey-token-config/honey-token-config-types.ts
@@ -1,5 +1,6 @@
import { OrgServiceActor } from "@app/lib/types";
import { TAppConnectionDALFactory } from "@app/services/app-connection/app-connection-dal";
+import { TAppConnectionServiceFactory } from "@app/services/app-connection/app-connection-service";
import { TKmsServiceFactory } from "@app/services/kms/kms-service";
import {
@@ -21,6 +22,7 @@ export type THoneyTokenConfigServiceFactoryDep = {
kmsService: Pick<TKmsServiceFactory, "createCipherPairWithDataKey">;
licenseService: Pick<TLicenseServiceFactory, "getPlan">;
appConnectionDAL: Pick<TAppConnectionDALFactory, "findById">;
+ appConnectionService: Pick<TAppConnectionServiceFactory, "validateAppConnectionUsageById">;
};
export type THoneyTokenConfigProviderUpsertInput<T extends HoneyTokenType = HoneyTokenType> = {
diff --git a/backend/src/ee/services/honey-token/aws/honey-token-aws-fns.ts b/backend/src/ee/services/honey-token/aws/honey-token-aws-fns.ts
index dd05f56bcf..fa1293c23e 100644
--- a/backend/src/ee/services/honey-token/aws/honey-token-aws-fns.ts
+++ b/backend/src/ee/services/honey-token/aws/honey-token-aws-fns.ts
@@ -13,6 +13,7 @@ import { BadRequestError } from "@app/lib/errors";
import { logger } from "@app/lib/logger";
import { TAppConnectionDALFactory } from "@app/services/app-connection/app-connection-dal";
import { decryptAppConnection } from "@app/services/app-connection/app-connection-fns";
+import { TAppConnectionServiceFactory } from "@app/services/app-connection/app-connection-service";
import { getAwsConnectionConfig } from "@app/services/app-connection/aws";
import { AwsConnectionSchema } from "@app/services/app-connection/aws/aws-connection-schemas";
import { TAwsConnectionConfig } from "@app/services/app-connection/aws/aws-connection-types";
@@ -55,14 +56,12 @@ const parseAwsConnectionConfig = (decryptedConnection: unknown): TAwsConnectionC
};
export const verifyAwsStackDeployment = async ({
- orgId,
connectionId,
stackName,
awsRegion,
appConnectionDAL,
kmsService
}: {
- orgId: string;
connectionId: string;
stackName: string;
awsRegion: string;
@@ -71,8 +70,7 @@ export const verifyAwsStackDeployment = async ({
}): Promise<{ deployed: boolean; status: string | null }> => {
try {
const appConnection = await appConnectionDAL.findById(connectionId);
- // Honey token integrations only support organization-level app connections.
- if (!appConnection || appConnection.orgId !== orgId || appConnection.projectId != null) {
+ if (!appConnection) {
return { deployed: false, status: null };
}
@@ -270,7 +268,6 @@ export const honeyTokenAwsConfigProviderFactory = ({
const storedConfig = AwsHoneyTokenConfigSchema.parse(JSON.parse(decrypted.toString()) as unknown);
const stackDeployment = await verifyAwsStackDeployment({
- orgId,
connectionId: config.connectionId,
stackName: storedConfig.stackName,
awsRegion: storedConfig.awsRegion,
diff --git a/backend/src/ee/services/honey-token/aws/honey-token-aws-service.ts b/backend/src/ee/services/honey-token/aws/honey-token-aws-service.ts
index 8f1b0428f8..0305c70b13 100644
--- a/backend/src/ee/services/honey-token/aws/honey-token-aws-service.ts
+++ b/backend/src/ee/services/honey-token/aws/honey-token-aws-service.ts
@@ -47,7 +47,6 @@ export const honeyTokenAwsProviderHooksFactory = ({
: null;
return verifyAwsStackDeployment({
- orgId,
connectionId,
stackName: config?.stackName ?? "infisical-honey-tokens",
awsRegion: config?.awsRegion ?? "us-east-1",
diff --git a/backend/src/ee/services/honey-token/honey-token-dal.ts b/backend/src/ee/services/honey-token/honey-token-dal.ts
index 6a4f80fa30..5edd428885 100644
--- a/backend/src/ee/services/honey-token/honey-token-dal.ts
+++ b/backend/src/ee/services/honey-token/honey-token-dal.ts
@@ -2,8 +2,7 @@ import { Knex } from "knex";
import { TDbClient } from "@app/db";
import { TableName } from "@app/db/schemas";
-import { HoneyTokensSchema, THoneyTokens } from "@app/db/schemas/honey-tokens";
-import { ormify } from "@app/lib/knex";
+import { ormify, selectAllTableCols } from "@app/lib/knex";
export type THoneyTokenDALFactory = ReturnType<typeof honeyTokenDALFactory>;
@@ -69,38 +68,25 @@ export const honeyTokenDALFactory = (db: TDbClient) => {
return Number(result?.count ?? 0);
};
- const findOneByTokenIdentifierAndOrgId = async (
- tokenIdentifier: string,
- orgId: string,
- tx?: Knex
- ): Promise<THoneyTokens | null> => {
- const row: unknown = await (tx || db.replicaNode())(TableName.HoneyToken)
+ const findOneByTokenIdentifierAndOrgId = async (tokenIdentifier: string, orgId: string, tx?: Knex) => {
+ const row = await (tx || db.replicaNode())(TableName.HoneyToken)
.join(TableName.Project, `${TableName.HoneyToken}.projectId`, `${TableName.Project}.id`)
.where(`${TableName.HoneyToken}.tokenIdentifier`, tokenIdentifier)
.andWhere(`${TableName.Project}.orgId`, orgId)
- .select(`${TableName.HoneyToken}.*`)
+ .select(selectAllTableCols(TableName.HoneyToken))
.first();
- return row ? HoneyTokensSchema.parse(row) : null;
+ return row ?? null;
};
- const findOneByTokenIdentifier = async (
- tokenIdentifier: string,
- tx?: Knex
- ): Promise<{ honeyToken: THoneyTokens; orgId: string } | null> => {
- const row: unknown = await (tx || db.replicaNode())(TableName.HoneyToken)
+ const findOneByTokenIdentifier = async (tokenIdentifier: string, tx?: Knex) => {
+ const row = await (tx || db.replicaNode())(TableName.HoneyToken)
.join(TableName.Project, `${TableName.HoneyToken}.projectId`, `${TableName.Project}.id`)
.where(`${TableName.HoneyToken}.tokenIdentifier`, tokenIdentifier)
- .select(`${TableName.HoneyToken}.*`, db.ref("orgId").withSchema(TableName.Project).as("orgId"))
+ .select(selectAllTableCols(TableName.HoneyToken), db.ref("orgId").withSchema(TableName.Project).as("orgId"))
.first();
- if (!row) return null;
- const parsedRow = HoneyTokensSchema.extend({ orgId: HoneyTokensSchema.shape.id }).parse(row);
-
- return {
- honeyToken: HoneyTokensSchema.parse(parsedRow),
- orgId: parsedRow.orgId
- };
+ return row ?? null;
};
const countByOrgId = async (orgId: string, tx?: Knex) => {
@@ -115,16 +101,11 @@ export const honeyTokenDALFactory = (db: TDbClient) => {
return Number(result?.count ?? 0);
};
- const tryMarkTriggered = async (
- tokenIdentifier: string,
- cooldownMs: number,
- tx?: Knex
- ): Promise<THoneyTokens | null> => {
- const COOLDOWN_INTERVAL_MS = cooldownMs;
+ const tryMarkTriggered = async (tokenIdentifier: string, cooldownMs: number, tx?: Knex) => {
const now = new Date();
- const cooldownThreshold = new Date(now.getTime() - COOLDOWN_INTERVAL_MS);
+ const cooldownThreshold = new Date(now.getTime() - cooldownMs);
- const rows = await (tx || db)(TableName.HoneyToken)
+ const [row] = await (tx || db)(TableName.HoneyToken)
.where({ tokenIdentifier })
.andWhere("status", "!=", "revoked")
.andWhere((qb) => {
@@ -136,8 +117,7 @@ export const honeyTokenDALFactory = (db: TDbClient) => {
})
.returning("*");
- const parsedRows = HoneyTokensSchema.array().parse(rows);
- return parsedRows.length > 0 ? parsedRows[0] : null;
+ return row ?? null;
};
const createSecretMappings = async (honeyTokenId: string, secretIds: string[], tx?: Knex) => {
diff --git a/backend/src/ee/services/honey-token/honey-token-service-types.ts b/backend/src/ee/services/honey-token/honey-token-service-types.ts
index b566bad351..499edf2a04 100644
--- a/backend/src/ee/services/honey-token/honey-token-service-types.ts
+++ b/backend/src/ee/services/honey-token/honey-token-service-types.ts
@@ -1,7 +1,7 @@
import { z } from "zod";
-import { TAppConnections } from "@app/db/schemas";
import { AppConnection } from "@app/services/app-connection/app-connection-enums";
+import { TAppConnection } from "@app/services/app-connection/app-connection-types";
import type {
THoneyTokenConfigProvider,
@@ -14,13 +14,13 @@ import type { THoneyTokenServiceFactoryDep } from "./honey-token-service";
export type THoneyTokenDeploymentStatus = { deployed: boolean; status: string | null };
export type THoneyTokenProviderHooks = {
- createCredentials: (appConnection: TAppConnections) => Promise<{
+ createCredentials: (appConnection: TAppConnection) => Promise<{
credentials: Record<string, string>;
tokenIdentifier: string;
}>;
- revokeCredentials: (input: { appConnection: TAppConnections; credentials: Record<string, string> }) => Promise<void>;
+ revokeCredentials: (input: { appConnection: TAppConnection; credentials: Record<string, string> }) => Promise<void>;
verifyDeployment?: (input: {
- appConnection: TAppConnections;
+ appConnection: TAppConnection;
orgId: string;
encryptedConfig?: Buffer | null;
connectionId: string;
diff --git a/backend/src/ee/services/honey-token/honey-token-service.ts b/backend/src/ee/services/honey-token/honey-token-service.ts
index 1faca3a41b..c9eba9f21c 100644
--- a/backend/src/ee/services/honey-token/honey-token-service.ts
+++ b/backend/src/ee/services/honey-token/honey-token-service.ts
@@ -8,10 +8,11 @@ import {
} from "@app/ee/services/permission/project-permission";
import { getConfig as getAppConfig } from "@app/lib/config/env";
import { crypto } from "@app/lib/crypto/cryptography";
-import { BadRequestError, ForbiddenRequestError, NotFoundError, UnauthorizedError } from "@app/lib/errors";
+import { BadRequestError, NotFoundError, UnauthorizedError } from "@app/lib/errors";
import { logger } from "@app/lib/logger";
import { OrderByDirection, OrgServiceActor } from "@app/lib/types";
import { TAppConnectionDALFactory } from "@app/services/app-connection/app-connection-dal";
+import { TAppConnectionServiceFactory } from "@app/services/app-connection/app-connection-service";
import { ActorType } from "@app/services/auth/auth-type";
import { TFolderCommitServiceFactory } from "@app/services/folder-commit/folder-commit-service";
import { TKmsServiceFactory } from "@app/services/kms/kms-service";
@@ -85,6 +86,7 @@ export type THoneyTokenServiceFactoryDep = {
licenseService: Pick<TLicenseServiceFactory, "getPlan">;
kmsService: Pick<TKmsServiceFactory, "createCipherPairWithDataKey">;
appConnectionDAL: Pick<TAppConnectionDALFactory, "findById">;
+ appConnectionService: Pick<TAppConnectionServiceFactory, "validateAppConnectionUsageById">;
orgDAL: Pick<TOrgDALFactory, "findOrgMembersByRole">;
projectDAL: Pick<TProjectDALFactory, "findById">;
smtpService: Pick<TSmtpService, "sendMail">;
@@ -131,6 +133,7 @@ export const honeyTokenServiceFactory = ({
licenseService,
kmsService,
appConnectionDAL,
+ appConnectionService,
orgDAL,
projectDAL,
smtpService,
@@ -153,6 +156,7 @@ export const honeyTokenServiceFactory = ({
licenseService,
kmsService,
appConnectionDAL,
+ appConnectionService,
orgDAL,
projectDAL,
smtpService,
@@ -275,20 +279,21 @@ export const honeyTokenServiceFactory = ({
});
}
- const appConnection = await appConnectionDAL.findById(orgConfig.connectionId);
+ const provider = getHoneyTokenProviderDefinition(providerType);
- if (!appConnection) {
- throw new NotFoundError({
- message: `Could not find App Connection with ID ${orgConfig.connectionId}`
- });
- }
- // Honey token integrations only support organization-level app connections.
- if (appConnection.orgId !== actor.orgId || appConnection.projectId != null) {
- throw new NotFoundError({
- message: `Could not find App Connection with ID ${orgConfig.connectionId}`
+ const appConnection = await appConnectionService.validateAppConnectionUsageById(
+ provider.connectionApp,
+ { connectionId: orgConfig.connectionId, projectId },
+ actor
+ );
+
+ if (appConnection.projectId) {
+ throw new BadRequestError({
+ message: `Honey token integrations only support organization-level app connections. Please use an organization-level app connection.`
});
}
assertHoneyTokenConnectionType(providerType, appConnection.app);
+
const { credentials: honeyTokenCredentials, tokenIdentifier } =
await providerHooks.createCredentials(appConnection);
@@ -635,16 +640,23 @@ export const honeyTokenServiceFactory = ({
throw new BadRequestError({ message: "Honey token configuration is missing for this organization" });
}
- const appConnection = await appConnectionDAL.findById(orgConfig.connectionId);
- // Honey token integrations only support organization-level app connections.
- if (!appConnection || appConnection.orgId !== actor.orgId || appConnection.projectId != null) {
- throw new ForbiddenRequestError({
- message: "App connection does not belong to the current organization"
+ const provider = getHoneyTokenProviderDefinition(honeyToken.type);
+ const providerHooks = honeyTokenProviderHooksByType[type];
+
+ const appConnection = await appConnectionService.validateAppConnectionUsageById(
+ provider.connectionApp,
+ { connectionId: orgConfig.connectionId, projectId },
+ actor
+ );
+
+ if (appConnection.projectId) {
+ throw new BadRequestError({
+ message: `Honey token integrations only support organization-level app connections. Please use an organization-level app connection.`
});
}
assertHoneyTokenConnectionType(type, appConnection.app);
- const providerHooks = honeyTokenProviderHooksByType[type];
+
if (!providerHooks) throw new BadRequestError({ message: "Unsupported honey token type" });
await providerHooks.revokeCredentials({
appConnection,
@@ -794,16 +806,7 @@ export const honeyTokenServiceFactory = ({
};
const getDashboardHoneyTokens = async (
- {
- projectId,
- environments,
- secretPath,
- search,
- orderBy,
- orderDirection,
- limit,
- offset
- }: THoneyTokenListInput,
+ { projectId, environments, secretPath, search, orderBy, orderDirection, limit, offset }: THoneyTokenListInput,
actor: OrgServiceActor
) => {
const { permission: readPermission } = await permissionService.getProjectPermission({
@@ -919,6 +922,8 @@ export const honeyTokenServiceFactory = ({
};
const handleTrigger = async ({ type, signature, payload }: THandleTriggerInput) => {
+ logger.info({ payload, signature, type }, `Honey token trigger received [type=${type}]`);
+
const providerType = assertSupportedHoneyTokenType(type);
if (providerType !== HoneyTokenType.AWS) {
throw new BadRequestError({ message: "Unsupported honey token type" });
@@ -952,14 +957,13 @@ export const honeyTokenServiceFactory = ({
throw new UnauthorizedError({ message: "Could not infer honey token organization from payload" });
}
- const tokenWithOrg = await honeyTokenDAL.findOneByTokenIdentifier(firstAccessKeyId);
- if (!tokenWithOrg) {
+ const honeyTokenWithOrg = await honeyTokenDAL.findOneByTokenIdentifier(firstAccessKeyId);
+ if (!honeyTokenWithOrg) {
throw new UnauthorizedError({ message: "Could not infer honey token organization from payload" });
}
- const { orgId } = tokenWithOrg;
const config = await honeyTokenConfigDAL.findOne({
- orgId,
+ orgId: honeyTokenWithOrg.orgId,
type: HoneyTokenType.AWS,
status: HoneyTokenConfigStatus.Complete
});
@@ -967,7 +971,10 @@ export const honeyTokenServiceFactory = ({
throw new NotFoundError({ message: "No honey token configuration found for this organization" });
}
- const { decryptor } = await kmsService.createCipherPairWithDataKey({ type: KmsDataKey.Organization, orgId });
+ const { decryptor } = await kmsService.createCipherPairWithDataKey({
+ type: KmsDataKey.Organization,
+ orgId: honeyTokenWithOrg.orgId
+ });
const decrypted = decryptor({ cipherTextBlob: config.encryptedConfig });
const storedConfig = AwsHoneyTokenConfigSchema.parse(JSON.parse(decrypted.toString()) as unknown);
@@ -991,12 +998,15 @@ export const honeyTokenServiceFactory = ({
const parsed = AwsHoneyTokenEventMetadataSchema.safeParse(wrapped.event ?? rawEvent);
if (!parsed.success) {
logger.warn(
- { orgId, event: rawEvent, error: parsed.error },
- `Failed to parse honey token event [orgId=${orgId}]`
+ { orgId: honeyTokenWithOrg.orgId, event: rawEvent, error: parsed.error },
+ `Failed to parse honey token event [orgId=${honeyTokenWithOrg.orgId}]`
);
continue;
}
- const honeyToken = await honeyTokenDAL.findOneByTokenIdentifierAndOrgId(parsed.data.accessKeyId, orgId);
+ const honeyToken = await honeyTokenDAL.findOneByTokenIdentifierAndOrgId(
+ parsed.data.accessKeyId,
+ honeyTokenWithOrg.orgId
+ );
if (!honeyToken) continue;
if (honeyToken.status === HoneyTokenStatus.Revoked) continue;
@@ -1010,7 +1020,7 @@ export const honeyTokenServiceFactory = ({
TRIGGER_NOTIFICATION_COOLDOWN_MS
);
if (updatedToken) {
- void $sendTriggerNotification({ orgId, honeyToken, eventMetadata: parsed.data });
+ void $sendTriggerNotification({ orgId: honeyTokenWithOrg.orgId, honeyToken, eventMetadata: parsed.data });
}
}
/* eslint-enable no-continue */
diff --git a/backend/src/ee/services/license/license-fns.ts b/backend/src/ee/services/license/license-fns.ts
index 5ed614b24f..b3e5a643ec 100644
--- a/backend/src/ee/services/license/license-fns.ts
+++ b/backend/src/ee/services/license/license-fns.ts
@@ -68,7 +68,7 @@ export const getDefaultOnPremFeatures = (): TFeatureSet => ({
secretVersioning: true,
pitRecovery: false,
ipAllowlisting: false,
- rbac: false,
+ rbac: true,
githubOrgSync: false,
customRateLimits: false,
subOrganization: false,
@@ -89,7 +89,7 @@ export const getDefaultOnPremFeatures = (): TFeatureSet => ({
trial_end: null,
has_used_trial: true,
secretApproval: false,
- secretRotation: false,
+ secretRotation: true,
caCrl: false,
instanceUserManagement: false,
externalKms: false,
@@ -116,8 +116,8 @@ export const getDefaultOnPremFeatures = (): TFeatureSet => ({
machineIdentityAuthTemplates: false,
pkiLegacyTemplates: false,
secretShareExternalBranding: false,
- honeyTokens: false,
- honeyTokenLimit: 0
+ honeyTokens: true,
+ honeyTokenLimit: 3
});
export const setupLicenseRequestWithStore = (
diff --git a/backend/src/ee/services/permission/default-roles.ts b/backend/src/ee/services/permission/default-roles.ts
index c90256cb62..793e47c193 100644
--- a/backend/src/ee/services/permission/default-roles.ts
+++ b/backend/src/ee/services/permission/default-roles.ts
@@ -397,8 +397,7 @@ const buildAdminPermissionRules = () => {
ProjectPermissionHoneyTokenActions.Create,
ProjectPermissionHoneyTokenActions.Edit,
ProjectPermissionHoneyTokenActions.Reset,
- ProjectPermissionHoneyTokenActions.Revoke,
- ProjectPermissionHoneyTokenActions.Delete
+ ProjectPermissionHoneyTokenActions.Revoke
],
ProjectPermissionSub.HoneyTokens
);
diff --git a/backend/src/ee/services/permission/project-permission.ts b/backend/src/ee/services/permission/project-permission.ts
index bd0153c5bb..28c6c1df7f 100644
--- a/backend/src/ee/services/permission/project-permission.ts
+++ b/backend/src/ee/services/permission/project-permission.ts
@@ -296,8 +296,7 @@ export enum ProjectPermissionHoneyTokenActions {
Create = "create",
Edit = "edit",
Reset = "reset",
- Revoke = "revoke",
- Delete = "delete"
+ Revoke = "revoke"
}
export enum ProjectPermissionApprovalRequestActions {
diff --git a/backend/src/lib/api-docs/constants.ts b/backend/src/lib/api-docs/constants.ts
index 15e5806e47..78b3fb49dc 100644
--- a/backend/src/lib/api-docs/constants.ts
+++ b/backend/src/lib/api-docs/constants.ts
@@ -1396,6 +1396,7 @@ export const DASHBOARD = {
includeSecrets: "Whether to include project secrets in the response.",
includeFolders: "Whether to include project folders in the response.",
includeDynamicSecrets: "Whether to include dynamic project secrets in the response.",
+ includeHoneyTokens: "Whether to include honey tokens in the response.",
includeImports: "Whether to include project secret imports in the response.",
includeSecretRotations: "Whether to include project secret rotations in the response."
},
@@ -1413,7 +1414,8 @@ export const DASHBOARD = {
includeFolders: "Whether to include project folders in the response.",
includeImports: "Whether to include project secret imports in the response.",
includeDynamicSecrets: "Whether to include dynamic project secrets in the response.",
- includeSecretRotations: "Whether to include secret rotations in the response."
+ includeSecretRotations: "Whether to include secret rotations in the response.",
+ includeHoneyTokens: "Whether to include honey tokens in the response."
}
} as const;
diff --git a/backend/src/server/routes/index.ts b/backend/src/server/routes/index.ts
index 0af96fd620..29e386de52 100644
--- a/backend/src/server/routes/index.ts
+++ b/backend/src/server/routes/index.ts
@@ -958,14 +958,6 @@ export const registerRoutes = async (
membershipGroupDAL
});
- const honeyTokenConfigService = honeyTokenConfigServiceFactory({
- honeyTokenConfigDAL,
- permissionService,
- kmsService,
- licenseService,
- appConnectionDAL
- });
-
// ldapService is created after loginService (below) due to dependency on processProviderCallback
const telemetryService = telemetryServiceFactory({
@@ -1640,36 +1632,6 @@ export const registerRoutes = async (
snapshotSecretV2BridgeDAL,
secretVersionV2TagBridgeDAL: secretVersionTagV2BridgeDAL
});
- const honeyTokenService = honeyTokenServiceFactory({
- honeyTokenDAL,
- honeyTokenConfigDAL,
- honeyTokenEventDAL,
- permissionService,
- licenseService,
- kmsService,
- appConnectionDAL,
- orgDAL,
- projectDAL,
- smtpService,
- folderDAL,
- projectBotService,
- secretDAL: secretV2BridgeDAL,
- secretVersionDAL: secretVersionV2BridgeDAL,
- secretVersionTagDAL: secretVersionTagV2BridgeDAL,
- secretTagDAL,
- folderCommitService,
- resourceMetadataDAL,
- snapshotService,
- secretQueueService
- });
-
- const webhookService = webhookServiceFactory({
- permissionService,
- webhookDAL,
- projectEnvDAL,
- projectDAL,
- kmsService
- });
const secretTagService = secretTagServiceFactory({ secretTagDAL, permissionService, secretV2BridgeDAL });
const secretValidationRuleService = secretValidationRuleServiceFactory({
@@ -2343,6 +2305,47 @@ export const registerRoutes = async (
identityUaDAL
});
+ const honeyTokenConfigService = honeyTokenConfigServiceFactory({
+ honeyTokenConfigDAL,
+ permissionService,
+ kmsService,
+ licenseService,
+ appConnectionDAL,
+ appConnectionService
+ });
+
+ const honeyTokenService = honeyTokenServiceFactory({
+ honeyTokenDAL,
+ honeyTokenConfigDAL,
+ honeyTokenEventDAL,
+ permissionService,
+ licenseService,
+ kmsService,
+ appConnectionDAL,
+ orgDAL,
+ projectDAL,
+ smtpService,
+ folderDAL,
+ projectBotService,
+ secretDAL: secretV2BridgeDAL,
+ secretVersionDAL: secretVersionV2BridgeDAL,
+ secretVersionTagDAL: secretVersionTagV2BridgeDAL,
+ secretTagDAL,
+ folderCommitService,
+ resourceMetadataDAL,
+ snapshotService,
+ secretQueueService,
+ appConnectionService
+ });
+
+ const webhookService = webhookServiceFactory({
+ permissionService,
+ webhookDAL,
+ projectEnvDAL,
+ projectDAL,
+ kmsService
+ });
+
const secretSyncService = secretSyncServiceFactory({
secretSyncDAL,
secretImportDAL,
diff --git a/backend/src/server/routes/sanitizedSchemas.ts b/backend/src/server/routes/sanitizedSchemas.ts
index c224685692..3a994827f0 100644
--- a/backend/src/server/routes/sanitizedSchemas.ts
+++ b/backend/src/server/routes/sanitizedSchemas.ts
@@ -163,7 +163,6 @@ export const secretRawSchema = z.object({
.optional()
.nullable(),
isRotatedSecret: z.boolean().optional(),
- isHoneyTokenSecret: z.boolean().optional(),
rotationId: z.string().uuid().nullish()
});
diff --git a/backend/src/server/routes/v1/dashboard-router.ts b/backend/src/server/routes/v1/dashboard-router.ts
index 96f3807faa..b4a5db7ddd 100644
--- a/backend/src/server/routes/v1/dashboard-router.ts
+++ b/backend/src/server/routes/v1/dashboard-router.ts
@@ -6,7 +6,7 @@ import { RemindersSchema } from "@app/db/schemas/reminders";
import { EventType, UserAgentType } from "@app/ee/services/audit-log/audit-log-types";
import { ProjectPermissionSecretActions } from "@app/ee/services/permission/project-permission";
import { SecretRotationV2Schema } from "@app/ee/services/secret-rotation-v2/secret-rotation-v2-union-schema";
-import { DASHBOARD, INCLUDE_HONEY_TOKENS_DETAILS_DESC, INCLUDE_HONEY_TOKENS_OVERVIEW_DESC } from "@app/lib/api-docs";
+import { DASHBOARD } from "@app/lib/api-docs";
import { BadRequestError, NotFoundError } from "@app/lib/errors";
import { removeTrailingSlash } from "@app/lib/fn";
import { OrderByDirection } from "@app/lib/types";
@@ -109,7 +109,7 @@ export const registerDashboardRouter = async (server: FastifyZodProvider) => {
includeImports: booleanSchema.describe(DASHBOARD.SECRET_OVERVIEW_LIST.includeImports),
includeSecretRotations: booleanSchema.describe(DASHBOARD.SECRET_OVERVIEW_LIST.includeSecretRotations),
includeDynamicSecrets: booleanSchema.describe(DASHBOARD.SECRET_OVERVIEW_LIST.includeDynamicSecrets),
- includeHoneyTokens: booleanSchema.describe(INCLUDE_HONEY_TOKENS_OVERVIEW_DESC)
+ includeHoneyTokens: booleanSchema.describe(DASHBOARD.SECRET_OVERVIEW_LIST.includeHoneyTokens)
}),
response: {
200: z.object({
@@ -138,6 +138,7 @@ export const registerDashboardRouter = async (server: FastifyZodProvider) => {
secrets: secretRawSchema
.omit({ secretValue: true })
.extend({
+ isHoneyTokenSecret: z.boolean().optional(),
isEmpty: z.boolean(),
secretValueHidden: z.boolean(),
secretPath: z.string().optional(),
@@ -704,7 +705,7 @@ export const registerDashboardRouter = async (server: FastifyZodProvider) => {
includeDynamicSecrets: booleanSchema.describe(DASHBOARD.SECRET_DETAILS_LIST.includeDynamicSecrets),
includeImports: booleanSchema.describe(DASHBOARD.SECRET_DETAILS_LIST.includeImports),
includeSecretRotations: booleanSchema.describe(DASHBOARD.SECRET_DETAILS_LIST.includeSecretRotations),
- includeHoneyTokens: booleanSchema.describe(INCLUDE_HONEY_TOKENS_DETAILS_DESC)
+ includeHoneyTokens: booleanSchema.describe(DASHBOARD.SECRET_DETAILS_LIST.includeHoneyTokens)
}),
response: {
200: z.object({
@@ -742,6 +743,7 @@ export const registerDashboardRouter = async (server: FastifyZodProvider) => {
secrets: secretRawSchema
.omit({ secretValue: true })
.extend({
+ isHoneyTokenSecret: z.boolean().optional(),
isEmpty: z.boolean(),
secretReminderRecipients: z
.object({
@@ -1289,6 +1291,7 @@ export const registerDashboardRouter = async (server: FastifyZodProvider) => {
secrets: secretRawSchema
.omit({ secretValue: true })
.extend({
+ isHoneyTokenSecret: z.boolean().optional(),
secretValueHidden: z.boolean(),
secretPath: z.string().optional(),
secretMetadata: ResourceMetadataWithEncryptionSchema.optional(),
@@ -1718,7 +1721,10 @@ export const registerDashboardRouter = async (server: FastifyZodProvider) => {
slug: z.string()
}),
folderId: z.string().optional(),
- secrets: secretRawSchema.omit({ secretValue: true }).extend({ isEmpty: z.boolean() }).array()
+ secrets: secretRawSchema
+ .omit({ secretValue: true })
+ .extend({ isEmpty: z.boolean(), isHoneyTokenSecret: z.boolean().optional() })
+ .array()
})
.array()
})
diff --git a/backend/src/services/secret-v2-bridge/secret-v2-bridge-service.ts b/backend/src/services/secret-v2-bridge/secret-v2-bridge-service.ts
index 882cdd65ec..7fd6f9a4a0 100644
--- a/backend/src/services/secret-v2-bridge/secret-v2-bridge-service.ts
+++ b/backend/src/services/secret-v2-bridge/secret-v2-bridge-service.ts
@@ -543,10 +543,14 @@ export const secretV2BridgeServiceFactory = ({
});
if (!sharedSecretToModify)
throw new NotFoundError({ message: `Secret with name ${inputSecret.secretName} not found` });
- if (sharedSecretToModify.isHoneyTokenSecret)
- throw new BadRequestError({ message: "Cannot update honey token secrets" });
- if (sharedSecretToModify.isRotatedSecret && inputSecret.newSecretName)
- throw new BadRequestError({ message: "Cannot update rotated secret name" });
+ if (sharedSecretToModify.isHoneyTokenSecret || sharedSecretToModify.isRotatedSecret) {
+ if (inputSecret.newSecretName || inputSecret.secretValue) {
+ throw new BadRequestError({
+ message: `Cannot update ${sharedSecretToModify.isHoneyTokenSecret ? "honey token" : "rotated"} secret name or value`
+ });
+ }
+ }
+
secretId = sharedSecretToModify.id;
secret = sharedSecretToModify;
}
@@ -2210,12 +2214,6 @@ export const secretV2BridgeServiceFactory = ({
const secretsToUpdateInDBGroupedByKey = groupBy(secretsToUpdateInDB, (i) => i.key);
const secretsToCreate = secretsToUpdate.filter((el) => !secretsToUpdateInDBGroupedByKey?.[el.secretKey]);
secretsToUpdate = secretsToUpdate.filter((el) => secretsToUpdateInDBGroupedByKey?.[el.secretKey]);
- const honeyTokenSecretsToUpdate = secretsToUpdateInDB.filter((el) => el.isHoneyTokenSecret);
- if (honeyTokenSecretsToUpdate.length) {
- throw new BadRequestError({
- message: `Cannot update honey token secrets: ${honeyTokenSecretsToUpdate.map((el) => el.key).join(", ")}`
- });
- }
secretsToUpdateInDB.forEach((el) => {
ForbiddenError.from(permission).throwUnlessCan(
@@ -2228,6 +2226,19 @@ export const secretV2BridgeServiceFactory = ({
})
);
+ if (el.isHoneyTokenSecret) {
+ const input = secretsToUpdateGroupByPath[secretPath].find((i) => i.secretKey === el.key);
+
+ if (input) {
+ if (input.newSecretName) {
+ delete input.newSecretName;
+ }
+ if (input.secretValue !== undefined) {
+ delete input.secretValue;
+ }
+ }
+ }
+
if (el.isRotatedSecret) {
const input = secretsToUpdateGroupByPath[secretPath].find((i) => i.secretKey === el.key);
diff --git a/frontend/src/components/honey-tokens/HoneyTokenDetailsDrawer.tsx b/frontend/src/components/honey-tokens/HoneyTokenDetailsDrawer.tsx
index 2a080f1e48..8570199524 100644
--- a/frontend/src/components/honey-tokens/HoneyTokenDetailsDrawer.tsx
+++ b/frontend/src/components/honey-tokens/HoneyTokenDetailsDrawer.tsx
@@ -392,8 +392,6 @@ const DrawerContent = ({
export const HoneyTokenDetailsDrawer = ({ projectId, honeyTokenId, onClose }: Props) => {
const isOpen = Boolean(honeyTokenId);
- console.log("[HoneyTokenDetailsDrawer] render", { honeyTokenId, isOpen, projectId });
-
return (
<Sheet
open={isOpen}
diff --git a/frontend/src/context/ProjectPermissionContext/types.ts b/frontend/src/context/ProjectPermissionContext/types.ts
index 0bbe7b15fd..51fba3a34b 100644
--- a/frontend/src/context/ProjectPermissionContext/types.ts
+++ b/frontend/src/context/ProjectPermissionContext/types.ts
@@ -299,8 +299,7 @@ export enum ProjectPermissionHoneyTokenActions {
Create = "create",
Edit = "edit",
Reset = "reset",
- Revoke = "revoke",
- Delete = "delete"
+ Revoke = "revoke"
}
export enum ProjectPermissionApprovalRequestActions {
diff --git a/frontend/src/pages/organization/SettingsPage/components/OrgProductSettingsTab/HoneyTokenModal.tsx b/frontend/src/pages/organization/SettingsPage/components/OrgProductSettingsTab/HoneyTokenModal.tsx
index 06d3fba833..dea7f2c4ec 100644
--- a/frontend/src/pages/organization/SettingsPage/components/OrgProductSettingsTab/HoneyTokenModal.tsx
+++ b/frontend/src/pages/organization/SettingsPage/components/OrgProductSettingsTab/HoneyTokenModal.tsx
@@ -1,3 +1,5 @@
+import crypto from "crypto";
+
import { useEffect, useMemo } from "react";
import { Controller, useForm } from "react-hook-form";
import { faCheck, faCopy, faEye, faEyeSlash, faTerminal } from "@fortawesome/free-solid-svg-icons";
@@ -41,12 +43,6 @@ const DEFAULT_STACK_NAME = "infisical-honey-tokens";
const DEFAULT_AWS_REGION = "us-east-1";
const WEBHOOK_SIGNING_KEY_BYTES = 32;
-const generateWebhookSigningKey = () => {
- const randomBytes = new Uint8Array(WEBHOOK_SIGNING_KEY_BYTES);
- window.crypto.getRandomValues(randomBytes);
- return Array.from(randomBytes, (byte) => byte.toString(16).padStart(2, "0")).join("");
-};
-
const schema = z.object({
connectionId: z.string().min(1, "AWS Connection is required"),
webhookSigningKey: z.string().min(1, "Webhook Signing Key is required"),
@@ -120,7 +116,7 @@ export const HoneyTokenModal = ({ isOpen, onOpenChange }: Props) => {
} else {
reset({
connectionId: "",
- webhookSigningKey: generateWebhookSigningKey(),
+ webhookSigningKey: crypto.randomBytes(WEBHOOK_SIGNING_KEY_BYTES).toString("hex"),
stackName: DEFAULT_STACK_NAME,
awsRegion: DEFAULT_AWS_REGION
});
@@ -189,6 +185,7 @@ export const HoneyTokenModal = ({ isOpen, onOpenChange }: Props) => {
text: "Honey token settings saved successfully",
type: "success"
});
+ onOpenChange(false);
} catch {
createNotification({
text: "Failed to save honey token settings",
diff --git a/frontend/src/pages/organization/SettingsPage/components/OrgProductSettingsTab/HoneyTokenSection.tsx b/frontend/src/pages/organization/SettingsPage/components/OrgProductSettingsTab/HoneyTokenSection.tsx
index 3bb3718a35..a0e74a6e92 100644
--- a/frontend/src/pages/organization/SettingsPage/components/OrgProductSettingsTab/HoneyTokenSection.tsx
+++ b/frontend/src/pages/organization/SettingsPage/components/OrgProductSettingsTab/HoneyTokenSection.tsx
@@ -55,7 +55,7 @@ export const HoneyTokenSection = () => {
<h3 className="text-lg font-medium text-mineshaft-100">AWS Honey Tokens</h3>
{hasConfig && (
<Badge variant={isConfigVerified ? "success" : "warning"}>
- {isConfigVerified ? "Verified" : "Not verified"}
+ {isConfigVerified ? "Verified" : "Pending Verification"}
</Badge>
)}
</div>
diff --git a/frontend/src/pages/project/RoleDetailsBySlugPage/components/ProjectRoleModifySection.utils.tsx b/frontend/src/pages/project/RoleDetailsBySlugPage/components/ProjectRoleModifySection.utils.tsx
index ae72b70c57..0dfe02bbae 100644
--- a/frontend/src/pages/project/RoleDetailsBySlugPage/components/ProjectRoleModifySection.utils.tsx
+++ b/frontend/src/pages/project/RoleDetailsBySlugPage/components/ProjectRoleModifySection.utils.tsx
@@ -71,8 +71,7 @@ const HoneyTokenPolicyActionSchema = z.object({
[ProjectPermissionHoneyTokenActions.Create]: z.boolean().optional(),
[ProjectPermissionHoneyTokenActions.Edit]: z.boolean().optional(),
[ProjectPermissionHoneyTokenActions.Reset]: z.boolean().optional(),
- [ProjectPermissionHoneyTokenActions.Revoke]: z.boolean().optional(),
- [ProjectPermissionHoneyTokenActions.Delete]: z.boolean().optional()
+ [ProjectPermissionHoneyTokenActions.Revoke]: z.boolean().optional()
});
const CertificatePolicyActionSchema = z.object({
@@ -1437,7 +1436,6 @@ export const rolePermission2Form = (permissions: TProjectPermission[] = []) => {
const canEdit = action.includes(ProjectPermissionHoneyTokenActions.Edit);
const canReset = action.includes(ProjectPermissionHoneyTokenActions.Reset);
const canRevoke = action.includes(ProjectPermissionHoneyTokenActions.Revoke);
- const canDelete = action.includes(ProjectPermissionHoneyTokenActions.Delete);
if (!formVal[subject]) formVal[subject] = [{}];
@@ -1448,7 +1446,6 @@ export const rolePermission2Form = (permissions: TProjectPermission[] = []) => {
if (canEdit) formVal[subject]![0][ProjectPermissionHoneyTokenActions.Edit] = true;
if (canReset) formVal[subject]![0][ProjectPermissionHoneyTokenActions.Reset] = true;
if (canRevoke) formVal[subject]![0][ProjectPermissionHoneyTokenActions.Revoke] = true;
- if (canDelete) formVal[subject]![0][ProjectPermissionHoneyTokenActions.Delete] = true;
return;
}
@@ -1738,7 +1735,6 @@ export const rolePermission2Form = (permissions: TProjectPermission[] = []) => {
const canEdit = action.includes(ProjectPermissionHoneyTokenActions.Edit);
const canReset = action.includes(ProjectPermissionHoneyTokenActions.Reset);
const canRevoke = action.includes(ProjectPermissionHoneyTokenActions.Revoke);
- const canDelete = action.includes(ProjectPermissionHoneyTokenActions.Delete);
if (!formVal[subject]) formVal[subject] = [{}];
@@ -1749,7 +1745,6 @@ export const rolePermission2Form = (permissions: TProjectPermission[] = []) => {
if (canEdit) formVal[subject]![0][ProjectPermissionHoneyTokenActions.Edit] = true;
if (canReset) formVal[subject]![0][ProjectPermissionHoneyTokenActions.Reset] = true;
if (canRevoke) formVal[subject]![0][ProjectPermissionHoneyTokenActions.Revoke] = true;
- if (canDelete) formVal[subject]![0][ProjectPermissionHoneyTokenActions.Delete] = true;
return;
}
@@ -2512,11 +2507,6 @@ export const PROJECT_PERMISSION_OBJECT: TProjectPermissionObject = {
label: "Revoke",
value: ProjectPermissionHoneyTokenActions.Revoke,
description: "Revoke honey tokens and credentials"
- },
- {
- label: "Delete",
- value: ProjectPermissionHoneyTokenActions.Delete,
- description: "Delete honey token records"
}
]
},
diff --git a/frontend/src/pages/secret-manager/OverviewPage/OverviewPage.tsx b/frontend/src/pages/secret-manager/OverviewPage/OverviewPage.tsx
index 92a6b3399a..cd97c348ea 100644
--- a/frontend/src/pages/secret-manager/OverviewPage/OverviewPage.tsx
+++ b/frontend/src/pages/secret-manager/OverviewPage/OverviewPage.tsx
@@ -797,11 +797,6 @@ const OverviewPageContent = () => {
const [detailsDrawerHoneyTokenId, setDetailsDrawerHoneyTokenId] = useState<string | null>(null);
- console.log("[HoneyTokenDrawer] render", {
- detailsDrawerHoneyTokenId,
- routerSearchHoneyTokenId: routerSearch.honeyTokenId
- });
-
// Auto-open honey token drawer when linked via notification/email
useEffect(() => {
console.log("[HoneyTokenDrawer] useEffect fired", { honeyTokenId: routerSearch.honeyTokenId });
diff --git a/frontend/src/pages/secret-manager/OverviewPage/components/HoneyTokenTableRow/HoneyTokenTableRow.tsx b/frontend/src/pages/secret-manager/OverviewPage/components/HoneyTokenTableRow/HoneyTokenTableRow.tsx
index a36fd224a2..0c6aa575a8 100644
--- a/frontend/src/pages/secret-manager/OverviewPage/components/HoneyTokenTableRow/HoneyTokenTableRow.tsx
+++ b/frontend/src/pages/secret-manager/OverviewPage/components/HoneyTokenTableRow/HoneyTokenTableRow.tsx
@@ -25,7 +25,7 @@ import {
TooltipTrigger
} from "@app/components/v3";
import {
- ProjectPermissionSecretActions,
+ ProjectPermissionHoneyTokenActions,
ProjectPermissionSub
} from "@app/context/ProjectPermissionContext/types";
import { HONEY_TOKEN_MAP } from "@app/helpers/honeyTokens";
@@ -113,8 +113,8 @@ export const HoneyTokenTableRow = ({
<TooltipContent>View details</TooltipContent>
</Tooltip>
<ProjectPermissionCan
- I={ProjectPermissionSecretActions.DescribeAndReadValue}
- a={ProjectPermissionSub.Secrets}
+ I={ProjectPermissionHoneyTokenActions.ReadCredentials}
+ a={ProjectPermissionSub.HoneyTokens}
>
{(isAllowed) => (
<Tooltip>
@@ -134,8 +134,8 @@ export const HoneyTokenTableRow = ({
)}
</ProjectPermissionCan>
<ProjectPermissionCan
- I={ProjectPermissionSecretActions.Edit}
- a={ProjectPermissionSub.Secrets}
+ I={ProjectPermissionHoneyTokenActions.Edit}
+ a={ProjectPermissionSub.HoneyTokens}
renderTooltip
allowedLabel="Edit"
>
@@ -158,8 +158,8 @@ export const HoneyTokenTableRow = ({
</ProjectPermissionCan>
{honeyToken.status !== HoneyTokenStatus.Revoked && (
<ProjectPermissionCan
- I={ProjectPermissionSecretActions.Delete}
- a={ProjectPermissionSub.Secrets}
+ I={ProjectPermissionHoneyTokenActions.Revoke}
+ a={ProjectPermissionSub.HoneyTokens}
>
{(isAllowed) => (
<Tooltip>
diff --git a/frontend/src/pages/secret-manager/OverviewPage/components/SelectionPanel/SelectionPanel.tsx b/frontend/src/pages/secret-manager/OverviewPage/components/SelectionPanel/SelectionPanel.tsx
index d1ea4fd397..7d234b642d 100644
--- a/frontend/src/pages/secret-manager/OverviewPage/components/SelectionPanel/SelectionPanel.tsx
+++ b/frontend/src/pages/secret-manager/OverviewPage/components/SelectionPanel/SelectionPanel.tsx
@@ -83,6 +83,7 @@ export const SelectionPanel = ({
const isHoneyTokenSelected = Object.values(selectedEntries.secret).some((record) =>
Object.values(record).some((secret) => secret.isHoneyTokenSecret)
);
+
const selectedCount =
selectedFolderCount + selectedKeysCount + selectedRotationCount + selectedHoneyTokenCount;
@@ -299,10 +300,11 @@ export const SelectionPanel = ({
const areFoldersSelected = Boolean(Object.keys(selectedEntries[EntryType.FOLDER]).length);
const areRotationsSelected = selectedRotationCount > 0;
- const isMoveDisabled = areFoldersSelected || isHoneyTokenSelected;
+ const isMoveDisabled =
+ areFoldersSelected || isHoneyTokenSelected || Boolean(selectedHoneyTokenCount);
let moveDisabledReason = "Moving folders is not supported";
- if (!areFoldersSelected && isHoneyTokenSelected) {
- moveDisabledReason = "Moving honey token secrets is not supported";
+ if ((!areFoldersSelected && isHoneyTokenSelected) || Boolean(selectedHoneyTokenCount)) {
+ moveDisabledReason = "Moving honey tokens is not supported";
}
const isDeleteDisabled = areRotationsSelected || isManagedSecretSelected;
diff --git a/frontend/src/pages/secret-manager/SecretDashboardPage/components/ActionBar/ActionBar.tsx b/frontend/src/pages/secret-manager/SecretDashboardPage/components/ActionBar/ActionBar.tsx
index 05313880f8..ddc5f64ccd 100644
--- a/frontend/src/pages/secret-manager/SecretDashboardPage/components/ActionBar/ActionBar.tsx
+++ b/frontend/src/pages/secret-manager/SecretDashboardPage/components/ActionBar/ActionBar.tsx
@@ -215,6 +215,8 @@ export const ActionBar = ({
(secret) => secret.isHoneyTokenSecret
);
+ console.log("[ActionBar] selectedSecrets", selectedSecrets);
+
const { permission } = useProjectPermission();
const { data: vaultConfigs = [] } = useGetExternalMigrationConfigs(
ExternalMigrationProviders.Vault
diff --git a/frontend/src/pages/secret-manager/SecretDashboardPage/components/HoneyTokenListView/HoneyTokenItem.tsx b/frontend/src/pages/secret-manager/SecretDashboardPage/components/HoneyTokenListView/HoneyTokenItem.tsx
index 60914b6a8e..447fdfca9f 100644
--- a/frontend/src/pages/secret-manager/SecretDashboardPage/components/HoneyTokenListView/HoneyTokenItem.tsx
+++ b/frontend/src/pages/secret-manager/SecretDashboardPage/components/HoneyTokenListView/HoneyTokenItem.tsx
@@ -14,7 +14,7 @@ import { ProjectPermissionCan } from "@app/components/permissions";
import { Checkbox } from "@app/components/v2";
import { Badge, IconButton, Tooltip, TooltipContent, TooltipTrigger } from "@app/components/v3";
import { ProjectPermissionSub } from "@app/context";
-import { ProjectPermissionSecretActions } from "@app/context/ProjectPermissionContext/types";
+import { ProjectPermissionHoneyTokenActions } from "@app/context/ProjectPermissionContext/types";
import { HONEY_TOKEN_MAP } from "@app/helpers/honeyTokens";
import { HoneyTokenStatus, HoneyTokenType } from "@app/hooks/api/honeyTokens/enums";
import { TDashboardHoneyToken } from "@app/hooks/api/honeyTokens/types";
@@ -145,8 +145,8 @@ export const HoneyTokenItem = ({
<TooltipContent>View details</TooltipContent>
</Tooltip>
<ProjectPermissionCan
- I={ProjectPermissionSecretActions.DescribeAndReadValue}
- a={ProjectPermissionSub.Secrets}
+ I={ProjectPermissionHoneyTokenActions.ReadCredentials}
+ a={ProjectPermissionSub.HoneyTokens}
renderTooltip
allowedLabel="View credentials"
>
@@ -167,8 +167,8 @@ export const HoneyTokenItem = ({
)}
</ProjectPermissionCan>
<ProjectPermissionCan
- I={ProjectPermissionSecretActions.Edit}
- a={ProjectPermissionSub.Secrets}
+ I={ProjectPermissionHoneyTokenActions.Edit}
+ a={ProjectPermissionSub.HoneyTokens}
renderTooltip
allowedLabel="Edit"
>
@@ -190,8 +190,8 @@ export const HoneyTokenItem = ({
</ProjectPermissionCan>
{status !== HoneyTokenStatus.Revoked && (
<ProjectPermissionCan
- I={ProjectPermissionSecretActions.Delete}
- a={ProjectPermissionSub.Secrets}
+ I={ProjectPermissionHoneyTokenActions.Revoke}
+ a={ProjectPermissionSub.HoneyTokens}
renderTooltip
allowedLabel="Revoke"
>