diff --git a/ui/components/filters/custom-provider-inputs.tsx b/ui/components/filters/custom-provider-inputs.tsx index 6587bcb7e7..d16d0d5afd 100644 --- a/ui/components/filters/custom-provider-inputs.tsx +++ b/ui/components/filters/custom-provider-inputs.tsx @@ -5,6 +5,7 @@ import { AzureProviderBadge, GCPProviderBadge, KS8ProviderBadge, + M365ProviderBadge, } from "../icons/providers-badge"; export const CustomProviderInputAWS = () => { @@ -25,6 +26,15 @@ export const CustomProviderInputAzure = () => { ); }; +export const CustomProviderInputM365 = () => { + return ( +
+ +

Microsoft 365

+
+ ); +}; + export const CustomProviderInputGCP = () => { return (
diff --git a/ui/components/filters/custom-select-provider.tsx b/ui/components/filters/custom-select-provider.tsx index 3be51b5cd1..818c881f88 100644 --- a/ui/components/filters/custom-select-provider.tsx +++ b/ui/components/filters/custom-select-provider.tsx @@ -9,6 +9,7 @@ import { CustomProviderInputAzure, CustomProviderInputGCP, CustomProviderInputKubernetes, + CustomProviderInputM365, } from "./custom-provider-inputs"; const dataInputsProvider = [ @@ -27,6 +28,11 @@ const dataInputsProvider = [ label: "Microsoft Azure", value: , }, + { + key: "m365", + label: "Microsoft 365", + value: , + }, { key: "kubernetes", label: "Kubernetes", diff --git a/ui/components/filters/data-filters.ts b/ui/components/filters/data-filters.ts index 58709ec167..ca09af434d 100644 --- a/ui/components/filters/data-filters.ts +++ b/ui/components/filters/data-filters.ts @@ -52,7 +52,7 @@ export const filterFindings = [ { key: "provider_type__in", labelCheckboxGroup: "Cloud Provider", - values: ["aws", "azure", "gcp", "kubernetes"], + values: ["aws", "azure", "m365", "gcp", "kubernetes"], }, // Add more filter categories as needed ]; diff --git a/ui/components/icons/Icons.tsx b/ui/components/icons/Icons.tsx index 7d7ba0f1ae..2561fd1cf1 100644 --- a/ui/components/icons/Icons.tsx +++ b/ui/components/icons/Icons.tsx @@ -1006,6 +1006,31 @@ export const AzureIcon: React.FC = ({ ); }; +export const M365Icon: React.FC = ({ + size = 24, + width, + height, + ...props +}) => { + return ( + + + + + ); +}; + export const GCPIcon: React.FC = ({ size = 24, width, diff --git a/ui/components/providers/workflow/forms/update-via-credentials-form.tsx b/ui/components/providers/workflow/forms/update-via-credentials-form.tsx index a052d84dd1..f34fab12e0 100644 --- a/ui/components/providers/workflow/forms/update-via-credentials-form.tsx +++ b/ui/components/providers/workflow/forms/update-via-credentials-form.tsx @@ -19,6 +19,7 @@ import { AzureCredentials, GCPCredentials, KubernetesCredentials, + M365Credentials, } from "@/types"; import { ProviderTitleDocs } from "../provider-title-docs"; @@ -26,6 +27,7 @@ import { AWScredentialsForm } from "./via-credentials/aws-credentials-form"; import { AzureCredentialsForm } from "./via-credentials/azure-credentials-form"; import { GCPcredentialsForm } from "./via-credentials/gcp-credentials-form"; import { KubernetesCredentialsForm } from "./via-credentials/k8s-credentials-form"; +import { M365CredentialsForm } from "./via-credentials/m365-credentials-form"; type CredentialsFormSchema = z.infer< ReturnType @@ -35,6 +37,7 @@ type CredentialsFormSchema = z.infer< type FormType = CredentialsFormSchema & AWSCredentials & AzureCredentials & + M365Credentials & GCPCredentials & KubernetesCredentials; @@ -77,17 +80,25 @@ export const UpdateViaCredentialsForm = ({ client_secret: "", tenant_id: "", } - : providerType === "gcp" + : providerType === "m365" ? { client_id: "", client_secret: "", - refresh_token: "", + tenant_id: "", + user: "", + encrypted_password: "", } - : providerType === "kubernetes" + : providerType === "gcp" ? { - kubeconfig_content: "", + client_id: "", + client_secret: "", + refresh_token: "", } - : {}), + : providerType === "kubernetes" + ? { + kubeconfig_content: "", + } + : {}), }, }); @@ -136,6 +147,18 @@ export const UpdateViaCredentialsForm = ({ message: errorMessage, }); break; + case "/data/attributes/secret/user": + form.setError("user", { + type: "server", + message: errorMessage, + }); + break; + case "/data/attributes/secret/encrypted_password": + form.setError("encrypted_password", { + type: "server", + message: errorMessage, + }); + break; case "/data/attributes/secret/tenant_id": form.setError("tenant_id", { type: "server", @@ -192,6 +215,11 @@ export const UpdateViaCredentialsForm = ({ control={form.control as unknown as Control} /> )} + {providerType === "m365" && ( + } + /> + )} {providerType === "gcp" && ( } diff --git a/ui/components/providers/workflow/provider-title-docs.tsx b/ui/components/providers/workflow/provider-title-docs.tsx index 2abede0347..a09b05acb1 100644 --- a/ui/components/providers/workflow/provider-title-docs.tsx +++ b/ui/components/providers/workflow/provider-title-docs.tsx @@ -21,6 +21,11 @@ export const ProviderTitleDocs = ({ text: "Need help connecting your Azure subscription?", link: "https://goto.prowler.com/provider-azure", }; + case "m365": + return { + text: "Need help connecting your Microsoft 365 account?", + link: "https://goto.prowler.com/provider-m365", + }; case "gcp": return { text: "Need help connecting your GCP project?", diff --git a/ui/lib/menu-list.ts b/ui/lib/menu-list.ts index bae5330fe0..ce7de725ab 100644 --- a/ui/lib/menu-list.ts +++ b/ui/lib/menu-list.ts @@ -26,6 +26,7 @@ import { CircleHelpIcon, DocIcon, GCPIcon, + M365Icon, SupportIcon, } from "@/components/icons/Icons"; import { GroupProps } from "@/types"; @@ -94,6 +95,11 @@ export const getMenuList = (pathname: string): GroupProps[] => { label: "Microsoft Azure", icon: AzureIcon, }, + { + href: "/findings?filter[status__in]=FAIL&filter[severity__in]=critical%2Chigh%2Cmedium&filter[provider_type__in]=m365&sort=severity,-inserted_at", + label: "Microsoft 365", + icon: M365Icon, + }, { href: "/findings?filter[status__in]=FAIL&filter[severity__in]=critical%2Chigh%2Cmedium&filter[provider_type__in]=gcp&sort=severity,-inserted_at", label: "Google Cloud", diff --git a/ui/types/components.ts b/ui/types/components.ts index 606c0fe0ba..8b9696473c 100644 --- a/ui/types/components.ts +++ b/ui/types/components.ts @@ -513,7 +513,7 @@ export interface ProviderProps { id: string; type: "providers"; attributes: { - provider: "aws" | "azure" | "gcp" | "kubernetes"; + provider: "aws" | "azure" | "m365" | "gcp" | "kubernetes"; uid: string; alias: string; status: "completed" | "pending" | "cancelled";