Commit graph

19 commits

Author SHA1 Message Date
Gustavo Iñiguez Goia
e2be2b769a improved monitor method switching (audit)
when switching from audit to another one.
2021-03-30 01:13:02 +02:00
themighty1
41172b65e5 minor fixes to prevent go vet from complaining 2021-02-13 19:18:38 +03:00
Gustavo Iñiguez Goia
e13015ce67 updated import paths 2020-12-09 18:18:42 +01:00
Gustavo Iñiguez Goia
ac9fc47d9a auditd: don't parse proctitle field, use cmdline instead
auditd proctitle field sems to be trunctated to 128 characters, which
causes in some situations to not obtain the complete command line.
2020-12-07 13:01:10 +01:00
Gustavo Iñiguez Goia
99afc6cccb audit: stop reading messages when calling Stop() 2020-11-22 13:31:10 +01:00
Gustavo Iñiguez Goia
26ca52d127 audit: schedule deletion of old events
Instead of check for old events every time we add a new one, do it every
5 minutes.

This improves the performance significantly.
2020-11-22 01:00:43 +01:00
Gustavo Iñiguez Goia
1e069a6fec audit: be more verbose on errors 2020-10-24 19:49:16 +02:00
Gustavo Iñiguez Goia
cc75289202 fixed typo in audit description
spotted by @themighty1
2020-10-21 00:06:53 +02:00
Gustavo Iñiguez Goia
3853d412b4 audit: better rules deletion
if the daemon does not exit cleanly, the rules were not cleaned
correctly.
2020-07-03 08:28:33 +02:00
Gustavo Iñiguez Goia
6ee80b1640 Allow to change settings from the UI
(1/2)
We start receiving notifications from the UI, which allow us to change
configurations and perform actions on the daemon.

The concept of Node has also been introduced, which identifies every
daemon (client) connected to the UI (server).

These options has been added:
- Enable/Disable firewall interception (for all nodes)
- Change daemons (clients) configuration. globally or per node.
- Change prompt dialog options.

We have fixed some bugs along the way:
- Close audit client connection gracefully.
- Exclude our own connections from being intercepted.
- Better handling of client connection status with the UI.

We probably has also introduced some other bugs (not listed here).
2020-04-19 20:13:31 +02:00
Gustavo Iñiguez Goia
c51d9542ae audit: avoid to overwrite cmdline of new events
when an audit msg of type !SYSCALL is added, the cmdline field may be
empty, and thus cause to loose the original proc cmdline.
2020-04-12 12:31:59 +02:00
Gustavo Iñiguez Goia
0c6836539e audit: code reformatted, ALL_CAPS to mixedCaps
Also do not filter sockets by code, nor by pid/ppid (for now at least).
2020-03-10 10:16:32 +01:00
Gustavo Iñiguez Goia
eb52af72e5 audit: exclude events from our pid at rule level
Do not exclude them by code, just don't receive them.
2020-03-09 19:51:06 +01:00
Gustavo Iñiguez Goia
0fb23bb588 audit: avoid to alloc unused map, reformatted code 2020-03-08 01:09:47 +01:00
Gustavo Iñiguez Goia
a3422e493b audit: sort events after update the cache 2020-03-07 00:57:43 +01:00
Gustavo Iñiguez Goia
ba770fdf0d audit: insert new processes at the top of the list.
And avoid to sort the list of known processes every time we add a new
one.

Code formatted and documented.
2020-03-07 00:23:33 +01:00
Gustavo Iñiguez Goia
2137a395d1 audit: Fixed 32bits socket monitoring. 2020-03-05 20:57:37 +01:00
Gustavo Iñiguez Goia
010a657f64 audit: get rid of mozilla/libaudit-go
mozilla/libaudit-go does not support i386/arm/etc, and we were using it
only for parsing audit messages.

So do not use it and parse raw messages directly. WIP.
2020-03-05 01:54:27 +01:00
Gustavo Iñiguez Goia
3d6beb5ec3 Added new processes monitor method: audit
Use auditd events to keep a list of PIDs which open sockets, reading
them from the audisp af_unix plugin.

- Install auditd and audisp-plugins
- Enable the af_unix plugin (/etc/audisp-plugin/af_unix, active = yes)
- Start opensnitch with -process-monitor-method audit.

If the choosen method is audit but it's not active or not installed,
it'll fallback to /proc anyway.

If it's properly configured, a debug trace will be written to the logs:
"PID found via audit events ..."
2020-03-03 23:51:25 +01:00