def create_network_connection_closed_observable(ct): obj = NetworkConnection() obj.creation_time = d[ct]['timestamp'] sock = SocketAddress() sock.ip_address = d[ct]['src_ip'] obj.source_socket_address = sock obj.custom_properties = CustomProperties() create_custom_properties(obj, "Event_Name", d[ct]['eventid']) create_custom_properties(obj, "Message", d[ct]['message']) create_custom_properties(obj, "Service", d[ct]['system']) create_custom_properties(obj, "Host", d[ct]['sensor']) create_custom_properties(obj, "session_Duration", d[ct]['duration']) return obj
def create_network_connection(self,creation_time=None,destination_socket_address=None,destination_tcp_state=None,source_socket_address=None,source_tcp_state=None,tls_used=None, layer7_protocol=None,layer4_protocol=None,layer3_protocol=None,layer7_connections=None): network_connection = NetworkConnection() network_connection.creation_time= DateTime(creation_time) network_connection.destination_socket_address = destination_socket_address network_connection.destination_tcp_state = destination_tcp_state network_connection.source_socket_address = source_socket_address network_connection.source_tcp_state = source_tcp_state network_connection.tls_used =tls_used network_connection.layer7_protocol= layer7_protocol network_connection.layer4_protocol =layer4_protocol network_connection.layer3_protocol = layer3_protocol network_connection.layer7_connections = layer7_connections return network_connection
def create_network_connection_observable(ct): obj = NetworkConnection() obj.creation_time = d[ct]['timestamp'] obj.layer7_protocol = d[ct]['protocol'] # src_info obj.source_socket_address = create_socket_address(d[ct]['src_ip'], d[ct]['src_port']) # dst_info obj.destination_socket_address = create_socket_address( d[ct]['dst_ip'], d[ct]['dst_port']) #create_custom_properties obj.custom_properties = CustomProperties() create_custom_properties(obj, "Event_Name", d[ct]['eventid']) create_custom_properties(obj, "Message", d[ct]['message']) create_custom_properties(obj, "Service", d[ct]['system']) create_custom_properties(obj, "Host", d[ct]['sensor']) return obj