Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

following issue : trying to use sqlite filter #209 #215

Closed
yaniv999 opened this issue May 29, 2024 · 3 comments
Closed

following issue : trying to use sqlite filter #209 #215

yaniv999 opened this issue May 29, 2024 · 3 comments

Comments

@yaniv999
Copy link

yaniv999 commented May 29, 2024

Hello,

I'm trying to use sqlite to add the service name according to the Destination port.
the problem is that it looks like the system takes the port number from the first packet and don't update it.

in this example from the log, even though ports are changing all the time the port remains 443

image

pastash config:

sqlite {
db => '/home/******/userdata_qa.db'
query => 'SELECT service_name from port_list WHERE port_number=(?) limit 1;'
source_field => 'l4_dst_port'
target_field => 'service'
}

sqlite config

sqlite> PRAGMA table_info(port_list);
0|id|INTEGER|0||1
1|port_number|long|0||0
2|service|TEXT|1||0

sqlite> SELECT * from port_list;
1|80|http
2|53|dns
3|123|ntp
4|80|http
5|443|https
6|1194|ovpn
7|8883|mqtt

@lmangani
Copy link
Member

With a list so small this sounds like an overkill job for a DB when it can be done much faster from memory.
Try this plugin out: https://github.com/sipcapture/paStash/tree/next/plugins/filters/ip_proto

@Alisher-Nabiev
Copy link

we are attempting to use an SQLite filter to capture incoming IP addresses in the index and then add a name to each IP address from the database.

the DB needs to be updated frequently if new name for the ips.

do we need to use the same method as we try here with ports?

@yaniv999

@lmangani
Copy link
Member

lmangani commented Jul 3, 2024

@Alisher-Nabiev this sounds like a different topic. If the protocol matching works and this is a second chapter please open a dedicated issue to avoid confusion. Perhaps you should simply use reverse DNS for this task.

@lmangani lmangani closed this as completed Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants