From 4ff3b85c1c68d3791e8540b8681749b288c92d1f Mon Sep 17 00:00:00 2001 From: Jonathan Branan Date: Thu, 15 Aug 2024 16:41:21 -0500 Subject: [PATCH] Updated data models --- inexDataModel.py | 26 +++++++++++++++++++++----- inexDataProcessing.py | 3 ++- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/inexDataModel.py b/inexDataModel.py index cda60bb..c42f408 100644 --- a/inexDataModel.py +++ b/inexDataModel.py @@ -14,7 +14,8 @@ def dataTemplate(transactionType,**kwargs): "name": kwargs.get('file_name'), "path": kwargs.get('file_path') }, - "guid": kwargs.get('guid'), + # upload/download:guid needed, figure out how to do this + "guid": f'{transactionType}:{kwargs.get("guid")}', "node_name": kwargs.get('node_name'), "prd_ext_tenant_id": kwargs.get('prd_ext_tenant_id'), "product_name": "GlobalScape EFT", @@ -51,9 +52,11 @@ def dataTemplate(transactionType,**kwargs): "file": { "size": kwargs.get('file_size'), "name": kwargs.get('file_name'), - "path": kwargs.get('file_path') + "path": kwargs.get('file_path'), + "uid": kwargs.get('file_uid'), }, - "guid": kwargs.get('guid'), + "guid": f'deleted:{kwargs.get("guid")}', + "node_name": kwargs.get('node_name'), "classifications": [{ "ref_id": f"globalscape:{kwargs.get('guid')}", "time": kwargs.get('time'), @@ -70,15 +73,19 @@ def dataTemplate(transactionType,**kwargs): "ip": kwargs.get('src_endpoint_ip'), "type": kwargs.get('src_endpoint_type') }, + "tenant": kwargs.get('tenant'), + "tenant_name":"GlobalScape", "dst_endpoint": { "port": kwargs.get('dst_endpoint_port'), "ip": kwargs.get('dst_endpoint_ip'), "type": kwargs.get('dst_endpoint_type') }, "time": kwargs.get('time'), + "status_code": kwargs.get('status_code'), + "status_detail": kwargs.get('description'), "user": { "home_directory": kwargs.get('user_home_directory'), - "uuid": kwargs.get('guid'), + "uuid": kwargs.get('session_uid'), "uid": kwargs.get('uid'), "type": kwargs.get('user_type'), "name": kwargs.get('user_name') @@ -97,9 +104,14 @@ def dataTemplate(transactionType,**kwargs): "type": kwargs.get('dst_endpoint_type') }, "guid": kwargs.get('guid'), + "node_name": kwargs.get('node_name'), + "tenant": kwargs.get('tenant'), + "tenant_name":"GlobalScape", "prd_ext_tenant_id": kwargs.get('prd_ext_tenant_id'), "product_name": "GlobalScape EFT", "prd_ext_tenant_name": "GlobalScape EFT", + "status_code": kwargs.get('status_code'), + "status_detail": kwargs.get('description'), "src_endpoint": { "port": kwargs.get('src_endpoint_port'), "ip": kwargs.get('src_endpoint_ip'), @@ -108,11 +120,15 @@ def dataTemplate(transactionType,**kwargs): "time": kwargs.get('time'), "user": { "home_directory": kwargs.get('user_home_directory'), - "uuid": kwargs.get('guid'), + "uuid": kwargs.get('session_uid'), "uid": kwargs.get('uid'), "type": kwargs.get('user_type'), "name": kwargs.get('user_name') }, + "session": { + "created_time": kwargs.get('time'), + "uid": kwargs.get('session_uid') + }, "utype": kwargs.get('utype') } diff --git a/inexDataProcessing.py b/inexDataProcessing.py index 600b2b1..f275ff9 100644 --- a/inexDataProcessing.py +++ b/inexDataProcessing.py @@ -14,6 +14,7 @@ def processData(data, template, **kwargs): try: processedData.append(template(identifyUtype(row.get('Command')),\ status_detail='',\ + # this should be taken from self.platformConfig prd_ext_tenant_id=kwargs.get('prd_ext_tenant_id'),\ status_code=row.get('ResultID'),\ file_size=row.get('FileSize'),\ @@ -21,7 +22,7 @@ def processData(data, template, **kwargs): file_virtual_path=row.get('VirtualFolderName'),\ file_name=row.get('FileName'),\ guid=row.get('TransactionGUID'),\ - ref_id=row.get('ProtocolCommandID'),\ + ref_id=row.get('TransactionGUID'),\ prd_instance_id=kwargs.get('prd_instance_id'),\ product_guid=kwargs.get('product_guid'),\ product_name=kwargs.get('product_name'),\