Skip to content

Commit

Permalink
Fixes NAT fields search
Browse files Browse the repository at this point in the history
  • Loading branch information
MatteoBiscosi committed May 10, 2024
1 parent 9613ea6 commit 6897a01
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/lua/modules/historical_flow_utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1059,13 +1059,13 @@ local flow_columns = {
['DST_PROC_USER_NAME'] = { tag = "srv_user_name", db_type = "String", db_raw_type = "String" },
['MAJOR_CONNECTION_STATE'] = { tag = "major_connection_state", dt_func = dt_format_major_connection_state, db_type = "Number", db_raw_type = "Uint8" },
['MINOR_CONNECTION_STATE'] = { tag = "minor_connection_state", dt_func = dt_format_minor_connection_state, db_type = "Number", db_raw_type = "Uint8" },
['PRE_NAT_IPV4_SRC_ADDR'] = { tag = "pre_nat_ipv4_src_addr", dt_func = dt_format_ip, select_func = "IPv4NumToString", where_func = "IPv4StringToNum", simple_dt_func = simple_format_src_ip, db_type = "Number", db_raw_type = "Uint32" },
['PRE_NAT_IPV4_SRC_ADDR'] = { tag = "pre_nat_ipv4_src_addr", dt_func = dt_format_ip, select_func = "IPv4NumToString", db_type = "Number", db_raw_type = "Uint32" },
['PRE_NAT_SRC_PORT'] = { tag = "pre_nat_src_port", dt_func = dt_format_port, db_type = "Number", db_raw_type = "Uint16" },
['PRE_NAT_IPV4_DST_ADDR'] = { tag = "pre_nat_ipv4_dst_addr", dt_func = dt_format_ip, select_func = "IPv4NumToString", where_func = "IPv4StringToNum", simple_dt_func = simple_format_src_ip, db_type = "Number", db_raw_type = "Uint32" },
['PRE_NAT_IPV4_DST_ADDR'] = { tag = "pre_nat_ipv4_dst_addr", dt_func = dt_format_ip, select_func = "IPv4NumToString", db_type = "Number", db_raw_type = "Uint32" },
['PRE_NAT_DST_PORT'] = { tag = "pre_nat_dst_port", dt_func = dt_format_port, db_type = "Number", db_raw_type = "Uint16" },
['POST_NAT_IPV4_SRC_ADDR'] = { tag = "post_nat_ipv4_src_addr", dt_func = dt_format_ip, select_func = "IPv4NumToString", where_func = "IPv4StringToNum", simple_dt_func = simple_format_src_ip, db_type = "Number", db_raw_type = "Uint32" },
['POST_NAT_IPV4_SRC_ADDR'] = { tag = "post_nat_ipv4_src_addr", dt_func = dt_format_ip, select_func = "IPv4NumToString", db_type = "Number", db_raw_type = "Uint32" },
['POST_NAT_SRC_PORT'] = { tag = "post_nat_src_port", dt_func = dt_format_port, db_type = "Number", db_raw_type = "Uint16" },
['POST_NAT_IPV4_DST_ADDR'] = { tag = "post_nat_ipv4_dst_addr", dt_func = dt_format_ip, select_func = "IPv4NumToString", where_func = "IPv4StringToNum", simple_dt_func = simple_format_src_ip, db_type = "Number", db_raw_type = "Uint32" },
['POST_NAT_IPV4_DST_ADDR'] = { tag = "post_nat_ipv4_dst_addr", dt_func = dt_format_ip, select_func = "IPv4NumToString", db_type = "Number", db_raw_type = "Uint32" },
['POST_NAT_DST_PORT'] = { tag = "post_nat_dst_port", dt_func = dt_format_port, db_type = "Number", db_raw_type = "Uint16" },
--[[ TODO: this column is for the aggregated_flow_columns but the parsing Function
Expand Down
20 changes: 20 additions & 0 deletions scripts/lua/modules/tag_utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,26 @@ tag_utils.defined_tags = {
i18n_label = i18n("db_search.tags.post_nat_ipv4_dst_addr"),
operators = {'eq', 'neq'}
},
pre_nat_src_port = {
value_type = 'port',
i18n_label = i18n("db_search.tags.pre_nat_src_port"),
operators = {'eq', 'neq'}
},
pre_nat_dst_port = {
value_type = 'port',
i18n_label = i18n("db_search.tags.pre_nat_dst_port"),
operators = {'eq', 'neq'}
},
post_nat_src_port = {
value_type = 'port',
i18n_label = i18n("db_search.tags.post_nat_src_port"),
operators = {'eq', 'neq'}
},
post_nat_dst_port = {
value_type = 'port',
i18n_label = i18n("db_search.tags.post_nat_dst_port"),
operators = {'eq', 'neq'}
},
description = {
value_type = 'text',
i18n_label = i18n('db_search.tags.alert_description'),
Expand Down

0 comments on commit 6897a01

Please sign in to comment.