mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-04 19:21:51 +00:00
fix(ui): cfn quick link (#8452)
This commit is contained in:
@@ -15,7 +15,7 @@ import { CustomInput } from "@/components/ui/custom";
|
||||
import { CustomLink } from "@/components/ui/custom/custom-link";
|
||||
import { Form } from "@/components/ui/form";
|
||||
import { FormButtons } from "@/components/ui/form/form-buttons";
|
||||
import { getAWSCredentialsTemplateBucketLinks } from "@/lib";
|
||||
import { getAWSCredentialsTemplateLinks } from "@/lib";
|
||||
import { AWSCredentialsRole } from "@/types";
|
||||
import {
|
||||
editS3IntegrationFormSchema,
|
||||
@@ -258,9 +258,9 @@ export const S3IntegrationForm = ({
|
||||
const bucketName = form.getValues("bucket_name") || "";
|
||||
const externalId =
|
||||
form.getValues("external_id") || session?.tenantId || "";
|
||||
const templateLinks = getAWSCredentialsTemplateBucketLinks(
|
||||
bucketName,
|
||||
const templateLinks = getAWSCredentialsTemplateLinks(
|
||||
externalId,
|
||||
bucketName,
|
||||
);
|
||||
|
||||
return (
|
||||
|
||||
@@ -7,7 +7,7 @@ import { Control } from "react-hook-form";
|
||||
import { CustomButton } from "@/components/ui/custom";
|
||||
import { Form } from "@/components/ui/form";
|
||||
import { useCredentialsForm } from "@/hooks/use-credentials-form";
|
||||
import { getAWSCredentialsTemplateScanLinks } from "@/lib";
|
||||
import { getAWSCredentialsTemplateLinks } from "@/lib";
|
||||
import { ProviderCredentialFields } from "@/lib/provider-credentials/provider-credential-fields";
|
||||
import { requiresBackButton } from "@/lib/provider-helpers";
|
||||
import {
|
||||
@@ -62,7 +62,7 @@ export const BaseCredentialsForm = ({
|
||||
successNavigationUrl,
|
||||
});
|
||||
|
||||
const templateLinks = getAWSCredentialsTemplateScanLinks(externalId);
|
||||
const templateLinks = getAWSCredentialsTemplateLinks(externalId);
|
||||
|
||||
return (
|
||||
<Form {...form}>
|
||||
|
||||
+4
-14
@@ -38,25 +38,15 @@ export const getProviderHelpText = (provider: string) => {
|
||||
}
|
||||
};
|
||||
|
||||
export const getAWSCredentialsTemplateScanLinks = (externalId: string) => {
|
||||
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=${externalId}`,
|
||||
terraform:
|
||||
"https://github.com/prowler-cloud/prowler/blob/master/permissions/templates/terraform/main.tf",
|
||||
};
|
||||
};
|
||||
|
||||
export const getAWSCredentialsTemplateBucketLinks = (
|
||||
bucketName: string,
|
||||
export const getAWSCredentialsTemplateLinks = (
|
||||
externalId: string,
|
||||
bucketName?: string,
|
||||
) => {
|
||||
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-with-s3-integration.yml&stackName=ProwlerScanS3Integration¶m_AccountId=232136659152¶m_IAMPrincipal=role%2Fprowler*¶m_ExternalId=${externalId}¶m_S3IntegrationBucketName=${bucketName}`,
|
||||
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=Prowler¶m_ExternalId=${externalId}${bucketName ? `¶m_EnableS3Integration=true¶m_S3IntegrationBucketName=${bucketName}` : ""}`,
|
||||
terraform:
|
||||
"https://github.com/prowler-cloud/prowler/blob/master/permissions/templates/terraform/main.tf",
|
||||
"https://github.com/prowler-cloud/prowler/tree/master/permissions/templates/terraform",
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user