Skip to content

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

fix reviews

Thiago Araujo da Silvaf5b1e4cc274f
diff --git a/backend/src/ee/services/audit-log-stream/audit-log-stream-service.ts b/backend/src/ee/services/audit-log-stream/audit-log-stream-service.ts
index c55a1546a4..32ce00aa84 100644
--- a/backend/src/ee/services/audit-log-stream/audit-log-stream-service.ts
+++ b/backend/src/ee/services/audit-log-stream/audit-log-stream-service.ts
@@ -110,6 +110,12 @@ export const auditLogStreamServiceFactory = ({
ForbiddenError.from(permission).throwUnlessCan(OrgPermissionActions.Edit, OrgPermissionSubjects.Settings);
+ if (logStream.provider !== provider) {
+ throw new BadRequestError({
+ message: `Audit Log Stream with ID '${logStreamId}' is not for provider '${provider}'`
+ });
+ }
+
// Stream mode can only be upgraded from "single" to "batch" — never the reverse.
// This covers every case: new/vendor streams are already "batch", so any attempt to
// set "single" on them is a forbidden downgrade.
diff --git a/backend/src/ee/services/audit-log-stream/sumo-logic/sumo-logic-provider-factory.ts b/backend/src/ee/services/audit-log-stream/sumo-logic/sumo-logic-provider-factory.ts
index ebd32990b2..35264589f7 100644
--- a/backend/src/ee/services/audit-log-stream/sumo-logic/sumo-logic-provider-factory.ts
+++ b/backend/src/ee/services/audit-log-stream/sumo-logic/sumo-logic-provider-factory.ts
@@ -16,11 +16,10 @@ const buildStreamHeaders = (
credentials: TSumoLogicProviderCredentials,
contentType: string
): RawAxiosRequestHeaders => {
- const streamHeaders: RawAxiosRequestHeaders = { "Content-Type": contentType };
- if (credentials.token) {
- streamHeaders["x-sumo-token"] = credentials.token;
- }
- return streamHeaders;
+ return {
+ "Content-Type": contentType,
+ "x-sumo-token": credentials.token
+ };
};
export const SumoLogicProviderFactory = () => {
diff --git a/backend/src/ee/services/audit-log-stream/sumo-logic/sumo-logic-provider-schemas.ts b/backend/src/ee/services/audit-log-stream/sumo-logic/sumo-logic-provider-schemas.ts
index 0fa635fd16..fd733c4e6b 100644
--- a/backend/src/ee/services/audit-log-stream/sumo-logic/sumo-logic-provider-schemas.ts
+++ b/backend/src/ee/services/audit-log-stream/sumo-logic/sumo-logic-provider-schemas.ts
@@ -5,7 +5,7 @@ import { BaseProviderSchema } from "../audit-log-stream-schemas";
export const SumoLogicProviderCredentialsSchema = z.object({
url: z.string().url().trim().min(1).max(255),
- token: z.string().trim().max(255).optional()
+ token: z.string().trim().min(1).max(255)
});
const BaseSumoLogicProviderSchema = BaseProviderSchema.extend({ provider: z.literal(LogProvider.SumoLogic) });
@@ -17,12 +17,7 @@ export const SumoLogicProviderSchema = BaseSumoLogicProviderSchema.extend({
export const SanitizedSumoLogicProviderSchema = BaseSumoLogicProviderSchema.extend({
credentials: z.object({
url: SumoLogicProviderCredentialsSchema.shape.url,
- // Mask the token with a placeholder when one is set (and omit it when unset) so the value is
- // never exposed but the frontend can still tell a token exists. On update the frontend sends
- // this placeholder back unchanged to signal "keep the existing token".
- token: SumoLogicProviderCredentialsSchema.shape.token.transform((token) =>
- token ? REDACTED_CREDENTIAL_VALUE : undefined
- )
+ token: SumoLogicProviderCredentialsSchema.shape.token.transform(() => REDACTED_CREDENTIAL_VALUE)
})
});
diff --git a/docs/documentation/platform/audit-log-streams/audit-log-streams.mdx b/docs/documentation/platform/audit-log-streams/audit-log-streams.mdx
index 2d73933ba2..05264fd58a 100644
--- a/docs/documentation/platform/audit-log-streams/audit-log-streams.mdx
+++ b/docs/documentation/platform/audit-log-streams/audit-log-streams.mdx
@@ -378,10 +378,6 @@ This prevents audit logs from being written to PostgreSQL while still streaming
![sumo stream](/images/platform/audit-log-streams/sumo-stream.png)
- <Note>
- If you'd rather use a **Presigned URL** instead, select that option in Sumo Logic, set the full presigned URL (with the embedded token) as the **HTTP Source Address**, and leave the **Auth Token** empty. The **Auth Header** approach above is recommended.
- </Note>
-
Once you're finished, click **Create Log Stream**.
</Step>
</Steps>
diff --git a/frontend/src/hooks/api/auditLogStreams/types/providers/sumo-logic-provider.ts b/frontend/src/hooks/api/auditLogStreams/types/providers/sumo-logic-provider.ts
index 6def41cd0b..385522a034 100644
--- a/frontend/src/hooks/api/auditLogStreams/types/providers/sumo-logic-provider.ts
+++ b/frontend/src/hooks/api/auditLogStreams/types/providers/sumo-logic-provider.ts
@@ -5,6 +5,6 @@ export type TSumoLogicProviderLogStream = TRootProviderLogStream & {
provider: LogProvider.SumoLogic;
credentials: {
url: string;
- token?: string;
+ token: string;
};
};
diff --git a/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/AuditLogStreamForm/SumoLogicProviderAuditLogStreamForm.tsx b/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/AuditLogStreamForm/SumoLogicProviderAuditLogStreamForm.tsx
index f56fc3480e..255c02f10d 100644
--- a/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/AuditLogStreamForm/SumoLogicProviderAuditLogStreamForm.tsx
+++ b/frontend/src/pages/organization/AuditLogsPage/components/AuditLogStreamTab/AuditLogStreamForm/SumoLogicProviderAuditLogStreamForm.tsx
@@ -17,7 +17,7 @@ const formSchema = z.object({
provider: z.literal(LogProvider.SumoLogic),
credentials: z.object({
url: z.string().url().trim().min(1).max(255),
- token: z.string().trim().max(255).optional()
+ token: z.string().trim().min(1).max(255)
}),
...auditLogStreamFiltersSchema.shape
});
@@ -69,15 +69,14 @@ export const SumoLogicProviderAuditLogStreamForm = ({ auditLogStream, onSubmit }
shouldUnregister
render={({ field: { value, onChange }, fieldState: { error } }) => (
<FormControl
- isOptional
errorText={error?.message}
isError={Boolean(error?.message)}
label="Auth Token"
tooltipText={
<>
- When set, it is sent as an <code>x-sumo-token</code> header. Use this if you
- prefer header based authentication; otherwise leave it empty and rely on the token
- in the URL.
+ The collector token from your HTTP Source&apos;s <code>x-sumo-token</code> header
+ (the value after <code>x-sumo-token: </code>). Infisical sends it as the{" "}
+ <code>x-sumo-token</code> header on each request.
</>
}
>