Add cli/srv location to flow alerts

This commit is contained in:
Alfredo Cardigliano 2022-06-09 10:40:33 +02:00
parent bbbf44bf75
commit f633292e83
3 changed files with 33 additions and 0 deletions

View file

@ -321,6 +321,16 @@ tag_utils.defined_tags = {
i18n_label = i18n('db_search.tags.confidence'),
operators = {'eq', 'neq'},
},
cli_location = {
value_type = 'location',
i18n_label = i18n('db_search.tags.cli_location'),
operators = {'eq', 'neq'},
},
srv_location = {
value_type = 'location',
i18n_label = i18n('db_search.tags.srv_location'),
operators = {'eq', 'neq'},
},
}
-- #####################################
@ -341,6 +351,14 @@ tag_utils.confidence = {
-- #####################################
tag_utils.location = {
{ label = i18n("details.label_short_remote"), id = 0 },
{ label = i18n("details.label_short_local_host"), id = 1 },
{ label = i18n("short_multicast"), id = 2 },
}
-- #####################################
function tag_utils.build_request_filter(key, op, value)
return key .. '=' .. value .. tag_utils.SEPARATOR .. op
end
@ -528,6 +546,13 @@ function tag_utils.get_tag_info(id, entity)
filter.options[#filter.options+1] = { value = v.id, label = v.label }
end
elseif tag.value_type == "location" then
filter.value_type = 'array'
filter.options = {}
for _, v in pairsByField(tag_utils.location, 'label', asc) do
filter.options[#filter.options+1] = { value = v.id, label = v.label }
end
elseif tag.value_type == "l4_proto" then
filter.value_type = 'array'
filter.options = {}