diff --git a/docs/Quickstart-Guide-for-Beginners.md b/docs/Quickstart-Guide-for-Beginners.md index 664cc8c9..cbea97c0 100644 --- a/docs/Quickstart-Guide-for-Beginners.md +++ b/docs/Quickstart-Guide-for-Beginners.md @@ -83,7 +83,7 @@ With this two files we are ready to execute the `parse` command in order to gene ```shell startleft parse \ --iac-type TERRAFORM \ - --mapping-file iriusrisk-tf-aws-mapping.yaml \ + --default-mapping-file iriusrisk-tf-aws-mapping.yaml \ --output-file multinetwork_security_groups_with_lb.otm \ --project-name "Terraform MN Security Groups with LB" \ --project-id "tf-mn-sg-lb" \ diff --git a/docs/startleft-processors/iac/cft/CloudFormation-Examples.md b/docs/startleft-processors/iac/cft/CloudFormation-Examples.md index db008740..9d418422 100644 --- a/docs/startleft-processors/iac/cft/CloudFormation-Examples.md +++ b/docs/startleft-processors/iac/cft/CloudFormation-Examples.md @@ -36,7 +36,7 @@ OTM file `multinetwork_security_groups_with_lb.otm` in the process. ```shell startleft parse \ --iac-type CLOUDFORMATION \ - --mapping-file iriusrisk-cft-mapping.yaml \ + --default-mapping-file iriusrisk-cft-mapping.yaml \ --output-file multinetwork_security_groups_with_lb.otm \ --project-name "CFT MN Security Groups with LB" \ --project-id "cft-mn-sg-lb" \ @@ -60,7 +60,7 @@ The following command will parse both CloudFormation source files creating an OT ```shell startleft parse \ --iac-type CLOUDFORMATION \ - --mapping-file iriusrisk-cft-mapping.yaml \ + --default-mapping-file iriusrisk-cft-mapping.yaml \ --output-file multinetwork_security_groups_with_lb_from_multiple_files.otm \ --project-name "CFT MN Security Groups with LB from multiple files" \ --project-id "cft-mn-sg-lb-ml-fl" \ diff --git a/docs/startleft-processors/iac/cft/CloudFormation-Quickstart.md b/docs/startleft-processors/iac/cft/CloudFormation-Quickstart.md index f366c7bb..ffb6fa20 100644 --- a/docs/startleft-processors/iac/cft/CloudFormation-Quickstart.md +++ b/docs/startleft-processors/iac/cft/CloudFormation-Quickstart.md @@ -155,7 +155,7 @@ directory with identical contents to the one above. ```shell startleft parse \ --iac-type CLOUDFORMATION \ - --mapping-file ec2-mapping.yaml \ + --default-mapping-file ec2-mapping.yaml \ --output-file ec2.otm \ --project-id "my-ec2-project" \ --project-name "My EC2 project" \ @@ -182,7 +182,7 @@ curl --location --request POST localhost:5000/api/v1/startleft/iac \ --header "Accept: application/json" \ --form iac_type="CLOUDFORMATION" \ --form iac_file=@"./ec2-cft.json" \ ---form mapping_file=@"./ec2-mapping.yaml" \ +--form default_mapping_file=@"./ec2-mapping.yaml" \ --form id="my-ec2-project" \ --form name="My EC2 project" ``` diff --git a/docs/startleft-processors/iac/tf/Terraform-Examples.md b/docs/startleft-processors/iac/tf/Terraform-Examples.md index 75c71c5d..7b64035b 100644 --- a/docs/startleft-processors/iac/tf/Terraform-Examples.md +++ b/docs/startleft-processors/iac/tf/Terraform-Examples.md @@ -21,7 +21,7 @@ StartLeft supports parsing Terraform source files. Some examples are provided in ```shell startleft parse \ --iac-type TERRAFORM \ - --mapping-file iriusrisk-tf-aws-mapping \ + --default-mapping-file iriusrisk-tf-aws-mapping \ --output-file elb.otm \ --project-name "Terraform ELB" \ --project-id "terraform-elb" \ diff --git a/docs/startleft-processors/iac/tf/Terraform-Quickstart.md b/docs/startleft-processors/iac/tf/Terraform-Quickstart.md index 2486405b..fc792b7c 100644 --- a/docs/startleft-processors/iac/tf/Terraform-Quickstart.md +++ b/docs/startleft-processors/iac/tf/Terraform-Quickstart.md @@ -142,7 +142,7 @@ directory with identical contents to the one above. ```shell startleft parse \ --iac-type TERRAFORM \ - --mapping-file ec2-mapping.yaml \ + --default-mapping-file ec2-mapping.yaml \ --output-file ec2.otm \ --project-id "my-ec2-project" \ --project-name "My EC2 project" \ @@ -164,7 +164,7 @@ curl --location --request POST localhost:5000/api/v1/startleft/iac \ --header "Accept: application/json" \ --form iac_type="TERRAFORM" \ --form iac_file=@"./ec2-tf.json" \ ---form mapping_file=@"./ec2-mapping.yaml" \ +--form default_mapping_file=@"./ec2-mapping.yaml" \ --form id="my-ec2-project" \ --form name="My EC2 project" ``` diff --git a/docs/startleft-processors/iac/tfplan/Terraform-Plan-Quickstart.md b/docs/startleft-processors/iac/tfplan/Terraform-Plan-Quickstart.md index 42e9fcad..28444cf8 100644 --- a/docs/startleft-processors/iac/tfplan/Terraform-Plan-Quickstart.md +++ b/docs/startleft-processors/iac/tfplan/Terraform-Plan-Quickstart.md @@ -86,7 +86,7 @@ directory. ```shell startleft parse \ --iac-type TFPLAN \ - --mapping-file ir-mappings.yaml \ + --default-mapping-file ir-mappings.yaml \ --output-file output.otm \ --project-id "my-project" \ --project-name "My project" \ @@ -108,7 +108,7 @@ curl --location --request POST localhost:5000/api/v1/startleft/iac \ --form iac_type="TFPLAN" \ --form iac_file=@"./tf-plan.json" \ --form iac_file=@"./tf-graph.gv" \ ---form mapping_file=@"./ir-mappings.yaml" \ +--form default_mapping_file=@"./ir-mappings.yaml" \ --form id="my-project" \ --form name="My project" ``` diff --git a/docs/startleft-processors/iac/tfplan/examples/aws-ingesting-click-logs-using-terraform.md b/docs/startleft-processors/iac/tfplan/examples/aws-ingesting-click-logs-using-terraform.md index 43541781..d4be22d5 100644 --- a/docs/startleft-processors/iac/tfplan/examples/aws-ingesting-click-logs-using-terraform.md +++ b/docs/startleft-processors/iac/tfplan/examples/aws-ingesting-click-logs-using-terraform.md @@ -38,7 +38,7 @@ Use the StartLeft CLI to generate the OTM file: ```shell $ startleft parse \ --iac-type TFPLAN \ - --mapping-file ir-mappings.yaml \ + --default-mapping-file ir-mappings.yaml \ --output-file output.otm \ --project-id "my-project" \ --project-name "My project" \ diff --git a/docs/usage/Command-Line-Interface.md b/docs/usage/Command-Line-Interface.md index f9084c9a..da2f548e 100644 --- a/docs/usage/Command-Line-Interface.md +++ b/docs/usage/Command-Line-Interface.md @@ -99,34 +99,26 @@ This command is used for parsing source files into the Open Threat Model format. The options that it supports are: ```shell - -t, --iac-type [CLOUDFORMATION|TERRAFORM] - The IaC file type. NOTE: This argument + -t, --iac-type [CLOUDFORMATION|TERRAFORM|TFPLAN] + The IaC file type. NOTE: This argument is + mutually exclusive with arguments: + [diagram_type, etm_type]. [required] + -g, --diagram-type [VISIO|LUCID] + The diagram file type. NOTE: This argument is mutually exclusive with arguments: - [custom_mapping_file, - default_mapping_file, diagram_type]. - -g, --diagram-type [VISIO|LUCID] - The diagram file type. NOTE: This - argument is mutually exclusive with - arguments: [mapping_file, iac_type]. - -m, --mapping-file TEXT - Mapping file to parse the IaC file. - NOTE: This argument is mutually - exclusive with arguments: - [custom_mapping_file, - default_mapping_file, diagram_type]. - -d, --default-mapping-file TEXT - Default mapping file to parse the - diagram or ETM file. NOTE: This argument is + [etm_type, iac_type]. [required] + -e, --etm-type [MTMT] The etm file type. NOTE: This argument is mutually exclusive with arguments: - [mapping_file, iac_type]. - -c, --custom-mapping-file TEXT - Custom mapping file to parse the - diagram or ETM file. + [diagram_type, iac_type]. [required] + -d, --default-mapping-file TEXT + Default mapping file to parse the diagram + file. [required] + -c, --custom-mapping-file TEXT Custom mapping file to parse the diagram + file. -o, --output-file TEXT OTM output file. -n, --project-name TEXT Project name. [required] -i, --project-id TEXT Project id. [required] --help Show this message and exit. - ``` > :material-information-outline: Notice that the argument with the `IaC or diagram file name` to parse is not > preceded by a parameter diff --git a/docs/usage/REST-API.md b/docs/usage/REST-API.md index 6d498490..72f63e9e 100644 --- a/docs/usage/REST-API.md +++ b/docs/usage/REST-API.md @@ -72,12 +72,17 @@ Request Body: iac_type: Required. Type of the IaC file: [CLOUDFORMATION, TERRAFORM] id Required. ID of the new project name Required. Name of the new project - mapping_file Required. File that contains the mapping between IaC resources and threat model resources. + default_mapping_file Required. File that contains the default mapping file between the diagram resources and threat model resources + custom_mapping_file Optional. File that contains the custom user mapping file between the diagram resources and threat model resources ``` This endpoint accepts one or more IaC source files (currently [Cloudformation](../startleft-processors/iac/cft/CloudFormation-Quickstart.md) -or [Terraform](../startleft-processors/iac/tf/Terraform-Quickstart.md)) and a mapping file, and generates an OTM with +or [Terraform](../startleft-processors/iac/tf/Terraform-Quickstart.md)),a mapping file, and an optional custom mapping file, and generates an OTM with the resulting threat modeling content. +???+ warning "mapping_file parameter is DEPRECATED" + + In previous version mapping_file parameter was used instead default_mapping_file, now you can send one or the other until mapping_file parameter is definitely deleted and only default_mapping_file will be accepted. + ??? example "Example" === "Request" ``` shell @@ -88,7 +93,8 @@ the resulting threat modeling content. --form iac_type="CLOUDFORMATION" \ --form iac_file=@"./resources_cft_file.json" \ --form iac_file=@"./networks_cft_file.json" \ - --form mapping_file=@"./iriusrisk-cft-mapping.yaml" \ + --form default_mapping_file=@"./default-mapping.yaml" \ + --form custom_mapping_file=@"./custom-mapping.yaml" \ --form id="cft-to-otm-example" \ --form name="CFT to OTM example" ```