Skip to content

Commit 0d8da1c

Browse files
authored
Merge pull request CactuseSecurity#3103 from tpurschke/cactus-develop
adding csv appdata import stats
2 parents 0c8de8a + 73f2d6c commit 0d8da1c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

scripts/customizing/modelling/getOwnersFromCsvWithoutUsers.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,4 +234,17 @@ def extractAppDataFromCsvFile(csvFile: str, appData: dict, containsIp: bool):
234234
fileOut = path + '/' + Path(os.path.basename(__file__)).stem + ".json"
235235
with open(fileOut, "w") as outFH:
236236
json.dump(appData, outFH, indent=3)
237+
238+
#############################################
239+
# 4. Some statistics
240+
logger.info(f"total #apps: {str(len(appData))}")
241+
appsWithIp = 0
242+
for appId in appData:
243+
appsWithIp += 1 if len(appData[appId]['app_servers']) > 0 else 0
244+
logger.info(f"#apps with ip addresses: {str(appsWithIp)}")
245+
totalIps = 0
246+
for appId in appData:
247+
totalIps += len(appData[appId]['app_servers'])
248+
logger.info(f"#ip addresses in total: {str(totalIps)}")
249+
237250
sys.exit(0)

0 commit comments

Comments
 (0)