-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Netstat changes not showing previous output on JSON logs #1180
Comments
I don't know how it's supposed to be handled in the json log. It might just be a limited space issue. You could try to find any differences in what is written in the alerts.log file and compare it to what's written in the alerts.json file. Maybe something is left out in the case of the netstat command. |
I should've done that already, my bad. Original .log (it also seems to be trimmed, running netstat on the server gives me more than 20 lines, while this one has 14, and the last line is not even complete)
JSON log:
Both logs are clearly different and both are being trimmed. I'm using JSON logs because they're easier to parse, and it would help a lot if I had the full output. Is there any configurable variable that defines the character limit or something along those lines? |
They all get trimmed a bit. There are hard coded buffer sizes in the code. You'd have to modify them. |
Yeah I just found issue #473 I will play around with the limits on src/analysisd/alerts/log.c and see what I can achieve. |
The limits are fine for me, since they don't affect the JSON output. What's really missing is just the previous output, since the full_log contains all of my netstat output Trying to fix this with #1184 |
I'm using OSSEC with JSON logs, and whenever I google OSSEC's netstat changes, I always see log examples followed by the previous netstat output, which makes total sense so we can know exactly what ports were opened/closed.
I'm not seeing that previous output on the JSON logs, is this intended?
{"rule":{"level":7,"comment":"Listened ports status (netstat) changed (new port opened or closed).","sidid":533,"group":"ossec,"},"id":"1499219780.484842","TimeStamp":1499219780000,"decoder":"ossec","location":"(xxx.xxx.xxx.xxx) 10.66.0.12->netstat -tan |grep LISTEN |grep -v 127.0.0.1 | sort","full_log":"ossec: output: 'netstat -tan |grep LISTEN |grep -v 127.0.0.1 | sort':\ntcp 0 0 0.0.0.0:110 0.0.0.0:* LISTEN \ntcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN \ntcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN \ntcp 0 0 0.0.0.0:2049 0.0.0.0:* LISTEN \ntcp 0 0 0.0.0.0:993 0.0.0.0:* LISTEN \ntcp 0 0 0.0.0.0:995 0.0.0.0:* LISTEN \ntcp 0 0 :::111 :::* LISTEN \ntcp 0 0 :::2049 :::* LISTEN \ntcp 0 0 :::22 :::* LISTEN \ntcp 0 0 :::45720 :::* LISTEN \ntcp 0 0 :::54242 :::* LISTEN \ntcp 0 0 :::5666 :::* LISTEN ","hostname":"(xxx.xxx.xxx.xxx) 10.66.0.12->netstat -tan |grep LISTEN |grep -v 127.0.0.1 | sort"}
The text was updated successfully, but these errors were encountered: