From 949b688c37e0684f6202ad76fdbb4bd633738300 Mon Sep 17 00:00:00 2001 From: Abderrahmane Smimite Date: Sat, 30 Nov 2024 20:30:22 +0100 Subject: [PATCH] Refactor code --- cli/RA_sample.csv | 4 ++++ cli/clica.py | 15 +++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 cli/RA_sample.csv diff --git a/cli/RA_sample.csv b/cli/RA_sample.csv new file mode 100644 index 000000000..27c6048f5 --- /dev/null +++ b/cli/RA_sample.csv @@ -0,0 +1,4 @@ +ref_id;assets;threats;name;description;existing_controls;current_impact;current_proba;current_level;additional_controls;residual_impact;residual_proba;residual_level;treatment +R.1;dsafa;Data Encrypted for Impact;Ransomware;;ISMS Scope document,Statement of Applicabilty document;Significant;Likely;Low;Risk management policy,Organization overview document,Main policy,Competency matrix;Critical;Very likely;High;open +R.2;;System Shutdown/Reboot;Unavailability;;Information security awareness and traning policy;Significant;Very likely;Medium;Management review plan document,Main policy,ISMS Scope document,Responsibility matrix;Important;Unlikely;Medium;open +R.3;dsasfad;Scheduled Task,Cloud Administration Command;Insider threats;;;Important;Likely;Medium;;--;--;--;open diff --git a/cli/clica.py b/cli/clica.py index 2c7394396..8c2b53a9c 100755 --- a/cli/clica.py +++ b/cli/clica.py @@ -247,11 +247,18 @@ def import_risk_assessment(file, folder, project, name, matrix, create_all): additional_controls = get_unique_parsed_values(df, "additional_controls") batch_create("applied-controls", additional_controls, folder_id) - # sequential post to create the assets if any - - # sequential post to create the controls if any - + df = df.fillna("") # sequential post over the scenarios + for scenario in df.itertuples(): + print( + scenario.ref_id, + scenario.name, + scenario.description, + scenario.current_impact, + scenario.current_proba, + scenario.residual_impact, + scenario.residual_proba, + ) @click.command()