diff --git a/legacy/process_csaf_files_old.py b/legacy/process_csaf_files_old.py new file mode 100644 index 0000000..e45a607 --- /dev/null +++ b/legacy/process_csaf_files_old.py @@ -0,0 +1,225 @@ +"""Module provides functions to look at CSAf file for courpus and for matching.""" + +import json +import os +from pathlib import Path +from time import perf_counter +import cProfile +import pandas as pd +import numpy as np +from utils.string_helperfunctions import read_json_file, find_file +from utils.string_helperfunctions import LogHandler + +# Encoding +ENCODING = "utf-8" + +def create_folders_set(folders:str): + allowed_folders = set() + for folder in folders.split(','): + if '-' in folder: + start, end = folder.split('-') + for folder_num in range(int(start), int(end) + 1): + allowed_folders.add(str(folder_num)) + allowed_folders.update() + else: + allowed_folders.add(str(folder)) + allowed_folders.add("csaf_files") + allowed_folders.add("OT") + allowed_folders.add("white") + return allowed_folders + +def is_folder_allowed(file_path: Path, allowed_folders: set[str]) -> bool: + """ + check if parent folder is allowed + """ + last_folder = file_path.parent.name + return last_folder in allowed_folders + + +# def process_json_files_in_directory(directory_path): +def get_csaf_sources(path_directory: str, allowed_folders: set[str] = None): + '''Get paths to json source files from a directory and check if it is a CSAF one. + + Parameter: + path_directory:str path to the directory where the CSAf json files are. + + Return: + pd.Dataframe with all CSAF documents found with columns path and file name + ''' + formating = "[%(asctime)s - %(levelname)s - process_csaf_files %(funcName)s] %(message)s" + log = LogHandler(formating) + file_list = [] + for source in [path_directory]: + source = os.path.normpath(source) + for root, _, files in os.walk(source): + for file in files: + if file.endswith(".json") is False: + log.logger.debug('Filepath %s is not a json file. File is excluded.', file) + continue + + file_path = os.path.join(root, file) + if allowed_folders is not None and not is_folder_allowed(Path(file_path), allowed_folders): + continue + + try: + with open(file_path, 'r', encoding=ENCODING) as filename: + #os.path.getsize(fullpathhere) > 0 + if os.stat(file_path).st_size == 0: + log.logger.debug('Filepath %s lead to a emtpy json file. ' + 'File is excluded.', file_path) + continue + try: + dummy = json.load(filename) + except json.decoder.JSONDecodeError as e: + log.logger.error('Filepath %s lead to Error: %s. File is excluded. ' + ' Check it out.', file_path, e) + # Check if it is a CSAF file + try: + dummy1 = dummy.get('document') + dummy2 = dummy.get('product_tree') + dummy3 = dummy.get('vulnerabilities') + if None in (dummy1, dummy2, dummy3): + log.logger.info('File with path %s fits not the CSAF standard. ' + 'File is excluded.', file_path) + else: + file_list.append([os.path.join(root, file), file]) + except (KeyError, json.decoder.JSONDecodeError) as e: + log.logger.error('Filepath %s lead to a non CSAF file with Error: %s. ' + 'File is excluded', file_path, e) + except FileNotFoundError as e: + raise FileNotFoundError("Could not find the file at: " + file_path) from e + return pd.DataFrame(file_list, columns=['path', 'file']) + +def merge_dataframes(df1, df2): + return pd.concat([df1, df2], axis=0, ignore_index=True, sort=False) + +def read_csaf_file(file_path): + '''Read json file of a CSAF document.''' + formating = "[%(asctime)s - %(levelname)s - process_csaf_files %(funcName)s] %(message)s" + log = LogHandler(formating) + try: + with open(file_path, 'r', encoding=ENCODING) as filename: + #os.path.getsize(fullpathhere) > 0 + if os.stat(file_path).st_size == 0: + log.logger.warning('Filepath %s lead to a emtpy json file.' + ' File isexcluded.', file_path) + try: + dummy = json.load(filename) + except json.decoder.JSONDecodeError as e: + log.logger.warning('Filepath %s lead to Error: %s. File is excluded. ' + 'Check it out.', file_path, e) + except FileNotFoundError: + log.logger.warning('Could not find the file at: %s', file_path) + # Check if it is a CSAF file + try: + dummy1 = dummy.get('document') + dummy2 = dummy.get('product_tree') + dummy3 = dummy.get('vulnerabilities') + if None in (dummy1, dummy2, dummy3): + log.logger.info('File with path %s fits not the CSAF standard.' + , file_path) + return True + else: + return dummy + except (KeyError, json.decoder.JSONDecodeError) as e: + log.logger.info('Filepath %s lead to a non CSAF file with Error: %s.', + file_path, e) + except FileNotFoundError as e: + log.logger.warning("Could not find the file at: %s", file_path) + + +def get_csaf_document_id(json_data): + '''Extract CSAF document tracking id.''' + return json_data.get('document', {}).get('tracking', {}).get('id', '') + + +def flatten_tree_data(json_data, input_type="product_tree"): + '''Separate in two different structes of CSAF files.''' + tree = json_data.get(input_type, {}) + # if full product names instead of branches + if 'full_product_names' in tree: + df_json = pd.DataFrame(tree['full_product_names'] + ).rename(columns={'name': 'full_product_names'}) + return df_json + tree_data = tree.get('branches', []) + flattened_data = [] + for item in tree_data: + flattened_data.extend(flatten_branch(item, {})) + return pd.DataFrame(flattened_data) + + +def flatten_branch(branch, parent_attributes): + '''Read in branches of json file.''' + attributes = parent_attributes.copy() + attributes.update({ + branch.get('category', ''): branch.get('name', '') + }) + if 'branches' in branch: + flat_branches = [] + for sub_branch in branch['branches']: + flat_branches.extend(flatten_branch(sub_branch, attributes)) + return flat_branches + else: + # last leaf of branches + if 'product' in branch: + attributes.update({ + 'full_product_name_branch': branch['product'].get('name', ''), + 'product_id': branch['product'].get('product_id', '') + }) + return [attributes] + + +def process_csaf_sources(csaf_sources: pd.DataFrame): + '''Process the csaf json list''' + formating = "[%(asctime)s - %(levelname)s - process_csaf_files %(funcName)s] %(message)s" + log = LogHandler(formating) + combined_df = pd.DataFrame() + predefined_columns = read_json_file(find_file('csaf_columns.json') + )['df_columns']['predefined_columns'] + fac = np.round(len(csaf_sources) / 30, 0) + 1 + for i in range(len(csaf_sources)): + if i > 0: + if i % fac == 0: + print(f"{np.round(i / len(csaf_sources) * 100, 2)}% eingelesen") + file_path = csaf_sources.path.loc[i] + try: + json_data = read_csaf_file(file_path) + if json_data is None: + log.logger.info("Filepath contain no CSAF data. %s", file_path) + continue + df_flattened = flatten_tree_data(json_data, 'product_tree') + df_flattened['path'] = file_path + # Lege fehlende Spalten an + df_flattened['data_source'] = get_url_from_csaf(json_data, file_path) + df_flattened['csaf_document_id'] = get_csaf_document_id(json_data) + for fix_column in predefined_columns: + if fix_column not in df_flattened.columns: + df_flattened[fix_column] = None + if set(df_flattened.columns).issubset(set(predefined_columns)) is False: + log.logger.error("There are undefined columns in %s", file_path) + # df_flattened = df_flattened[predefined_columns] + combined_df = pd.concat([combined_df, df_flattened], ignore_index=True) + except json.JSONDecodeError as e: + log.logger.warning("Fehler beim Parsen der Datei %s %s", file_path, e) + return combined_df + + +def get_url_from_csaf(d, path): + '''Extract url from CSAf file.''' + formating = "[%(asctime)s - %(levelname)s - process_csaf_files %(funcName)s] %(message)s" + log = LogHandler(formating) + try: + for ref in d['document']['references']: + if ref.get('url', '').endswith('.json'): + return ref['url'] + except KeyError as e: + log.logger.info("%s: No url for json document provided in %s", e, path) + return 'missing' + + +if __name__ == "__main__": + print('Call process_csaf_sources(get_csaf_sources())') + start = perf_counter() + df = process_csaf_sources(get_csaf_sources(os.path.join(os.getcwd(), 'resources'))) + elapsed = perf_counter() - start + print(f"Elapsed time: {elapsed:.6f} s") diff --git a/process_csaf_files.py b/process_csaf_files.py index c9ca49d..11bfc91 100644 --- a/process_csaf_files.py +++ b/process_csaf_files.py @@ -1,146 +1,124 @@ -"""Module provides functions to look at CSAf file for courpus and for matching.""" +"""Module provides functions to look at CSAf file for text miner.""" import json import os +import cProfile +from timeit import timeit from pathlib import Path - +from tqdm import tqdm import pandas as pd -import numpy as np -from string_helperfunctions import read_json_file, find_file -from string_helperfunctions import LogHandler +from utils.log_class import get_logger # Encoding ENCODING = "utf-8" -def create_folders_set(folders:str): - allowed_folders = set() - for folder in folders.split(','): - if '-' in folder: - start, end = folder.split('-') - for folder_num in range(int(start), int(end) + 1): - allowed_folders.add(str(folder_num)) - allowed_folders.update() - else: - allowed_folders.add(str(folder)) - allowed_folders.add("csaf_files") - allowed_folders.add("OT") - allowed_folders.add("white") - return allowed_folders - -def is_folder_allowed(file_path: Path, allowed_folders: set[str]) -> bool: - """ - check if parent folder is allowed - """ - last_folder = file_path.parent.name - return last_folder in allowed_folders +# CSAF Keys +PRODUCT_TREE = "product_tree" +FULL_PRODUCT_NAMES = "full_product_names" +BRANCHES = "branches" -# def process_json_files_in_directory(directory_path): -def get_csaf_sources(path_directory: str, allowed_folders: set[str] = None): - '''Get paths to json source files from a directory and check if it is a CSAF one. +def get_json_list(root: Path = Path.cwd().joinpath("resources"), + folder_names: set[str] | None = None) -> list[Path]: + """Get paths from json files from a directory -r Parameter: - path_directory:str path to the directory where the CSAf json files are. + path_directory: Path of starting directory + for collecting paths to json files + allowed_folders: set[str] sub folders where to look + (used to make selection if needed e.g.for tests) + Awareness: + Be aware that the full path is stored and any json file within + the root path will be processed but also deleted later on. + Return: - pd.Dataframe with all CSAF documents found with columns path and file name - ''' - formating = "[%(asctime)s - %(levelname)s - process_csaf_files %(funcName)s] %(message)s" - log = LogHandler(formating) - file_list = [] - for source in [path_directory]: - source = os.path.normpath(source) - for root, _, files in os.walk(source): - for file in files: - if file.endswith(".json") is False: - log.logger.debug('Filepath %s is not a json file. File is excluded.', file) - continue + list[Path] of json files + """ + if folder_names is None: + return list(root.rglob("*.json")) - file_path = os.path.join(root, file) - if allowed_folders is not None and not is_folder_allowed(Path(file_path), allowed_folders): - continue + json_files = [] + + for dirpath, dirnames, _f in os.walk(root): + if Path(dirpath).name in folder_names: + for subdir, _dir, files in os.walk(dirpath): + for file in files: + if file.endswith(".json"): + json_files.append(Path(subdir) / file) + # Don't descend into this subtree again + dirnames.clear() + return json_files + + +def get_csaf_sources(filelist: list[Path]) -> pd.DataFrame: + """Check if json files is a CSAF one. + Parameter: + list[Path] filelist: List of Path leading to + potential CSAF files + + Return: + list with all CSAF documents paths + """ + log = get_logger(__name__, __file__) + csaf_files = [] + + required_entries = {"document", PRODUCT_TREE, "vulnerabilities"} + + for file_path in filelist: + try: + if file_path.stat().st_size == 0: + log.debug( + "Filepath {} leads to an empty JSON file. \ + File is excluded.", + file_path, + ) + continue + + with open(file_path, "r", encoding=ENCODING) as filename: try: - with open(file_path, 'r', encoding=ENCODING) as filename: - #os.path.getsize(fullpathhere) > 0 - if os.stat(file_path).st_size == 0: - log.logger.debug('Filepath %s lead to a emtpy json file. ' - 'File is excluded.', file_path) - continue - try: - dummy = json.load(filename) - except json.decoder.JSONDecodeError as e: - log.logger.error('Filepath %s lead to Error: %s. File is excluded. ' - ' Check it out.', file_path, e) - # Check if it is a CSAF file - try: - dummy1 = dummy.get('document') - dummy2 = dummy.get('product_tree') - dummy3 = dummy.get('vulnerabilities') - if None in (dummy1, dummy2, dummy3): - log.logger.info('File with path %s fits not the CSAF standard. ' - 'File is excluded.', file_path) - else: - file_list.append([os.path.join(root, file), file]) - except (KeyError, json.decoder.JSONDecodeError) as e: - log.logger.error('Filepath %s lead to a non CSAF file with Error: %s. ' - 'File is excluded', file_path, e) - except FileNotFoundError as e: - raise FileNotFoundError("Could not find the file at: " + file_path) from e - return pd.DataFrame(file_list, columns=['path', 'file']) - -def merge_dataframes(df1, df2): - return pd.concat([df1, df2], axis=0, ignore_index=True, sort=False) - -def read_csaf_file(file_path): - '''Read json file of a CSAF document.''' - formating = "[%(asctime)s - %(levelname)s - process_csaf_files %(funcName)s] %(message)s" - log = LogHandler(formating) - try: - with open(file_path, 'r', encoding=ENCODING) as filename: - #os.path.getsize(fullpathhere) > 0 - if os.stat(file_path).st_size == 0: - log.logger.warning('Filepath %s lead to a emtpy json file.' - ' File isexcluded.', file_path) - try: - dummy = json.load(filename) - except json.decoder.JSONDecodeError as e: - log.logger.warning('Filepath %s lead to Error: %s. File is excluded. ' - 'Check it out.', file_path, e) - except FileNotFoundError: - log.logger.warning('Could not find the file at: %s', file_path) - # Check if it is a CSAF file - try: - dummy1 = dummy.get('document') - dummy2 = dummy.get('product_tree') - dummy3 = dummy.get('vulnerabilities') - if None in (dummy1, dummy2, dummy3): - log.logger.info('File with path %s fits not the CSAF standard.' - , file_path) - return True - else: - return dummy - except (KeyError, json.decoder.JSONDecodeError) as e: - log.logger.info('Filepath %s lead to a non CSAF file with Error: %s.', - file_path, e) - except FileNotFoundError as e: - log.logger.warning("Could not find the file at: %s", file_path) - - -def get_csaf_document_id(json_data): - '''Extract CSAF document tracking id.''' - return json_data.get('document', {}).get('tracking', {}).get('id', '') - - -def flatten_tree_data(json_data, input_type="product_tree"): - '''Separate in two different structes of CSAF files.''' + data = json.load(filename) + except json.decoder.JSONDecodeError as e: + log.opt(exception=True).warning( + "Loading {} lead to Error: {}. File is excluded. " + " Check it out.", file_path, e, + ) + continue + + if not isinstance(data, dict): + log.info( + "File {} does not contain a JSON object. \ + File is excluded.", + file_path, + ) + continue + + if not required_entries.issubset(data.keys()): + missing = required_entries - data.keys() + log.info( + "File {} is not a valid CSAF document. Missing keys: {}", + file_path, + ", ".join(sorted(missing)), + ) + continue + + csaf_files.append(file_path) + except OSError as e: + log.error("Could not read {}: {]}", file_path, e) + return csaf_files + + +def flatten_tree_data(json_data: dict, input_type: str = PRODUCT_TREE): + """Separate in two different structures of CSAF files.""" tree = json_data.get(input_type, {}) # if full product names instead of branches - if 'full_product_names' in tree: - df_json = pd.DataFrame(tree['full_product_names'] - ).rename(columns={'name': 'full_product_names'}) + if FULL_PRODUCT_NAMES in tree: + df_json = pd.DataFrame(tree[FULL_PRODUCT_NAMES]).rename( + columns={"name": FULL_PRODUCT_NAMES} + ) return df_json - tree_data = tree.get('branches', []) + tree_data = tree.get(BRANCHES, []) flattened_data = [] for item in tree_data: flattened_data.extend(flatten_branch(item, {})) @@ -148,74 +126,105 @@ def flatten_tree_data(json_data, input_type="product_tree"): def flatten_branch(branch, parent_attributes): - '''Read in branches of json file.''' + """Read in branches of json file.""" attributes = parent_attributes.copy() - attributes.update({ - branch.get('category', ''): branch.get('name', '') - }) - if 'branches' in branch: + attributes.update({branch.get("category", ""): branch.get("name", "")}) + if BRANCHES in branch: flat_branches = [] - for sub_branch in branch['branches']: + for sub_branch in branch[BRANCHES]: flat_branches.extend(flatten_branch(sub_branch, attributes)) return flat_branches else: # last leaf of branches - if 'product' in branch: - attributes.update({ - 'full_product_name_branch': branch['product'].get('name', ''), - 'product_id': branch['product'].get('product_id', '') - }) + if "product" in branch: + attributes.update( + { + "full_product_name_branch": + branch["product"].get("name", ""), + "product_id": + branch["product"].get("product_id", ""), + } + ) return [attributes] -def process_csaf_sources(csaf_sources: pd.DataFrame): - '''Process the csaf json list''' - formating = "[%(asctime)s - %(levelname)s - process_csaf_files %(funcName)s] %(message)s" - log = LogHandler(formating) - combined_df = pd.DataFrame() - predefined_columns = read_json_file(find_file('config.json') - )['df_columns']['predefined_columns'] - fac = np.round(len(csaf_sources) / 30, 0) + 1 - for i in range(len(csaf_sources)): - if i > 0: - if i % fac == 0: - print(f"{np.round(i / len(csaf_sources) * 100, 2)}% eingelesen") - file_path = csaf_sources.path.loc[i] - try: - json_data = read_csaf_file(file_path) - if json_data is None: - log.logger.info("Filepath contain no CSAF data. %s", file_path) - continue - df_flattened = flatten_tree_data(json_data, 'product_tree') - df_flattened['path'] = file_path - # Lege fehlende Spalten an - df_flattened['data_source'] = get_url_from_csaf(json_data, file_path) - df_flattened['csaf_document_id'] = get_csaf_document_id(json_data) - for fix_column in predefined_columns: - if fix_column not in df_flattened.columns: - df_flattened[fix_column] = None - if set(df_flattened.columns).issubset(set(predefined_columns)) is False: - log.logger.error("There are undefined columns in %s", file_path) - # df_flattened = df_flattened[predefined_columns] - combined_df = pd.concat([combined_df, df_flattened], ignore_index=True) - except json.JSONDecodeError as e: - log.logger.warning("Fehler beim Parsen der Datei %s %s", file_path, e) - return combined_df - - -def get_url_from_csaf(d, path): - '''Extract url from CSAf file.''' - formating = "[%(asctime)s - %(levelname)s - process_csaf_files %(funcName)s] %(message)s" - log = LogHandler(formating) - try: - for ref in d['document']['references']: - if ref.get('url', '').endswith('.json'): - return ref['url'] - except KeyError as e: - log.logger.info("%s: No url for json document provided in %s", e, path) - return 'missing' +def nested_get(d, *keys, default=None): + """Get dictionary function to reduce code replication.""" + for key in keys: + if not isinstance(d, dict): + return default + d = d.get(key) + return d if d is not None else default + + +def process_csaf_sources(csaf_sources: list[Path]) -> pd.DataFrame: + """Process the csaf json list + + Parameter: + csaf_sources with full path to file + + Limitations: + it is assumed, that the files are accurate csaf files + the previous functions in this module check only the + top level structure + """ + log = get_logger(__name__, __file__) + + dfs = [] + for file_path in tqdm(csaf_sources): + with open(file_path, 'r', encoding=ENCODING) as file: + json_data = json.load(file) + references = nested_get(json_data, + "document", "references", default="") + df_flattened = flatten_tree_data(json_data, PRODUCT_TREE) + df_flattened = df_flattened.assign( + path=file_path, + data_source=next(ref["url"] for ref in references if + ref.get("url", "").endswith(".json")), + csaf_document_id=nested_get(json_data, + "document", + "tracking", + "id", + default="") + ) + + dfs.append(df_flattened) + if not dfs: + log.error("All provided CSAF files are not applicable or empty") + return pd.DataFrame() + else: + df = pd.concat(dfs, ignore_index=True) + return csaf_checks(df.drop(columns=["path"])) + + +def csaf_checks(df: pd.DataFrame) -> pd.DataFrame: + """"Check for missing columns that are required later on.""" + + log = get_logger(__name__, __file__) + + path_csaf_columns = Path.cwd().joinpath("utils", "csaf_columns.json") + with open(path_csaf_columns, 'r', encoding=ENCODING) as file: + pre_col = json.load(file)["df_columns"]["predefined_columns"] + + # Set None for missing predefined columns + missing = set(pre_col) - set(df.columns) + for col in missing: + df[col] = None + # Check for unexpected columns + unexpected = set(df.columns) - set(pre_col) + if unexpected: + log.error("Unexpected columns: {}", unexpected) + return df + +def check_resources(fkt: str = "find_json_files(Path(os.getcwd()))"): + """To optimize the implementation: cProfile to identify bottlenecks.""" + cProfile.run(fkt) if __name__ == "__main__": - print('Call process_csaf_sources(get_csaf_sources())') - df = process_csaf_sources(get_csaf_sources(os.path.join(os.getcwd(), 'test'))) + print("Call process_csaf_sources(get_csaf_sources(get_json_list()))") + # Test + + process_csaf_sources(get_csaf_sources( + get_json_list(Path.cwd().joinpath("tests", + "test_files")))) diff --git a/tests/file-synonym/synonym_list.yaml b/tests/file-synonym/synonym_list.yaml new file mode 100644 index 0000000..984a91a --- /dev/null +++ b/tests/file-synonym/synonym_list.yaml @@ -0,0 +1,83 @@ +# List of synonyms for attributes used in the NetBox data model. +# The first entry is "alias" for the attribute itself +# Note: the first value of every entry will be used for the normalizer +# Note: The normalizer should used after string cleaning! +Manufacturer: + alias: + - 'Manufacturer' + - 'vendor' + - 'Hersteller' + Siemens: + - "Siemens" + - "Siemens Healthineers" + Phoenix Contact: + - "Phoenix Contact" + - "PXC" + - "Phoenix Contact GmbH" + ABB: + - "ABB" + - "Asea Brown Boveri" + franklin fueling systems: + - "franklin fueling systems" + - "franklin" + GE digital: + - "GE digital" + - "GE" + GE healthcare: + - "GE healthcare" + - "GE" + General electrics: + - "General electrics" + - "general" + General Motors: + - "general motors" + - "general" + Johnson & Johnson: + - "Johnson & Johnson" + - "Johnson" + Johnson Controls: + - "Johnson Controls" + - "Johnson" + LS Electric: + - "LS Electric" + - "LS" + LS industrial system: + - "LS industrial system" + - "LS" + Object Computing: + - "Object" + siemens energy: + - "siemens energy" + - "siemens" +Device_Role: + alias: + - 'device_role' + - 'device role' + RTU-PLC: + - 'RTU-PLC' + - 'RTU PLC' + - 'PLC' + - 'SPS' + - 'speicherprogrammierbare Steuerung' + - 'programmable logic controller' + - 'Controller_PLC/RTU' + - 'RTU' + HMI-Field: + - 'HMI-Field' + - 'HMI Field' + - 'Human Machine Interface' + - 'Bedienstation' + Actuator: + - 'Actuator' + - 'Aktor' + - 'actor' + Sensor: + - 'sensor' + SCADA: + - 'SCADA' +Device_Family: + alias: + - 'device_family' + - 'device family' + - 'product family' + - 'product type' \ No newline at end of file diff --git a/tests/test_files/empty.json b/tests/test_files/empty.json new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_files/icsa-25-007-01-corruped.json b/tests/test_files/icsa-25-007-01-corruped.json new file mode 100644 index 0000000..ac71a27 --- /dev/null +++ b/tests/test_files/icsa-25-007-01-corruped.json @@ -0,0 +1,2513 @@ +{ + "documential": { + "acknowledgments": [ + { + "names": [ + "Gjoko Krstikj" + ], + "organization": "Zero Science Lab", + "summary": "reporting the vulnerabilities through responsible disclosure." + } + ], + "category": "csaf_security_advisory", + "csaf_version": "2.0", + "distribution": { + "text": "Disclosure is not limited", + "tlp": { + "label": "WHITE", + "url": "https://us-cert.cisa.gov/tlp/" + } + }, + "lang": "en", + "notes": [ + { + "category": "summary", + "text": "ABB became aware of vulnerabilities in the product versions listed as affected in the advisory. \nASPECT devices are not intended to be internet-facing. A product advisory issued in June 2023 informed cus-tomers of this parameter.\nAn attacker can successfully exploit these vulnerabilities and could take remote control of the product and po-tentially insert and run arbitrary code. \nABB requires, as noted in previous security advisories and user documentation, that ASPECT should not be exposed to the internet or any other insecure network.\n\nNote: In order to exploit an ASPECT, an attacker would need a misconfigured system.", + "title": "Summary" + }, + { + "category": "other", + "text": "For any installation of software-related ABB products and especially for products in scope of the ASPECT product line, we strongly recommend the following (non-exhaustive) list of cyber security practices:\n\u2022\tEnsure that all ASPECT products are upgraded to the latest firmware version. Please find the latest version of ASPECT firmware on the respective product homepage\n\n\n\u2022\tIsolate special purpose networks (e.g. for automation systems) and remote devices behind firewalls and separate them from any general-purpose network (e.g. office or home networks).\n\n\n\u2022\tInstall physical controls so no unauthorized personnel can access your devices, components, peripheral equipment, and networks.\n\n\n\u2022\tNever connect programming software or computers containing programming software to any network other than the network for the devices that it is intended for.\n\n\n\u2022\tScan all data imported into your environment before use to detect potential malware infections.\n\n\n\u2022\tMinimize network exposure for all ASPECT ports and endpoints to ensure that they are not accessible directly from the Internet. \n\n\n\u2022\tEnsure all nodes are always up to date in terms of installed software, operating system, and firmware patches as well as anti-virus and firewall.\n\n\n\u2022\tWhen remote access is required, use secure methods, such as Virtual Private Networks (VPNs). Recognize that VPNs may have vulnerabilities and should be updated to the most current version available.\n", + "title": "General security recommendations" + }, + { + "category": "other", + "text": "For additional instructions and support please contact your local ABB service organization. For contact information, see www.abb.com/contactcenters.\nInformation about ABB\u2019s cyber security program and capabilities can be found at www.abb.com/cybersecurity\n", + "title": "Support" + }, + { + "category": "legal_disclaimer", + "text": "The information in this document is subject to change without notice, and should not be construed as a commitment by ABB.\nABB provides no warranty, express or implied, including warranties of merchantability and fitness for a particular purpose, for the information contained in this document, and assumes no responsibility for any errors that may appear in this document. In no event shall ABB or any of its suppliers be liable for direct, indirect, special, incidental or consequential damages of any nature or kind arising from the use of this document, or from the use of any hardware or software described in this document, even if ABB or its suppliers have been advised of the possibility of such damages.\nThis document and parts hereof must not be reproduced or copied without written permission from ABB, and the contents hereof must not be imparted to a third party nor used for any unauthorized purpose.\nAll rights to registrations and trademarks reside with their respective owners.\n", + "title": "Notice" + }, + { + "category": "general", + "text": "Users accessing ASPECT remotely shall do this using a VPN Gateway allowing access to the particular network segment where ASPECT is installed and configured. \nNote: it is crucial that the VPN Gateway and Network is setup in accordance with best industry standards and maintained in terms of security patches for all related components. \n", + "title": "Workarounds" + }, + { + "category": "general", + "text": "The vulnerabilities reported in scope of this document are only exploitable if attackers can access the network segment where ASPECT is installed and exposed directly to the internet. ABB therefore recommends the following guidelines in order to protect customers networks:\n\n\n\u2022\tASPECT devices should never be exposed directly to the Internet either via a direct ISP connection nor via NAT port forwarding. If remote access to an ASPECT system is a customer requirement, the system shall operate behind a firewall. Users accessing ASPECT remotely shall do this using a VPN Gateway allowing access to the particular network segment where ASPECT is installed and configured. \n\n\n\u2022\tNote: it is crucial that the VPN Gateway and Network is setup in accordance with best industry standards and maintained in terms of security patches for all related components. \n\n\n\u2022\tABB System Integrators shall change default passwords if they are still in use. \n\u2022\tEnsure that all ASPECT products are upgraded to the latest firmware version. Please find the latest version of ASPECT firmware on the respective product homepage\n", + "title": "Mitigating factors" + }, + { + "category": "legal_disclaimer", + "text": "All information products included in https://us-cert.cisa.gov/ics are provided \"as is\" for informational purposes only. The Department of Homeland Security (DHS) does not provide any warranties of any kind regarding any information contained within. DHS does not endorse any commercial product or service, referenced in this product or otherwise. Further dissemination of this product is governed by the Traffic Light Protocol (TLP) marking in the header. For more information about TLP, see https://us-cert.cisa.gov/tlp/.", + "title": "Legal Notice" + }, + { + "category": "other", + "text": "This CISA CSAF advisory was converted from ABB PSIRT's CSAF advisory.", + "title": "Advisory Conversion Disclaimer" + }, + { + "category": "other", + "text": "Critical Manufacturing", + "title": "Critical infrastructure sectors" + }, + { + "category": "other", + "text": "Worldwide", + "title": "Countries/areas deployed" + }, + { + "category": "other", + "text": "Switzerland", + "title": "Company headquarters location" + }, + { + "category": "general", + "text": "CISA recommends users take defensive measures to minimize the exploitation risk of this vulnerability.", + "title": "Recommended Practices" + }, + { + "category": "general", + "text": "Minimize network exposure for all control system devices and/or systems, and ensure they are not accessible from the internet.", + "title": "Recommended Practices" + }, + { + "category": "general", + "text": "Locate control system networks and remote devices behind firewalls and isolate them from business networks.", + "title": "Recommended Practices" + }, + { + "category": "general", + "text": "When remote access is required, use more secure methods, such as Virtual Private Networks (VPNs), recognizing VPNs may have vulnerabilities and should be updated to the most recent version available. Also recognize VPN is only as secure as its connected devices.", + "title": "Recommended Practices" + }, + { + "category": "general", + "text": "CISA reminds organizations to perform proper impact analysis and risk assessment prior to deploying defensive measures.", + "title": "Recommended Practices" + }, + { + "category": "general", + "text": "CISA also provides a section for control systems security recommended practices on the ICS webpage on cisa.gov. Several CISA products detailing cyber defense best practices are available for reading and download, including Improving Industrial Control Systems Cybersecurity with Defense-in-Depth Strategies.", + "title": "Recommended Practices" + }, + { + "category": "general", + "text": "CISA encourages organizations to implement recommended cybersecurity strategies for proactive defense of ICS assets. Additional mitigation guidance and recommended practices are publicly available on the ICS webpage at cisa.gov in the technical information paper, ICS-TIP-12-146-01B--Targeted Cyber Intrusion Detection and Mitigation Strategies.", + "title": "Recommended Practices" + }, + { + "category": "general", + "text": "Organizations observing suspected malicious activity should follow established internal procedures and report findings to CISA for tracking and correlation against other incidents.", + "title": "Recommended Practices" + } + ], + "publisher": { + "category": "other", + "contact_details": "central@cisa.dhs.gov", + "name": "CISA", + "namespace": "https://www.cisa.gov/" + }, + "references": [ + { + "category": "self", + "summary": "ICS Advisory ICSA-25-007-01 JSON", + "url": "https://raw.githubusercontent.com/cisagov/CSAF/develop/csaf_files/OT/white/2025/icsa-25-007-01.json" + }, + { + "summary": "ABB strongly advises customers and system integrators to follow the instructions documented in: FBXi, CBXi and ASPECT\u00ae SOLUTIONS, which can be downloaded from the ABB library. ", + "url": "https://search.abb.com/library/Download.aspx?DocumentID=HT0038&LanguageCode=en&DocumentPartId=&Action=Launch" + }, + { + "summary": "ABB CYBERSECURITY ADVISORY - PDF version ", + "url": "https://search.abb.com/library/Download.aspx?DocumentID=9AKK108469A7497&LanguageCode=en&DocumentPartId=&Action=Launch" + }, + { + "category": "self", + "summary": "ICS Advisory ICSA-25-007-01 - Web Version", + "url": "https://www.cisa.gov/news-events/ics-advisories/icsa-25-007-01" + }, + { + "category": "external", + "summary": "Recommended Practices", + "url": "https://www.cisa.gov/uscert/ics/alerts/ICS-ALERT-10-301-01" + }, + { + "category": "external", + "summary": "Recommended Practices", + "url": "https://www.cisa.gov/resources-tools/resources/ics-recommended-practices" + }, + { + "category": "external", + "summary": "Recommended Practices", + "url": "https://www.cisa.gov/topics/industrial-control-systems" + }, + { + "category": "external", + "summary": "Recommended Practices", + "url": "https://us-cert.cisa.gov/sites/default/files/recommended_practices/NCCIC_ICS-CERT_Defense_in_Depth_2016_S508C.pdf" + }, + { + "category": "external", + "summary": "Recommended Practices", + "url": "https://www.cisa.gov/sites/default/files/publications/Cybersecurity_Best_Practices_for_Industrial_Control_Systems.pdf" + }, + { + "category": "external", + "summary": "Recommended Practices", + "url": "https://www.cisa.gov/uscert/ics/tips/ICS-TIP-12-146-01B" + } + ], + "title": "ABB ASPECT System", + "tracking": { + "current_release_date": "2024-12-05T00:30:00.000000Z", + "generator": { + "date": "2024-12-06T05:34:56.134000Z", + "engine": { + "name": "CISA CSAF Generator", + "version": "1.0.0" + } + }, + "id": "ICSA-25-007-01", + "initial_release_date": "2024-07-03T00:30:00.000000Z", + "revision_history": [ + { + "date": "2024-07-03T00:30:00.000000Z", + "number": "1.0.0", + "summary": "Initial version. " + }, + { + "date": "2024-08-20T00:30:00.000000Z", + "number": "2.0.0", + "summary": "Update of advisory due to availability of ASPECT version 3.08.02" + }, + { + "date": "2024-11-28T00:30:00.000000Z", + "number": "3.0.0", + "summary": "Update of advisory due to availability of ASPECT version 3.08.03" + }, + { + "date": "2024-12-05T00:30:00.000000Z", + "number": "4.0.0", + "summary": "Acknowledgment name correction " + } + ], + "status": "final", + "version": "4.0.0" + } + }, + "product_tree": { + "branches": [ + { + "branches": [ + { + "branches": [ + { + "branches": [ + { + "category": "product_version_range", + "name": "<=3.08.02", + "product": { + "name": "ASP-ENT-x <=3.08.02", + "product_id": "CSAFPID-0001" + } + }, + { + "category": "product_version", + "name": "3.08.03", + "product": { + "name": "ASP-ENT-x 3.08.03", + "product_id": "CSAFPID-0002" + } + }, + { + "category": "product_version_range", + "name": "<=3.08.01", + "product": { + "name": "ASP-ENT-x <=3.08.01", + "product_id": "CSAFPID-0003" + } + }, + { + "category": "product_version_range", + "name": ">=3.08.02", + "product": { + "name": "ASP-ENT-x 3.08.02 and above", + "product_id": "CSAFPID-0004" + } + }, + { + "category": "product_version_range", + "name": "<=3.07.02", + "product": { + "name": "ASP-ENT-x <=3.07.02", + "product_id": "CSAFPID-0005" + } + }, + { + "category": "product_version", + "name": "3.08.00", + "product": { + "name": "ASP-ENT-x 3.08.00", + "product_id": "CSAFPID-0006" + } + } + ], + "category": "product_name", + "name": "ASP-ENT-x" + } + ], + "category": "product_family", + "name": "ASPECT\u00ae-Enterprise" + }, + { + "branches": [ + { + "branches": [ + { + "category": "product_version_range", + "name": "<=3.08.02", + "product": { + "name": "NEX-2x <=3.08.02", + "product_id": "CSAFPID-0007" + } + }, + { + "category": "product_version", + "name": "3.08.03", + "product": { + "name": "NEX-2x 3.08.03", + "product_id": "CSAFPID-0008" + } + }, + { + "category": "product_version_range", + "name": "<=3.08.01", + "product": { + "name": "NEX-2x <=3.08.01", + "product_id": "CSAFPID-0009" + } + }, + { + "category": "product_version_range", + "name": ">=3.08.02", + "product": { + "name": "NEX-2x 3.08.02 and above", + "product_id": "CSAFPID-0010" + } + }, + { + "category": "product_version_range", + "name": "<=3.07.02", + "product": { + "name": "NEX-2x <=3.07.02", + "product_id": "CSAFPID-0011" + } + }, + { + "category": "product_version", + "name": "3.08.00", + "product": { + "name": "NEX-2x 3.08.00", + "product_id": "CSAFPID-0012" + } + } + ], + "category": "product_name", + "name": "NEX-2x" + }, + { + "branches": [ + { + "category": "product_version_range", + "name": "<=3.08.02", + "product": { + "name": "NEXUS-3-x <=3.08.02", + "product_id": "CSAFPID-0013" + } + }, + { + "category": "product_version", + "name": "3.08.03", + "product": { + "name": "NEXUS-3-x 3.08.03", + "product_id": "CSAFPID-0014" + } + }, + { + "category": "product_version_range", + "name": "<=3.08.01", + "product": { + "name": "NEXUS-3-x <=3.08.01", + "product_id": "CSAFPID-0015" + } + }, + { + "category": "product_version_range", + "name": ">=3.08.02", + "product": { + "name": "NEXUS-3-x 3.08.02 and above", + "product_id": "CSAFPID-0016" + } + }, + { + "category": "product_version_range", + "name": "<=3.07.02", + "product": { + "name": "NEXUS-3-x <=3.07.02", + "product_id": "CSAFPID-0017" + } + }, + { + "category": "product_version", + "name": "3.08.00", + "product": { + "name": "NEXUS-3-x 3.08.00", + "product_id": "CSAFPID-0018" + } + } + ], + "category": "product_name", + "name": "NEXUS-3-x" + } + ], + "category": "product_family", + "name": "NEXUS Series" + }, + { + "branches": [ + { + "branches": [ + { + "category": "product_version_range", + "name": "<=3.08.02", + "product": { + "name": "MAT-x <=3.08.02", + "product_id": "CSAFPID-0019" + } + }, + { + "category": "product_version", + "name": "3.08.03", + "product": { + "name": "MAT-x 3.08.03", + "product_id": "CSAFPID-0020" + } + }, + { + "category": "product_version_range", + "name": "<=3.08.01", + "product": { + "name": "MAT-x <=3.08.01", + "product_id": "CSAFPID-0021" + } + }, + { + "category": "product_version_range", + "name": ">=3.08.02", + "product": { + "name": "MAT-x 3.08.02 and above", + "product_id": "CSAFPID-0022" + } + }, + { + "category": "product_version_range", + "name": "<=3.07.02", + "product": { + "name": "MAT-x <=3.07.02", + "product_id": "CSAFPID-0023" + } + }, + { + "category": "product_version", + "name": "3.08.00", + "product": { + "name": "MAT-x 3.08.00", + "product_id": "CSAFPID-0024" + } + } + ], + "category": "product_name", + "name": "MAT-x" + } + ], + "category": "product_family", + "name": "MATRIX Series" + } + ], + "category": "vendor", + "name": "ABB" + } + ] + }, + "vulnerabilities": [ + { + "cve": "CVE-2024-6209", + "cwe": { + "id": "CWE-552", + "name": "Files or Directories Accessible to External Parties" + }, + "notes": [ + { + "category": "description", + "text": "Unauthorized file access in WEB Server in ASPECT <=3.08.01 allows Attacker to access files unauthorized", + "title": "CVE description" + } + ], + "product_status": { + "fixed": [ + "CSAFPID-0004", + "CSAFPID-0010", + "CSAFPID-0016", + "CSAFPID-0022" + ], + "known_affected": [ + "CSAFPID-0003", + "CSAFPID-0009", + "CSAFPID-0021", + "CSAFPID-0015" + ] + }, + "references": [ + { + "category": "self", + "summary": "NVD - CVE-2024-6209", + "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-6209" + } + ], + "remediations": [ + { + "category": "vendor_fix", + "details": "The vulnerabilities have been resolved in the following product versions:\n3.08.02 and later.", + "product_ids": [ + "CSAFPID-0003", + "CSAFPID-0009", + "CSAFPID-0021", + "CSAFPID-0015" + ] + } + ], + "scores": [ + { + "cvss_v3": { + "attackComplexity": "LOW", + "attackVector": "NETWORK", + "availabilityImpact": "HIGH", + "baseScore": 10, + "baseSeverity": "CRITICAL", + "confidentialityImpact": "HIGH", + "environmentalScore": 9.7, + "environmentalSeverity": "CRITICAL", + "exploitCodeMaturity": "FUNCTIONAL", + "integrityImpact": "HIGH", + "privilegesRequired": "NONE", + "remediationLevel": "UNAVAILABLE", + "reportConfidence": "CONFIRMED", + "scope": "CHANGED", + "temporalScore": 9.7, + "temporalSeverity": "CRITICAL", + "userInteraction": "NONE", + "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H/E:F/RL:U/RC:C", + "version": "3.1" + }, + "products": [ + "CSAFPID-0003", + "CSAFPID-0009", + "CSAFPID-0021", + "CSAFPID-0015" + ] + } + ], + "title": "CVE-2024-6209" + }, + { + "cve": "CVE-2024-6298", + "cwe": { + "id": "CWE-1287", + "name": "Improper Validation of Specified Type of Input" + }, + "notes": [ + { + "category": "description", + "text": "Improper Input Validation vulnerability in ASPECT allows Remote Code Inclusion. <=3.08.01", + "title": "CVE description" + } + ], + "product_status": { + "fixed": [ + "CSAFPID-0004", + "CSAFPID-0010", + "CSAFPID-0016", + "CSAFPID-0022" + ], + "known_affected": [ + "CSAFPID-0003", + "CSAFPID-0009", + "CSAFPID-0021", + "CSAFPID-0015" + ] + }, + "references": [ + { + "category": "self", + "summary": "NVD - CVE-2024-6298", + "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-6298" + } + ], + "remediations": [ + { + "category": "vendor_fix", + "details": "The vulnerabilities have been resolved in the following product versions:\n3.08.02 and later.", + "product_ids": [ + "CSAFPID-0003", + "CSAFPID-0009", + "CSAFPID-0021", + "CSAFPID-0015" + ] + } + ], + "scores": [ + { + "cvss_v3": { + "attackComplexity": "LOW", + "attackVector": "NETWORK", + "availabilityImpact": "HIGH", + "baseScore": 10, + "baseSeverity": "CRITICAL", + "confidentialityImpact": "HIGH", + "environmentalScore": 9.4, + "environmentalSeverity": "CRITICAL", + "exploitCodeMaturity": "PROOF_OF_CONCEPT", + "integrityImpact": "HIGH", + "privilegesRequired": "NONE", + "remediationLevel": "UNAVAILABLE", + "reportConfidence": "CONFIRMED", + "scope": "CHANGED", + "temporalScore": 9.4, + "temporalSeverity": "CRITICAL", + "userInteraction": "NONE", + "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H/E:P/RL:U/RC:C", + "version": "3.1" + }, + "products": [ + "CSAFPID-0003", + "CSAFPID-0009", + "CSAFPID-0021", + "CSAFPID-0015" + ] + } + ], + "title": "CVE-2024-6298" + }, + { + "cve": "CVE-2024-6515", + "cwe": { + "id": "CWE-319", + "name": "Cleartext Transmission of Sensitive Information" + }, + "notes": [ + { + "category": "description", + "text": "Web browser interface may manipulate application username/password in clear text or Base64 encoding in ABB ASPECT providing a higher probability of unintended creden-tails exposure. <=3.08.02", + "title": "CVE description" + } + ], + "product_status": { + "fixed": [ + "CSAFPID-0002", + "CSAFPID-0008", + "CSAFPID-0014", + "CSAFPID-0020" + ], + "known_affected": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + }, + "references": [ + { + "category": "self", + "summary": "NVD - CVE-2024-6515", + "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-6515" + } + ], + "remediations": [ + { + "category": "vendor_fix", + "details": "The vulnerabilities have been resolved in the following product versions:\n3.08.03 and later.", + "product_ids": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + } + ], + "scores": [ + { + "cvss_v3": { + "attackComplexity": "LOW", + "attackVector": "NETWORK", + "availabilityImpact": "NONE", + "baseScore": 9.6, + "baseSeverity": "CRITICAL", + "confidentialityImpact": "HIGH", + "environmentalScore": 8.9, + "environmentalSeverity": "HIGH", + "exploitCodeMaturity": "FUNCTIONAL", + "integrityImpact": "HIGH", + "privilegesRequired": "LOW", + "remediationLevel": "OFFICIAL_FIX", + "reportConfidence": "CONFIRMED", + "scope": "CHANGED", + "temporalScore": 8.9, + "temporalSeverity": "HIGH", + "userInteraction": "NONE", + "vectorString": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N/E:F/RL:O/RC:C", + "version": "3.1" + }, + "products": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + } + ], + "title": "CVE-2024-6515 " + }, + { + "cve": "CVE-2024-6516", + "cwe": { + "id": "CWE-79", + "name": "Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')" + }, + "notes": [ + { + "category": "description", + "text": "Cross Site Scripting vulnerabilities where found in ABB ASPECT providing a potential for malicious scripts to be injected into a client browser. <=3.08.02.", + "title": "CVE description" + } + ], + "product_status": { + "fixed": [ + "CSAFPID-0002", + "CSAFPID-0008", + "CSAFPID-0014", + "CSAFPID-0020" + ], + "known_affected": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + }, + "references": [ + { + "category": "self", + "summary": "NVD - CVE-2024-6516", + "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-6516" + } + ], + "remediations": [ + { + "category": "vendor_fix", + "details": "The vulnerabilities have been resolved in the following product versions:\n3.08.03 and later.", + "product_ids": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + } + ], + "scores": [ + { + "cvss_v3": { + "attackComplexity": "LOW", + "attackVector": "NETWORK", + "availabilityImpact": "LOW", + "baseScore": 9, + "baseSeverity": "CRITICAL", + "confidentialityImpact": "HIGH", + "environmentalScore": 8.6, + "environmentalSeverity": "HIGH", + "exploitCodeMaturity": "HIGH", + "integrityImpact": "HIGH", + "privilegesRequired": "HIGH", + "remediationLevel": "OFFICIAL_FIX", + "reportConfidence": "CONFIRMED", + "scope": "CHANGED", + "temporalScore": 8.6, + "temporalSeverity": "HIGH", + "userInteraction": "NONE", + "vectorString": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:L/E:H/RL:O/RC:C", + "version": "3.1" + }, + "products": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + } + ], + "title": "CVE-2024-6516" + }, + { + "cve": "CVE-2024-6784", + "cwe": { + "id": "CWE-918", + "name": "Server-Side Request Forgery (SSRF)" + }, + "notes": [ + { + "category": "description", + "text": "Server-Side Request Forgery vulnerabilities were found in ASPECT providing a potential for access to unauthorized resources and unintended information disclosure. <=3.08.02.", + "title": "CVE description" + } + ], + "product_status": { + "fixed": [ + "CSAFPID-0002", + "CSAFPID-0008", + "CSAFPID-0014", + "CSAFPID-0020" + ], + "known_affected": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + }, + "references": [ + { + "category": "self", + "summary": "NVD - CVE-2024-6784", + "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-6784" + } + ], + "remediations": [ + { + "category": "vendor_fix", + "details": "The vulnerabilities have been resolved in the following product versions:\n3.08.03 and later.", + "product_ids": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + } + ], + "scores": [ + { + "cvss_v3": { + "attackComplexity": "LOW", + "attackVector": "NETWORK", + "availabilityImpact": "HIGH", + "baseScore": 9.9, + "baseSeverity": "CRITICAL", + "confidentialityImpact": "HIGH", + "environmentalScore": 9.3, + "environmentalSeverity": "CRITICAL", + "exploitCodeMaturity": "FUNCTIONAL", + "integrityImpact": "HIGH", + "privilegesRequired": "LOW", + "remediationLevel": "OFFICIAL_FIX", + "reportConfidence": "CONFIRMED", + "scope": "CHANGED", + "temporalScore": 9.2, + "temporalSeverity": "CRITICAL", + "userInteraction": "NONE", + "vectorString": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H/E:F/RL:O/RC:C", + "version": "3.1" + }, + "products": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + } + ], + "title": "CVE-2024-6784" + }, + { + "cve": "CVE-2024-48843", + "cwe": { + "id": "CWE-943", + "name": "Improper Neutralization of Special Elements in Data Query Logic" + }, + "notes": [ + { + "category": "description", + "text": "SQL injection vulnerabilities were found in ASPECT providing a potential for unintended information disclosure. This issue affects ASPECT <=3.08.02", + "title": "CVE description" + } + ], + "product_status": { + "fixed": [ + "CSAFPID-0002", + "CSAFPID-0008", + "CSAFPID-0014", + "CSAFPID-0020" + ], + "known_affected": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + }, + "references": [ + { + "category": "self", + "summary": "NVD - CVE-2024-48843", + "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-48843" + } + ], + "remediations": [ + { + "category": "vendor_fix", + "details": "The vulnerabilities have been resolved in the following product versions:\n3.08.03 and later.", + "product_ids": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + } + ], + "scores": [ + { + "cvss_v3": { + "attackComplexity": "HIGH", + "attackVector": "NETWORK", + "availabilityImpact": "NONE", + "baseScore": 8.2, + "baseSeverity": "HIGH", + "confidentialityImpact": "HIGH", + "environmentalScore": 7.6, + "environmentalSeverity": "HIGH", + "exploitCodeMaturity": "FUNCTIONAL", + "integrityImpact": "HIGH", + "privilegesRequired": "LOW", + "remediationLevel": "OFFICIAL_FIX", + "reportConfidence": "CONFIRMED", + "scope": "CHANGED", + "temporalScore": 7.6, + "temporalSeverity": "HIGH", + "userInteraction": "NONE", + "vectorString": "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:N/E:F/RL:O/RC:C", + "version": "3.1" + }, + "products": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + } + ], + "title": "CVE-2024-48843" + }, + { + "cve": "CVE-2024-48844", + "cwe": { + "id": "CWE-770", + "name": "Allocation of Resources Without Limits or Throttling" + }, + "notes": [ + { + "category": "description", + "text": "Denial of Service vulnerabilities where found in ASPECT providing a potiential for device service disruptions. This issue affects ASPECT <=3.08.02", + "title": "CVE description" + } + ], + "product_status": { + "fixed": [ + "CSAFPID-0002", + "CSAFPID-0008", + "CSAFPID-0014", + "CSAFPID-0020" + ], + "known_affected": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + }, + "references": [ + { + "category": "self", + "summary": "NVD - CVE-2024-48844", + "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-48844" + } + ], + "remediations": [ + { + "category": "vendor_fix", + "details": "The vulnerabilities have been resolved in the following product versions:\n3.08.03 and later.", + "product_ids": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + } + ], + "scores": [ + { + "cvss_v3": { + "attackComplexity": "HIGH", + "attackVector": "NETWORK", + "availabilityImpact": "HIGH", + "baseScore": 7.7, + "baseSeverity": "HIGH", + "confidentialityImpact": "LOW", + "environmentalScore": 7.1, + "environmentalSeverity": "HIGH", + "exploitCodeMaturity": "FUNCTIONAL", + "integrityImpact": "LOW", + "privilegesRequired": "LOW", + "remediationLevel": "OFFICIAL_FIX", + "reportConfidence": "CONFIRMED", + "scope": "CHANGED", + "temporalScore": 7.1, + "temporalSeverity": "HIGH", + "userInteraction": "NONE", + "vectorString": "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:L/I:L/A:H/E:F/RL:O/RC:C", + "version": "3.1" + }, + "products": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + } + ], + "title": "CVE-2024-48844" + }, + { + "cve": "CVE-2024-48845", + "cwe": { + "id": "CWE-521", + "name": "Weak Password Requirements" + }, + "notes": [ + { + "category": "description", + "text": "Weak Password Reset Rules vulnerabilities where found in Aspect providing a potiential for the storage of weak passwords that could facilitate unauthorized admin/application access. This issue affects ASPECT <=3.07.02 ", + "title": "CVE description" + } + ], + "product_status": { + "fixed": [ + "CSAFPID-0006", + "CSAFPID-0018", + "CSAFPID-0012", + "CSAFPID-0024" + ], + "known_affected": [ + "CSAFPID-0005", + "CSAFPID-0017", + "CSAFPID-0011", + "CSAFPID-0023" + ] + }, + "references": [ + { + "category": "self", + "summary": "NVD - CVE-2024-48845", + "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-48845" + } + ], + "remediations": [ + { + "category": "vendor_fix", + "details": "The vulnerabilities have been resolved in the following product versions:\n3.08.00 and later", + "product_ids": [ + "CSAFPID-0005", + "CSAFPID-0017", + "CSAFPID-0011", + "CSAFPID-0023" + ] + } + ], + "scores": [ + { + "cvss_v3": { + "attackComplexity": "LOW", + "attackVector": "NETWORK", + "availabilityImpact": "LOW", + "baseScore": 9.4, + "baseSeverity": "CRITICAL", + "confidentialityImpact": "HIGH", + "environmentalScore": 9, + "environmentalSeverity": "CRITICAL", + "exploitCodeMaturity": "HIGH", + "integrityImpact": "HIGH", + "privilegesRequired": "NONE", + "remediationLevel": "OFFICIAL_FIX", + "reportConfidence": "CONFIRMED", + "scope": "UNCHANGED", + "temporalScore": 9, + "temporalSeverity": "CRITICAL", + "userInteraction": "NONE", + "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:L/E:H/RL:O/RC:C", + "version": "3.1" + }, + "products": [ + "CSAFPID-0005", + "CSAFPID-0017", + "CSAFPID-0011", + "CSAFPID-0023" + ] + } + ], + "title": "CVE-2024-48845" + }, + { + "cve": "CVE-2024-48846", + "cwe": { + "id": "CWE-352", + "name": "Cross-Site Request Forgery (CSRF)" + }, + "notes": [ + { + "category": "description", + "text": "Cross Site Request Forgery vulnerabilities where found in ASPECT providing a potiential for exposing sensitive information or changing system settings. This issue affects ASPECT <=3.08.02", + "title": "CVE description" + } + ], + "product_status": { + "fixed": [ + "CSAFPID-0002", + "CSAFPID-0008", + "CSAFPID-0014", + "CSAFPID-0020" + ], + "known_affected": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + }, + "references": [ + { + "category": "self", + "summary": "NVD - CVE-2024-48846", + "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-48846" + } + ], + "remediations": [ + { + "category": "vendor_fix", + "details": "The vulnerabilities have been resolved in the following product versions:\n3.08.03 and later.", + "product_ids": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + } + ], + "scores": [ + { + "cvss_v3": { + "attackComplexity": "LOW", + "attackVector": "NETWORK", + "availabilityImpact": "NONE", + "baseScore": 7.1, + "baseSeverity": "HIGH", + "confidentialityImpact": "LOW", + "environmentalScore": 6.6, + "environmentalSeverity": "MEDIUM", + "exploitCodeMaturity": "FUNCTIONAL", + "integrityImpact": "HIGH", + "privilegesRequired": "LOW", + "remediationLevel": "OFFICIAL_FIX", + "reportConfidence": "CONFIRMED", + "scope": "UNCHANGED", + "temporalScore": 6.6, + "temporalSeverity": "MEDIUM", + "userInteraction": "NONE", + "vectorString": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:N/E:F/RL:O/RC:C", + "version": "3.1" + }, + "products": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + } + ], + "title": "CVE-2024-48846" + }, + { + "cve": "CVE-2024-48847", + "cwe": { + "id": "CWE-328", + "name": "Use of Weak Hash" + }, + "notes": [ + { + "category": "description", + "text": "MD5 Checksum Bypass vulnerabilities where found in ASPECT exploiting a weakness in the way an application dependency calculates or validates MD5 checksum hashes. This issue affects ASPECT <= 3.08.01.", + "title": "CVE description" + } + ], + "product_status": { + "fixed": [ + "CSAFPID-0004", + "CSAFPID-0010", + "CSAFPID-0016", + "CSAFPID-0022" + ], + "known_affected": [ + "CSAFPID-0003", + "CSAFPID-0009", + "CSAFPID-0021", + "CSAFPID-0015" + ] + }, + "references": [ + { + "category": "self", + "summary": "NVD - CVE-2024-48847", + "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-48847" + } + ], + "remediations": [ + { + "category": "vendor_fix", + "details": "The vulnerabilities have been resolved in the following product versions:\n3.08.02 and later.", + "product_ids": [ + "CSAFPID-0003", + "CSAFPID-0009", + "CSAFPID-0021", + "CSAFPID-0015" + ] + } + ], + "scores": [ + { + "cvss_v3": { + "attackComplexity": "LOW", + "attackVector": "NETWORK", + "availabilityImpact": "NONE", + "baseScore": 8.2, + "baseSeverity": "HIGH", + "confidentialityImpact": "LOW", + "environmentalScore": 7.6, + "environmentalSeverity": "HIGH", + "exploitCodeMaturity": "FUNCTIONAL", + "integrityImpact": "HIGH", + "privilegesRequired": "NONE", + "remediationLevel": "OFFICIAL_FIX", + "reportConfidence": "CONFIRMED", + "scope": "UNCHANGED", + "temporalScore": 7.6, + "temporalSeverity": "HIGH", + "userInteraction": "NONE", + "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:N/E:F/RL:O/RC:C", + "version": "3.1" + }, + "products": [ + "CSAFPID-0003", + "CSAFPID-0009", + "CSAFPID-0021", + "CSAFPID-0015" + ] + } + ], + "title": "CVE-2024-48847" + }, + { + "cve": "CVE-2024-48839", + "cwe": { + "id": "CWE-94", + "name": "Improper Control of Generation of Code ('Code Injection')" + }, + "notes": [ + { + "category": "description", + "text": "Improper Input Validation vulnerability in ASPECT allows Remote Code Execution. This issue affects ASPECT <=3.08.02", + "title": "CVE description" + } + ], + "product_status": { + "fixed": [ + "CSAFPID-0002", + "CSAFPID-0008", + "CSAFPID-0014", + "CSAFPID-0020" + ], + "known_affected": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + }, + "references": [ + { + "category": "self", + "summary": "NVD - CVE-2024-48839", + "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-48839" + } + ], + "remediations": [ + { + "category": "vendor_fix", + "details": "The vulnerabilities have been resolved in the following product versions:\n3.08.03 and later.", + "product_ids": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + } + ], + "scores": [ + { + "cvss_v3": { + "attackComplexity": "LOW", + "attackVector": "NETWORK", + "availabilityImpact": "LOW", + "baseScore": 10, + "baseSeverity": "CRITICAL", + "confidentialityImpact": "HIGH", + "environmentalScore": 9.3, + "environmentalSeverity": "CRITICAL", + "exploitCodeMaturity": "FUNCTIONAL", + "integrityImpact": "HIGH", + "privilegesRequired": "NONE", + "remediationLevel": "OFFICIAL_FIX", + "reportConfidence": "CONFIRMED", + "scope": "CHANGED", + "temporalScore": 9.3, + "temporalSeverity": "CRITICAL", + "userInteraction": "NONE", + "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:L/E:F/RL:O/RC:C", + "version": "3.1" + }, + "products": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + } + ], + "title": "CVE-2024-48839" + }, + { + "cve": "CVE-2024-48840", + "cwe": { + "id": "CWE-94", + "name": "Improper Control of Generation of Code ('Code Injection')" + }, + "notes": [ + { + "category": "description", + "text": "Unauthorized Access vulnerabilities in ASPECT allow Remote Code Execution. This is-sue affects ASPECT <= 3.08.02", + "title": "CVE description" + } + ], + "product_status": { + "fixed": [ + "CSAFPID-0002", + "CSAFPID-0008", + "CSAFPID-0014", + "CSAFPID-0020" + ], + "known_affected": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + }, + "references": [ + { + "category": "self", + "summary": "NVD - CVE-2024-48840", + "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-48840" + } + ], + "remediations": [ + { + "category": "vendor_fix", + "details": "The vulnerabilities have been resolved in the following product versions:\n3.08.03 and later.", + "product_ids": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + } + ], + "scores": [ + { + "cvss_v3": { + "attackComplexity": "LOW", + "attackVector": "NETWORK", + "availabilityImpact": "LOW", + "baseScore": 10, + "baseSeverity": "CRITICAL", + "confidentialityImpact": "HIGH", + "environmentalScore": 9.3, + "environmentalSeverity": "CRITICAL", + "exploitCodeMaturity": "FUNCTIONAL", + "integrityImpact": "HIGH", + "privilegesRequired": "NONE", + "remediationLevel": "OFFICIAL_FIX", + "reportConfidence": "CONFIRMED", + "scope": "CHANGED", + "temporalScore": 9.3, + "temporalSeverity": "CRITICAL", + "userInteraction": "NONE", + "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:L/E:F/RL:O/RC:C", + "version": "3.1" + }, + "products": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + } + ], + "title": "CVE-2024-48840" + }, + { + "cve": "CVE-2024-51541", + "cwe": { + "id": "CWE-98", + "name": "Improper Control of Filename for Include/Require Statement in PHP Program ('PHP Remote File Inclusion')" + }, + "notes": [ + { + "category": "description", + "text": "Local File Inclusion vulnerabilities in ASPECT allow access to sensitive system infor-mation. This issue affects ASPECT <= 3.08.02", + "title": "CVE description" + } + ], + "product_status": { + "fixed": [ + "CSAFPID-0002", + "CSAFPID-0008", + "CSAFPID-0014", + "CSAFPID-0020" + ], + "known_affected": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + }, + "references": [ + { + "category": "self", + "summary": "NVD - CVE-2024-51541", + "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-51541" + } + ], + "remediations": [ + { + "category": "vendor_fix", + "details": "The vulnerabilities have been resolved in the following product versions:\n3.08.03 and later.", + "product_ids": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + } + ], + "scores": [ + { + "cvss_v3": { + "attackComplexity": "LOW", + "attackVector": "NETWORK", + "availabilityImpact": "NONE", + "baseScore": 8.2, + "baseSeverity": "HIGH", + "confidentialityImpact": "HIGH", + "environmentalScore": 7.6, + "environmentalSeverity": "HIGH", + "exploitCodeMaturity": "FUNCTIONAL", + "integrityImpact": "LOW", + "privilegesRequired": "NONE", + "remediationLevel": "OFFICIAL_FIX", + "reportConfidence": "CONFIRMED", + "scope": "UNCHANGED", + "temporalScore": 7.6, + "temporalSeverity": "HIGH", + "userInteraction": "NONE", + "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N/E:F/RL:O/RC:C", + "version": "3.1" + }, + "products": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + } + ], + "title": "CVE-2024-51541" + }, + { + "cve": "CVE-2024-51542", + "cwe": { + "id": "CWE-552", + "name": "Files or Directories Accessible to External Parties" + }, + "notes": [ + { + "category": "description", + "text": "Configuration Download vulnerabilities in ASPECT allow access to dependency configu-ration information. This issue affects ASPECT <= 3.08.02.", + "title": "CVE description" + } + ], + "product_status": { + "fixed": [ + "CSAFPID-0002", + "CSAFPID-0008", + "CSAFPID-0014", + "CSAFPID-0020" + ], + "known_affected": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + }, + "references": [ + { + "category": "self", + "summary": "NVD - CVE-2024-51542", + "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-51542" + } + ], + "remediations": [ + { + "category": "vendor_fix", + "details": "The vulnerabilities have been resolved in the following product versions:\n3.08.03 and later.", + "product_ids": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + } + ], + "scores": [ + { + "cvss_v3": { + "attackComplexity": "LOW", + "attackVector": "NETWORK", + "availabilityImpact": "NONE", + "baseScore": 8.2, + "baseSeverity": "HIGH", + "confidentialityImpact": "HIGH", + "environmentalScore": 7.6, + "environmentalSeverity": "HIGH", + "exploitCodeMaturity": "FUNCTIONAL", + "integrityImpact": "LOW", + "privilegesRequired": "NONE", + "remediationLevel": "OFFICIAL_FIX", + "reportConfidence": "CONFIRMED", + "scope": "UNCHANGED", + "temporalScore": 7.6, + "temporalSeverity": "HIGH", + "userInteraction": "NONE", + "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N/E:F/RL:O/RC:C", + "version": "3.1" + }, + "products": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + } + ], + "title": "CVE-2024-51542" + }, + { + "cve": "CVE-2024-51543", + "cwe": { + "id": "CWE-15", + "name": "External Control of System or Configuration Setting" + }, + "notes": [ + { + "category": "description", + "text": "Information Disclosure vulnerabilities in ASPECT allow access to application configura-tion information. This issue affects <= 3.08.02.", + "title": "CVE description" + } + ], + "product_status": { + "fixed": [ + "CSAFPID-0002", + "CSAFPID-0008", + "CSAFPID-0014", + "CSAFPID-0020" + ], + "known_affected": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + }, + "references": [ + { + "category": "self", + "summary": "NVD - CVE-2024-51543", + "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-51543" + } + ], + "remediations": [ + { + "category": "vendor_fix", + "details": "The vulnerabilities have been resolved in the following product versions:\n3.08.03 and later.", + "product_ids": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + } + ], + "scores": [ + { + "cvss_v3": { + "attackComplexity": "LOW", + "attackVector": "NETWORK", + "availabilityImpact": "NONE", + "baseScore": 8.2, + "baseSeverity": "HIGH", + "confidentialityImpact": "HIGH", + "environmentalScore": 7.6, + "environmentalSeverity": "HIGH", + "exploitCodeMaturity": "FUNCTIONAL", + "integrityImpact": "LOW", + "privilegesRequired": "NONE", + "remediationLevel": "OFFICIAL_FIX", + "reportConfidence": "CONFIRMED", + "scope": "UNCHANGED", + "temporalScore": 7.6, + "temporalSeverity": "HIGH", + "userInteraction": "NONE", + "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N/E:F/RL:O/RC:C", + "version": "3.1" + }, + "products": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + } + ], + "title": "CVE-2024-51543" + }, + { + "cve": "CVE-2024-51544", + "cwe": { + "id": "CWE-15", + "name": "External Control of System or Configuration Setting" + }, + "notes": [ + { + "category": "description", + "text": "Service Control vulnerabilities in ASPECT allow access to service restart requests and vm configuration settings. This issue affects <= 3.08.02.", + "title": "CVE description" + } + ], + "product_status": { + "fixed": [ + "CSAFPID-0002", + "CSAFPID-0008", + "CSAFPID-0014", + "CSAFPID-0020" + ], + "known_affected": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + }, + "references": [ + { + "category": "self", + "summary": "NVD- CVE-2024-51544", + "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-51544" + } + ], + "remediations": [ + { + "category": "vendor_fix", + "details": "The vulnerabilities have been resolved in the following product versions:\n3.08.03 and later.", + "product_ids": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + } + ], + "scores": [ + { + "cvss_v3": { + "attackComplexity": "LOW", + "attackVector": "NETWORK", + "availabilityImpact": "HIGH", + "baseScore": 8.2, + "baseSeverity": "HIGH", + "confidentialityImpact": "NONE", + "environmentalScore": 7.6, + "environmentalSeverity": "HIGH", + "exploitCodeMaturity": "FUNCTIONAL", + "integrityImpact": "LOW", + "privilegesRequired": "NONE", + "remediationLevel": "OFFICIAL_FIX", + "reportConfidence": "CONFIRMED", + "scope": "UNCHANGED", + "temporalScore": 7.6, + "temporalSeverity": "HIGH", + "userInteraction": "NONE", + "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H/E:F/RL:O/RC:C", + "version": "3.1" + }, + "products": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + } + ], + "title": "CVE-2024-51544" + }, + { + "cve": "CVE-2024-51545", + "cwe": { + "id": "CWE-522", + "name": "Insufficiently Protected Credentials" + }, + "notes": [ + { + "category": "description", + "text": "Username Enumeration vulnerabilities ASPECT allow access to application level username add, delete, modify and list functions. This issue affects ASPECT <= 3.08.02.", + "title": "CVE description" + } + ], + "product_status": { + "fixed": [ + "CSAFPID-0002", + "CSAFPID-0008", + "CSAFPID-0014", + "CSAFPID-0020" + ], + "known_affected": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + }, + "references": [ + { + "category": "self", + "summary": "NVD - CVE-2024-51545", + "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-51545" + } + ], + "remediations": [ + { + "category": "vendor_fix", + "details": "The vulnerabilities have been resolved in the following product versions:\n3.08.03 and later.", + "product_ids": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + } + ], + "scores": [ + { + "cvss_v3": { + "attackComplexity": "LOW", + "attackVector": "NETWORK", + "availabilityImpact": "HIGH", + "baseScore": 10, + "baseSeverity": "CRITICAL", + "confidentialityImpact": "HIGH", + "environmentalScore": 9, + "environmentalSeverity": "CRITICAL", + "exploitCodeMaturity": "PROOF_OF_CONCEPT", + "integrityImpact": "HIGH", + "privilegesRequired": "NONE", + "remediationLevel": "OFFICIAL_FIX", + "reportConfidence": "CONFIRMED", + "scope": "CHANGED", + "temporalScore": 9, + "temporalSeverity": "CRITICAL", + "userInteraction": "NONE", + "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H/E:P/RL:O/RC:C", + "version": "3.1" + }, + "products": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + } + ], + "title": "CVE-2024-51545" + }, + { + "cve": "CVE-2024-51546", + "cwe": { + "id": "CWE-1287", + "name": "Improper Validation of Specified Type of Input" + }, + "notes": [ + { + "category": "description", + "text": "Credentials Disclosure vulnerabilities in ASPECT allow access to on board project back-up bundles. This issue affects ASPECT <= 3.08.02", + "title": "CVE description" + } + ], + "product_status": { + "fixed": [ + "CSAFPID-0002", + "CSAFPID-0008", + "CSAFPID-0014", + "CSAFPID-0020" + ], + "known_affected": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + }, + "references": [ + { + "category": "self", + "summary": "NVD - CVE-2024-51546", + "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-51546" + } + ], + "remediations": [ + { + "category": "vendor_fix", + "details": "The vulnerabilities have been resolved in the following product versions:\n3.08.03 and later.", + "product_ids": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + } + ], + "scores": [ + { + "cvss_v3": { + "attackComplexity": "LOW", + "attackVector": "NETWORK", + "availabilityImpact": "NONE", + "baseScore": 7.5, + "baseSeverity": "HIGH", + "confidentialityImpact": "HIGH", + "environmentalScore": 7, + "environmentalSeverity": "HIGH", + "exploitCodeMaturity": "FUNCTIONAL", + "integrityImpact": "NONE", + "privilegesRequired": "NONE", + "remediationLevel": "OFFICIAL_FIX", + "reportConfidence": "CONFIRMED", + "scope": "UNCHANGED", + "temporalScore": 7, + "temporalSeverity": "HIGH", + "userInteraction": "NONE", + "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N/E:F/RL:O/RC:C", + "version": "3.1" + }, + "products": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + } + ], + "title": "CVE-2024-51546" + }, + { + "cve": "CVE-2024-51548", + "cwe": { + "id": "CWE-434", + "name": "Unrestricted Upload of File with Dangerous Type" + }, + "notes": [ + { + "category": "description", + "text": "Dangerous File Upload vulnerabilities in ASPECT allow upload of malicious scripts. This issue affects ASPECT <= 3.08.02", + "title": "CVE description" + } + ], + "product_status": { + "fixed": [ + "CSAFPID-0002", + "CSAFPID-0008", + "CSAFPID-0014", + "CSAFPID-0020" + ], + "known_affected": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + }, + "references": [ + { + "category": "self", + "summary": "NVD - CVE-2024-51548", + "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-51548" + } + ], + "remediations": [ + { + "category": "vendor_fix", + "details": "The vulnerabilities have been resolved in the following product versions:\n3.08.03 and later.", + "product_ids": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + } + ], + "scores": [ + { + "cvss_v3": { + "attackComplexity": "LOW", + "attackVector": "NETWORK", + "availabilityImpact": "HIGH", + "baseScore": 9.9, + "baseSeverity": "CRITICAL", + "confidentialityImpact": "HIGH", + "environmentalScore": 9.3, + "environmentalSeverity": "CRITICAL", + "exploitCodeMaturity": "FUNCTIONAL", + "integrityImpact": "HIGH", + "privilegesRequired": "LOW", + "remediationLevel": "OFFICIAL_FIX", + "reportConfidence": "CONFIRMED", + "scope": "CHANGED", + "temporalScore": 9.2, + "temporalSeverity": "CRITICAL", + "userInteraction": "NONE", + "vectorString": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H/E:F/RL:O/RC:C", + "version": "3.1" + }, + "products": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + } + ], + "title": "CVE-2024-51548" + }, + { + "cve": "CVE-2024-51549", + "cwe": { + "id": "CWE-36", + "name": "Absolute Path Traversal" + }, + "notes": [ + { + "category": "description", + "text": "Absolute File Traversal vulnerabilities in ASPECT allows access and modification of un-intended resources. This issue affects ASPECT<= 3.08.02", + "title": "CVE description" + } + ], + "product_status": { + "fixed": [ + "CSAFPID-0002", + "CSAFPID-0008", + "CSAFPID-0014", + "CSAFPID-0020" + ], + "known_affected": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + }, + "references": [ + { + "category": "external", + "summary": "NVD - CVE-2024-51549", + "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-51549" + } + ], + "remediations": [ + { + "category": "vendor_fix", + "details": "The vulnerabilities have been resolved in the following product versions:\n3.08.03 and later.", + "product_ids": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + } + ], + "scores": [ + { + "cvss_v3": { + "attackComplexity": "LOW", + "attackVector": "NETWORK", + "availabilityImpact": "LOW", + "baseScore": 10, + "baseSeverity": "CRITICAL", + "confidentialityImpact": "HIGH", + "environmentalScore": 9.3, + "environmentalSeverity": "CRITICAL", + "exploitCodeMaturity": "FUNCTIONAL", + "integrityImpact": "HIGH", + "privilegesRequired": "NONE", + "remediationLevel": "OFFICIAL_FIX", + "reportConfidence": "CONFIRMED", + "scope": "CHANGED", + "temporalScore": 9.3, + "temporalSeverity": "CRITICAL", + "userInteraction": "NONE", + "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:L/E:F/RL:O/RC:C", + "version": "3.1" + }, + "products": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + } + ], + "title": "CVE-2024-51549" + }, + { + "cve": "CVE-2024-51550", + "cwe": { + "id": "CWE-1287", + "name": "Improper Validation of Specified Type of Input" + }, + "notes": [ + { + "category": "description", + "text": "Data Validation / Data Sanitization vulnerabilities in ASPECT Linux allows unvalidated and unsanitized data to be injected in an Aspect device. This issue affects ASPECT <= 3.08.02", + "title": "CVE description" + } + ], + "product_status": { + "fixed": [ + "CSAFPID-0002", + "CSAFPID-0008", + "CSAFPID-0014", + "CSAFPID-0020" + ], + "known_affected": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + }, + "references": [ + { + "category": "self", + "summary": "NVD - CVE-2024-51550", + "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-51550" + } + ], + "remediations": [ + { + "category": "vendor_fix", + "details": "The vulnerabilities have been resolved in the following product versions:\n3.08.03 and later.", + "product_ids": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + } + ], + "scores": [ + { + "cvss_v3": { + "attackComplexity": "LOW", + "attackVector": "NETWORK", + "availabilityImpact": "LOW", + "baseScore": 10, + "baseSeverity": "CRITICAL", + "confidentialityImpact": "HIGH", + "environmentalScore": 9.3, + "environmentalSeverity": "CRITICAL", + "exploitCodeMaturity": "FUNCTIONAL", + "integrityImpact": "HIGH", + "privilegesRequired": "NONE", + "remediationLevel": "OFFICIAL_FIX", + "reportConfidence": "CONFIRMED", + "scope": "CHANGED", + "temporalScore": 9.3, + "temporalSeverity": "CRITICAL", + "userInteraction": "NONE", + "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:L/E:F/RL:O/RC:C", + "version": "3.1" + }, + "products": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + } + ], + "title": "CVE-2024-51550" + }, + { + "cve": "CVE-2024-51551", + "cwe": { + "id": "CWE-1392", + "name": "Use of Default Credentials" + }, + "notes": [ + { + "category": "description", + "text": "Default Credentail vulnerabilities in ASPECT on Linux allows access to an Aspect device using publicly available default credentials. This issue affects ASPECT <= through 3.07.02", + "title": "CVE description" + } + ], + "product_status": { + "fixed": [ + "CSAFPID-0006", + "CSAFPID-0018", + "CSAFPID-0012", + "CSAFPID-0024" + ], + "known_affected": [ + "CSAFPID-0005", + "CSAFPID-0017", + "CSAFPID-0011", + "CSAFPID-0023" + ] + }, + "references": [ + { + "category": "self", + "summary": "NVD - CVE-2024-51551", + "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-51551" + } + ], + "remediations": [ + { + "category": "vendor_fix", + "details": "The vulnerabilities have been resolved in the following product versions:\n3.08.00 and later.", + "product_ids": [ + "CSAFPID-0005", + "CSAFPID-0017", + "CSAFPID-0011", + "CSAFPID-0023" + ] + } + ], + "scores": [ + { + "cvss_v3": { + "attackComplexity": "LOW", + "attackVector": "NETWORK", + "availabilityImpact": "HIGH", + "baseScore": 10, + "baseSeverity": "CRITICAL", + "confidentialityImpact": "HIGH", + "environmentalScore": 9, + "environmentalSeverity": "CRITICAL", + "exploitCodeMaturity": "PROOF_OF_CONCEPT", + "integrityImpact": "HIGH", + "privilegesRequired": "NONE", + "remediationLevel": "OFFICIAL_FIX", + "reportConfidence": "CONFIRMED", + "scope": "CHANGED", + "temporalScore": 9, + "temporalSeverity": "CRITICAL", + "userInteraction": "NONE", + "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H/E:P/RL:O/RC:C", + "version": "3.1" + }, + "products": [ + "CSAFPID-0005", + "CSAFPID-0017", + "CSAFPID-0011", + "CSAFPID-0023" + ] + } + ], + "title": "CVE-2024-51551" + }, + { + "cve": "CVE-2024-51554", + "cwe": { + "id": "CWE-193", + "name": "Off-by-one Error" + }, + "notes": [ + { + "category": "description", + "text": "Off By One Error vulnerabilities in ASPECT allow an array out of bounds condition in a log script. This issue affects ASPECT <= 3.08.02", + "title": "CVE description" + } + ], + "product_status": { + "fixed": [ + "CSAFPID-0002", + "CSAFPID-0008", + "CSAFPID-0014", + "CSAFPID-0020" + ], + "known_affected": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + }, + "references": [ + { + "category": "self", + "summary": "NVD - CVE-2024-51554", + "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-51554" + } + ], + "remediations": [ + { + "category": "vendor_fix", + "details": "The vulnerabilities have been resolved in the following product versions:\n3.08.03 and later.", + "product_ids": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + } + ], + "scores": [ + { + "cvss_v3": { + "attackComplexity": "LOW", + "attackVector": "NETWORK", + "availabilityImpact": "LOW", + "baseScore": 9.1, + "baseSeverity": "CRITICAL", + "confidentialityImpact": "HIGH", + "environmentalScore": 8.4, + "environmentalSeverity": "HIGH", + "exploitCodeMaturity": "FUNCTIONAL", + "integrityImpact": "LOW", + "privilegesRequired": "LOW", + "remediationLevel": "OFFICIAL_FIX", + "reportConfidence": "CONFIRMED", + "scope": "CHANGED", + "temporalScore": 8.4, + "temporalSeverity": "HIGH", + "userInteraction": "NONE", + "vectorString": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:L/A:L/E:F/RL:O/RC:C", + "version": "3.1" + }, + "products": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + } + ], + "title": "CVE-2024-51554" + }, + { + "cve": "CVE-2024-51555", + "cwe": { + "id": "CWE-1393", + "name": "Use of Default Password" + }, + "notes": [ + { + "category": "description", + "text": "Default Credentail vulnerabilities in ASPECT allows access to an Aspect device using publicly available default credentials since the system does not require the installer to change default credentials. This issue affects ASPECT<= 3.07.02", + "title": "CVE description" + } + ], + "product_status": { + "fixed": [ + "CSAFPID-0006", + "CSAFPID-0018", + "CSAFPID-0012", + "CSAFPID-0024" + ], + "known_affected": [ + "CSAFPID-0005", + "CSAFPID-0017", + "CSAFPID-0011", + "CSAFPID-0023" + ] + }, + "references": [ + { + "category": "self", + "summary": "NVD - CVE-2024-51555", + "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-51555" + } + ], + "remediations": [ + { + "category": "vendor_fix", + "details": "The vulnerabilities have been resolved in the following product versions:\n3.08.00 and later.", + "product_ids": [ + "CSAFPID-0005", + "CSAFPID-0017", + "CSAFPID-0011", + "CSAFPID-0023" + ] + } + ], + "scores": [ + { + "cvss_v3": { + "attackComplexity": "LOW", + "attackVector": "NETWORK", + "availabilityImpact": "HIGH", + "baseScore": 10, + "baseSeverity": "CRITICAL", + "confidentialityImpact": "HIGH", + "environmentalScore": 9, + "environmentalSeverity": "CRITICAL", + "exploitCodeMaturity": "PROOF_OF_CONCEPT", + "integrityImpact": "HIGH", + "privilegesRequired": "NONE", + "remediationLevel": "OFFICIAL_FIX", + "reportConfidence": "CONFIRMED", + "scope": "CHANGED", + "temporalScore": 9, + "temporalSeverity": "CRITICAL", + "userInteraction": "NONE", + "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H/E:P/RL:O/RC:C", + "version": "3.1" + }, + "products": [ + "CSAFPID-0005", + "CSAFPID-0017", + "CSAFPID-0011", + "CSAFPID-0023" + ] + } + ], + "title": "CVE-2024-51555" + }, + { + "cve": "CVE-2024-11316", + "cwe": { + "id": "CWE-770", + "name": "Allocation of Resources Without Limits or Throttling" + }, + "notes": [ + { + "category": "description", + "text": "Fileszie Check vulnerabilities in ASPECT allow a malicious user to bypass size limits or overload an Aspect device. This issue affects ASPECT<= 3.08.02", + "title": "CVE description" + } + ], + "product_status": { + "fixed": [ + "CSAFPID-0002", + "CSAFPID-0008", + "CSAFPID-0014", + "CSAFPID-0020" + ], + "known_affected": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + }, + "references": [ + { + "category": "self", + "summary": "NVD - CVE-2024-11316", + "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-11316" + } + ], + "remediations": [ + { + "category": "vendor_fix", + "details": "The vulnerabilities have been resolved in the following product versions:\n3.08.03 and later.", + "product_ids": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + } + ], + "scores": [ + { + "cvss_v3": { + "attackComplexity": "LOW", + "attackVector": "NETWORK", + "availabilityImpact": "HIGH", + "baseScore": 7.5, + "baseSeverity": "HIGH", + "confidentialityImpact": "NONE", + "environmentalScore": 7, + "environmentalSeverity": "HIGH", + "exploitCodeMaturity": "FUNCTIONAL", + "integrityImpact": "NONE", + "privilegesRequired": "NONE", + "remediationLevel": "OFFICIAL_FIX", + "reportConfidence": "CONFIRMED", + "scope": "UNCHANGED", + "temporalScore": 7, + "temporalSeverity": "HIGH", + "userInteraction": "NONE", + "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H/E:F/RL:O/RC:C", + "version": "3.1" + }, + "products": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + } + ], + "title": "CVE-2024-11316" + }, + { + "cve": "CVE-2024-11317", + "cwe": { + "id": "CWE-384", + "name": "Session Fixation" + }, + "notes": [ + { + "category": "description", + "text": "Session Fixation vulnerabilities in ASPECT allow an attacker to fix a users session identi-fier before login providing an opportunity for session takeover on an Aspect device. This issue affects ASPECT <= 3.08.02", + "title": "CVE description" + } + ], + "product_status": { + "fixed": [ + "CSAFPID-0002", + "CSAFPID-0008", + "CSAFPID-0014", + "CSAFPID-0020" + ], + "known_affected": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + }, + "references": [ + { + "category": "self", + "summary": "NVD - CVE-2024-11317", + "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-11317" + } + ], + "remediations": [ + { + "category": "vendor_fix", + "details": "The vulnerabilities have been resolved in the following product versions:\n3.08.03 and later.", + "product_ids": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + } + ], + "scores": [ + { + "cvss_v3": { + "attackComplexity": "LOW", + "attackVector": "NETWORK", + "availabilityImpact": "NONE", + "baseScore": 10, + "baseSeverity": "CRITICAL", + "confidentialityImpact": "HIGH", + "environmentalScore": 9.3, + "environmentalSeverity": "CRITICAL", + "exploitCodeMaturity": "FUNCTIONAL", + "integrityImpact": "HIGH", + "privilegesRequired": "NONE", + "remediationLevel": "OFFICIAL_FIX", + "reportConfidence": "CONFIRMED", + "scope": "CHANGED", + "temporalScore": 9.3, + "temporalSeverity": "CRITICAL", + "userInteraction": "NONE", + "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N/E:F/RL:O/RC:C", + "version": "3.1" + }, + "products": [ + "CSAFPID-0001", + "CSAFPID-0007", + "CSAFPID-0013", + "CSAFPID-0019" + ] + } + ], + "title": "CVE-2024-11317" + } + ] +} \ No newline at end of file diff --git a/tests/test_files/not-object.json b/tests/test_files/not-object.json new file mode 100644 index 0000000..491ea5e --- /dev/null +++ b/tests/test_files/not-object.json @@ -0,0 +1 @@ +This seems to be a json file but not a dictionary diff --git a/tests/test_files/test_process_csaf_file.py b/tests/test_files/test_process_csaf_file.py new file mode 100644 index 0000000..91d3528 --- /dev/null +++ b/tests/test_files/test_process_csaf_file.py @@ -0,0 +1,30 @@ + +import pandas as pd +from pathlib import Path +from process_csaf_files import process_csaf_sources +from process_csaf_files import get_csaf_sources, get_json_list +from time import perf_counter + + +if __name__ == "__main__": + """ Start from root folder with + # python3 -m tests.test_files.test_process_csaf_file + """ + start = perf_counter() + df_csaf = process_csaf_sources(get_csaf_sources( + get_json_list(Path.cwd().joinpath("tests", "test_files")))) + elapsed = perf_counter() - start + print(f"Elapsed time: {elapsed:.6f} s") + + # checks offline + df_csaf.to_csv("new.csv") + df_old = pd.read_csv(Path(__file__).resolve().parent / "old.csv") + df_new = pd.read_csv(Path(__file__).resolve().parent / "new.csv") + common_cols = df_old.columns.intersection(df_new.columns) + result = pd.concat( + [df_old[common_cols], df_new[common_cols]], + ignore_index=True + ) + print(len(result.drop_duplicates(keep=False))) + print(df_old.columns.difference(df_new.columns)) + \ No newline at end of file diff --git a/utils/configPoC.yaml b/utils/configPoC.yaml index 5ad00ac..5ec6153 100644 --- a/utils/configPoC.yaml +++ b/utils/configPoC.yaml @@ -1,17 +1,23 @@ --- logger: default: - basics: - log_file: logs/default.log - log_max_file_size: 10 MB - log_retention: 5 - log_level: INFO + sink: logs/default.log + rotation: 10 MB + retention: 5 + backtrace: False + diagnose: False + severity: 25 # up to Success log level large: - basics: - log_file: logs/default_large.log - log_max_file_size: 20 MB - log_retention: 5 - log_level: INFO - - - + sink: logs/default_large.log + rotation: 20 MB + retention: 5 + level: INFO + backtrace: False + diagnose: False + warning: + sink: logs/warning.log + rotation: 20 MB + retention: 5 + level: WARNING + backtrace: True + diagnose: False diff --git a/utils/csaf_columns.json b/utils/csaf_columns.json new file mode 100644 index 0000000..743b440 --- /dev/null +++ b/utils/csaf_columns.json @@ -0,0 +1,27 @@ +{ + "df_columns":{ + "predefined_columns": [ + "data_source", + "vendor", + "vendor_modified", + "product_family", + "product_family_modified", + "product_name", + "product_name_modified", + "function_keywords_found", + "product_version_range", + "product_version_range_modified", + "product_version", + "product_version_modified", + "full_product_names", + "full_product_name_branch", + "product_id", + "architecture", + "legacy", + "patch_level", + "service_pack", + "specification", + "csaf_document_id" + ] + } +} \ No newline at end of file diff --git a/utils/log_class.py b/utils/log_class.py index 6159a4a..5badd51 100644 --- a/utils/log_class.py +++ b/utils/log_class.py @@ -1,115 +1,62 @@ '''function for common tasks''' -import os -import glob -from typing import Optional -import yaml +from pathlib import Path from loguru import logger +import yaml +ENCODING = "utf-8" +_CONFIGURED = False +DEFAULT_CONFIG = Path(__file__).parent / "configPoC.yaml" -ENCODING = "utf-8" -class LogStyle: - """Logger for the String-Atlas repository using loguru, with readable module info.""" +def setup_logger(config_path: str = DEFAULT_CONFIG, + setting: str = "default") -> None: + """Configure Loguru once.""" + # Redundant code and yaml review TODO + global _CONFIGURED - def __init__(self, config: str = "not provided", setting: str = "default", - module_name: Optional[str] = "UNKNOWN", file_name: Optional[str] = "UNKNOWN"): - """ - Initializes Loguru logger with optional config file and a manual module name for clarity. - """ - self.module_name = module_name - self.file_name = file_name - self.logger = logger.bind(module_name=module_name, - file_name=file_name) + if _CONFIGURED: + return - if config == "not provided": - filename = "configPoC.yaml" - path = os.path.dirname(os.path.abspath(__file__)) - config_path = os.path.join(path, filename) - try: - with open(config_path, "r", encoding=ENCODING) as stream: - config_data = yaml.safe_load(stream)['logger'] - self._custom_format(config_data, setting) - except FileNotFoundError as e: - self._default() - self.logger.warning(f"{e}. Using default settings.") - except Exception as e: - self._default() - self.logger.warning(f"Unexpected error: {e}. Using default settings.") - elif not config.endswith(".yaml"): - self._default() - self.logger.info(f"No access to config file '{config}'. Using default settings.") - else: - self._custom_format(config, setting) + logger.remove() - def _default(self): - self.logger.remove() + with open(config_path, encoding=ENCODING) as f: + cfg = yaml.safe_load(f)["logger"] - self.logger.add("logs/default.log", - format="{time} {level} " - "File_name: {extra[file_name]} " - "Class: {extra[module_name]} " - "Function: {function} Line:{line}" - " {message}", - level="INFO") + log_format = ( + "{time:YYYY-MM-DD HH:mm:ss} | " + "{level:<8} | " + "{extra[module]} | " + "{extra[file]} | " + "{function}:{line} | " + "{message}" + ) - self.logger.add("logs/warning.log", - filter=lambda record: record["level"].name in ["WARNING", "ERROR"], - format=("{time} {level} " - "File_name: {extra[file_name]} " - "Class: {extra[module_name]} " - "Function:{function} Line:{line}" - " {message}")) + def severity_level_filter(number: int): + """get only logs to a certain log level.""" + def _filter(record): + return record["level"].no <= number + return _filter - def _custom_format(self, config, setting:str): - """ - Args: - loaded config file and corresponding setting in it - To prevent stdout log messages by removing existing loggers first. - Settings: - sink/destination: Location of the log file. - rotation: String representing when new file should be created. - retention: String representing when a cleanup should be started. - message: String representing the log message format. - level: String representing the lowest log level. - """ - module_config = config[setting] - base = module_config['basics'] - self.logger.remove() - self.logger.add(sink= base['log_file'], - rotation=base['log_max_file_size'], - retention=base['log_retention'], - format="{time} {level} " - "File_name: {extra[file_name]} " - "Class: {extra[module_name]} " - "Function: {function} Line:{line}" - " {message}", - level=base['log_level']) - self.logger.add( - "logs/string-atlas-warning.log", - filter=lambda record: record["level"].name in ["WARNING", "ERROR"], - rotation=base['log_max_file_size'], - retention=base['log_retention'], - format="{time} {level} " - "File_name: {extra[file_name]} " - "Class: {extra[module_name]} " - "Function: {function} Line:{line}" - " {message}", - level=base['log_level']) + Path("logs").mkdir(exist_ok=True) + logger.add(**{k: v for k, v in cfg[setting].items() if k != "severity"}, + format=log_format, + filter=severity_level_filter(cfg[setting]["severity"])) + logger.add(**cfg["warning"], format=log_format) + + _CONFIGURED = True -def log_test(module:str="unknown", filename:str = "unknown", delete:bool = False): - """Test the log function. Provide module name like __name__ and filename as - well as if the existing log files shall be removed.""" - if delete: - path = os.path.join(os.getcwd(), "logs") - log_files = glob.glob(os.path.join(path, '*.log'), recursive=True) - for log_file in log_files: - try: - os.remove(log_file) - print(f"Deleted: {log_file}") - except Exception as e: - print(f"Failed to delete {log_file}: {e}") - testlog = LogStyle(module_name=module, file_name=filename).logger - testlog.info("test") - testlog.warning("test") +def get_logger(module: str, file: str): + """Example: + from logging_utils import get_logger + + log = get_logger(__name__, __file__) + + log.info("Reading CSAF document") + """ + setup_logger() # ensure configuration is loaded + return logger.bind( + module=module, + file=Path(file).name, + )