diff --git a/ui/CHANGELOG.md b/ui/CHANGELOG.md index ed76338775..3dc0f8ba35 100644 --- a/ui/CHANGELOG.md +++ b/ui/CHANGELOG.md @@ -8,6 +8,7 @@ All notable changes to the **Prowler UI** are documented in this file. - Add a new chart to show the split between passed and failed findings. [(#7680)](https://github.com/prowler-cloud/prowler/pull/7680) - Added `Accordion` component. [(#7700)](https://github.com/prowler-cloud/prowler/pull/7700) +- Added an AWS CloudFormation Quick Link to the IAM Role credentials step [(#7735)](https://github.com/prowler-cloud/prowler/pull/7735) ### 🐞 Fixes diff --git a/ui/components/providers/workflow/credentials-role-helper.tsx b/ui/components/providers/workflow/credentials-role-helper.tsx index 896fd657a7..855a3e6fab 100644 --- a/ui/components/providers/workflow/credentials-role-helper.tsx +++ b/ui/components/providers/workflow/credentials-role-helper.tsx @@ -1,9 +1,11 @@ "use client"; import { Snippet } from "@nextui-org/react"; -import Link from "next/link"; import { useSession } from "next-auth/react"; +import { CustomButton } from "@/components/ui/custom"; +import { getAWSCredentialsTemplateLinks } from "@/lib"; + export const CredentialsRoleHelper = () => { const { data: session } = useSession(); @@ -12,24 +14,50 @@ export const CredentialsRoleHelper = () => {

A new read-only IAM role must be manually created. +

+ + + Use the following AWS CloudFormation Quick Link to deploy the IAM Role + + +
+
+ + or + +
+
+

Use one of the following templates to create the IAM role:

+
- CloudFormation Template - - + Terraform Code - +
+

The External ID will also be required:

diff --git a/ui/components/providers/workflow/forms/via-role/aws-role-form.tsx b/ui/components/providers/workflow/forms/via-role/aws-role-form.tsx index 7ed4cd9438..c9994284d9 100644 --- a/ui/components/providers/workflow/forms/via-role/aws-role-form.tsx +++ b/ui/components/providers/workflow/forms/via-role/aws-role-form.tsx @@ -1,4 +1,4 @@ -import { Select, SelectItem, Spacer } from "@nextui-org/react"; +import { Divider, Select, SelectItem, Spacer } from "@nextui-org/react"; import { Control, UseFormSetValue, useWatch } from "react-hook-form"; import { CustomInput } from "@/components/ui/custom"; @@ -89,10 +89,11 @@ export const AWSCredentialsRoleForm = ({ /> )} + + Assume Role - Assume Role { - const getProviderHelpText = (provider: string) => { - switch (provider) { - case "aws": - return { - text: "Need help connecting your AWS account?", - link: "https://goto.prowler.com/provider-aws", - }; - case "azure": - return { - 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?", - link: "https://goto.prowler.com/provider-gcp", - }; - case "kubernetes": - return { - text: "Need help connecting your Kubernetes cluster?", - link: "https://goto.prowler.com/provider-k8s", - }; - default: - return { - text: "How to setup a provider?", - link: "https://goto.prowler.com/provider-help", - }; - } - }; - return (
diff --git a/ui/lib/external-urls.ts b/ui/lib/external-urls.ts new file mode 100644 index 0000000000..cea7a694ae --- /dev/null +++ b/ui/lib/external-urls.ts @@ -0,0 +1,45 @@ +export const getProviderHelpText = (provider: string) => { + switch (provider) { + case "aws": + return { + text: "Need help connecting your AWS account?", + link: "https://goto.prowler.com/provider-aws", + }; + case "azure": + return { + 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?", + link: "https://goto.prowler.com/provider-gcp", + }; + case "kubernetes": + return { + text: "Need help connecting your Kubernetes cluster?", + link: "https://goto.prowler.com/provider-k8s", + }; + default: + return { + text: "How to setup a provider?", + link: "https://goto.prowler.com/provider-help", + }; + } +}; + +export const getAWSCredentialsTemplateLinks = () => { + return { + cloudformation: + "https://github.com/prowler-cloud/prowler/blob/master/permissions/templates/cloudformation/prowler-scan-role.yml", + cloudformationQuickLink: + "https://us-east-1.console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/quickcreate?templateURL=https%3A%2F%2Fprowler-cloud-public.s3.eu-west-1.amazonaws.com%2Fpermissions%2Ftemplates%2Faws%2Fcloudformation%2Fprowler-scan-role.yml&stackName=ProwlerScanRole¶m_ExternalId=", + terraform: + "https://github.com/prowler-cloud/prowler/blob/master/permissions/templates/terraform/main.tf", + }; +}; diff --git a/ui/lib/index.ts b/ui/lib/index.ts index 6560f7b5a9..6e1761c9d6 100644 --- a/ui/lib/index.ts +++ b/ui/lib/index.ts @@ -1,3 +1,4 @@ +export * from "./external-urls"; export * from "./helper"; export * from "./menu-list"; export * from "./utils";