Skip to content

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

Review fixes

x0322056566393e2197
diff --git a/backend/src/ee/services/audit-log-stream/audit-log-stream-fns.ts b/backend/src/ee/services/audit-log-stream/audit-log-stream-fns.ts
index ba04349826..dc93f238e4 100644
--- a/backend/src/ee/services/audit-log-stream/audit-log-stream-fns.ts
+++ b/backend/src/ee/services/audit-log-stream/audit-log-stream-fns.ts
@@ -1,22 +1,20 @@
-// Specific DataDog log intake hostnames
-const dataDogHostnames = [
- "http-intake.logs.datadoghq.com",
- "http-intake.logs.us3.datadoghq.com",
- "http-intake.logs.us5.datadoghq.com",
- "http-intake.logs.datadoghq.eu",
- "http-intake.logs.ap1.datadoghq.com",
- "http-intake.logs.ddog-gov.com"
-];
-
export function providerSpecificPayload(url: string) {
+ const { hostname } = new URL(url);
+
const payload: Record<string, string> = {};
- // If URL is for DataDog, add a "ddsource: infisical" entry
- if (
- dataDogHostnames.some((hostname) => url.startsWith(`https://${hostname}`) || url.startsWith(`http://${hostname}`))
- ) {
- payload.ddsource = "infisical";
- payload.service = "audit-logs";
+ switch (hostname) {
+ case "http-intake.logs.datadoghq.com":
+ case "http-intake.logs.us3.datadoghq.com":
+ case "http-intake.logs.us5.datadoghq.com":
+ case "http-intake.logs.datadoghq.eu":
+ case "http-intake.logs.ap1.datadoghq.com":
+ case "http-intake.logs.ddog-gov.com":
+ payload.ddsource = "infisical";
+ payload.service = "audit-logs";
+ break;
+ default:
+ break;
}
return payload;
diff --git a/backend/src/ee/services/audit-log/audit-log-queue.ts b/backend/src/ee/services/audit-log/audit-log-queue.ts
index 03af17285d..c240bc6ecc 100644
--- a/backend/src/ee/services/audit-log/audit-log-queue.ts
+++ b/backend/src/ee/services/audit-log/audit-log-queue.ts
@@ -143,13 +143,12 @@ export const auditLogQueueServiceFactory = async ({
}
);
logger.info(
- `Successfully streamed audit log to ${url} for org ${orgId}. Response body: ${JSON.stringify(response.data)}`
+ `Successfully streamed audit log [url=${url}] for org [orgId=${orgId}] [response=${JSON.stringify(response.data)}]`
);
return response;
} catch (error) {
logger.error(
- `Failed to stream audit log to ${url} for org ${orgId}. Error:`,
- (error as AxiosError).message
+ `Failed to stream audit log [url=${url}] for org [orgId=${orgId}] [error=${(error as AxiosError).message}]`
);
return error;
}
@@ -249,13 +248,12 @@ export const auditLogQueueServiceFactory = async ({
}
);
logger.info(
- `Successfully streamed audit log to ${url} for org ${orgId}. Response body: ${JSON.stringify(response.data)}`
+ `Successfully streamed audit log [url=${url}] for org [orgId=${orgId}] [response=${JSON.stringify(response.data)}]`
);
return response;
} catch (error) {
logger.error(
- `Failed to stream audit log to ${url} for org ${orgId}. Error:`,
- (error as AxiosError).message
+ `Failed to stream audit log [url=${url}] for org [orgId=${orgId}] [error=${(error as AxiosError).message}]`
);
return error;
}