Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion csv2vex/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from importlib.metadata import version

try:
__version__ = "0.1.4"
__version__ = "0.1.5"
except:
__version__ = "debug"
10 changes: 9 additions & 1 deletion csv2vex/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,12 @@ def get_val(keyword:str, csv_data:pd.Series, config_data:dict) -> str | None:
res = csv_data.get(key)
return res

def normalize_analysis(value:str) -> str:
if type(value) is not str:
return None
normalized_value = value.strip().lower().replace(" ", "_")
return normalized_value

def get_vulnerability(csv_data:pd.Series, config_data:dict) -> Vulnerability:
vulnerability = Vulnerability()
for key in template.keys():
Expand All @@ -166,11 +172,13 @@ def get_vulnerability(csv_data:pd.Series, config_data:dict) -> Vulnerability:
if res := config_data.get("analysis"):
try:
state_str = get_val('state', csv_data, res)
state_str = normalize_analysis(state_str)
state = ImpactAnalysisState(state_str)
except:
state = None
try:
jus_str = get_val('justification', csv_data, res)
jus_str = normalize_analysis(jus_str)
justification = ImpactAnalysisJustification(jus_str)
except:
justification = None
Expand All @@ -179,7 +187,7 @@ def get_vulnerability(csv_data:pd.Series, config_data:dict) -> Vulnerability:
res_list = res.get('response')
for i in res_list:
try:
response = csv_data.get(i)
response = normalize_analysis(csv_data.get(i))
responses.append(ImpactAnalysisResponse(response))
except:
pass
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "csv2vex"
version = "0.1.4"
version = "0.1.5"
description = "CLI to convert csv to cyclonedx VEX documents"
authors = ["Richard Estwick <restwick@cybeats.com>", "Cybeats Technologies <cs@cybeats.com"]
readme = "README.md"
Expand Down