Skip to content

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

add resource type to error log

x032205bdbec5b15893
diff --git a/backend/src/ee/services/audit-log/audit-log-types.ts b/backend/src/ee/services/audit-log/audit-log-types.ts
index be5906af57..94561e6d8e 100644
--- a/backend/src/ee/services/audit-log/audit-log-types.ts
+++ b/backend/src/ee/services/audit-log/audit-log-types.ts
@@ -3841,6 +3841,7 @@ interface PamAccountCredentialRotationFailedEvent {
accountName: string;
accountId: string;
resourceId: string;
+ resourceType: string;
errorMessage: string;
};
}
diff --git a/backend/src/ee/services/pam-account/pam-account-service.ts b/backend/src/ee/services/pam-account/pam-account-service.ts
index 209eb25b91..4d0ccc6abd 100644
--- a/backend/src/ee/services/pam-account/pam-account-service.ts
+++ b/backend/src/ee/services/pam-account/pam-account-service.ts
@@ -554,9 +554,11 @@ export const pamAccountServiceFactory = ({
const batch = accounts.slice(i, i + ROTATION_CONCURRENCY_LIMIT);
const rotationPromises = batch.map(async (account) => {
+ let logResourceType = "unknown";
try {
const resource = await pamResourceDAL.findById(account.resourceId);
if (!resource || !resource.encryptedRotationAccountCredentials) return;
+ logResourceType = resource.resourceType;
const { connectionDetails, rotationAccountCredentials, gatewayId, resourceType } = await decryptResource(
resource,
@@ -604,7 +606,7 @@ export const pamAccountServiceFactory = ({
accountId: account.id,
accountName: account.name,
resourceId: resource.id,
- resourceType: resource.resourceType
+ resourceType: logResourceType
}
}
});
@@ -623,6 +625,7 @@ export const pamAccountServiceFactory = ({
accountId: account.id,
accountName: account.name,
resourceId: account.resourceId,
+ resourceType: logResourceType,
errorMessage
}
}