Commit graph

534 commits

Author SHA1 Message Date
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
3c500a9314 Update issue templates 2020-03-09 19:32:21 +01:00
Gustavo Iñiguez Goia
27778c1fd6 Bump version to v1.0.0rc6 2020-03-08 20:59:57 +01:00
Gustavo Iñiguez Goia
c21e552e28 deb packages: distribute default daemon configuration 2020-03-08 20:28:24 +01:00
Gustavo Iñiguez Goia
6ebd6cca99 added a default configuration file
Some people has asked where they can change the daemon configuration.

As we can't change it from the GUI yet, and we're providing deb
packages, we need to distribute a default config.

That way the users will see it and will be able to customize it.
2020-03-08 20:25:05 +01:00
Gustavo Iñiguez Goia
8194199955 Merge branch 'ui2.0': workaround for cinnamon systray icon 2020-03-08 01:10:53 +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
99b024e0de dns sources formatted and documented 2020-03-07 10:23:53 +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
ef04667cdb cache of pids: insert new processes at the top of the list
code formatted and documented a little bit.
2020-03-06 23:23:16 +01:00
Gustavo Iñiguez Goia
1c04e95fdc audit: search for a process using the ppid
auditd events provides the parent pid of a process which has created
a connection. If we don't find the socket inode under the pid of the
process, use the ppid.

This is normally the case when systemd-* spawns a new process which
creates a new connection.
2020-03-06 23:21:24 +01:00
Gustavo Iñiguez Goia
9e6860fe63 formatted connman/ 2020-03-06 21:44:47 +01:00
Gustavo Iñiguez Goia
6e3336258c firewall/rules.go formatted and documented. 2020-03-06 21:28:22 +01:00
Gustavo Iñiguez Goia
7cbcc4d736 reformatted netlink/ sources, fixed typo 2020-03-06 21:02:34 +01:00
Gustavo Iñiguez Goia
63b6ba6f94 added description for netlink/GetSocketInfo 2020-03-06 20:32:19 +01:00
Gustavo Iñiguez Goia
2137a395d1 audit: Fixed 32bits socket monitoring. 2020-03-05 20:57:37 +01:00
Gustavo Iñiguez Goia
461118e321 replace ReplaceAll() by Replace() to compile with go <= 11 2020-03-05 19:39:35 +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
db22e83de1 pids cache: delete from cache non existent PIDs 2020-03-04 01:56:48 +01:00
Gustavo Iñiguez Goia
7ef15faf62 cache of known pids: update lastSeen field when we have a match 2020-03-04 01:31:36 +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
Gustavo Iñiguez Goia
4407b82346 deb package: added logrotate file, lower daemon log level
Added a logrotate file to limit the size of the log and rotate as
needeed.
Changed daemon log level to important.
2020-03-01 00:40:58 +01:00
Gustavo Iñiguez Goia
6a82cdbac1 Allow to select which log level to use
Let the user choose which level log to use. For now it must be set
manually and when starting the daemon.
2020-02-28 10:24:08 +01:00
Gustavo Iñiguez Goia
c5a3fb5132 Allow to select what process search method to use
Until now OpenSnitch used ftrace(debugfs) to search for running
processes (PIDs) and obtain the process path.

On some systems, this filesystem is not mounted or available, so we have
to rely on /proc.

After several weeks of use, I think that it's faster and more accurate
the 2nd method, search pids/cmdlines in /proc. So we offer the user to
choose which one to use.
2020-02-26 19:13:42 +01:00
Gustavo Iñiguez Goia
fe8789526a Apply default action in case of communication failure with the server
If we can't communicate with the server (UI), apply the default
configured action. For example, if the UI is doing too much work and it
reaches the timeout, or if there's a programming error (python exception
for instance).
2020-02-26 09:53:48 +01:00
Gustavo Iñiguez Goia
802c19fc0d Workaround to show up the systray icon on Cinnamon
On Linux Mint 19.3, Cinnamon 4.4, the systray icon was not showing up.
Adding a delay of ~3s solves this problem.
2020-02-26 00:55:01 +01:00
Gustavo Iñiguez Goia
f296e0b72f added more screenshots 2020-02-25 22:39:32 +01:00
Gustavo Iñiguez Goia
aaf4c449a0 Updated github action build name 2020-02-25 22:23:09 +01:00
Gustavo Iñiguez Goia
331b40570b
Update README.md 2020-02-25 01:52:37 +01:00
Gustavo Iñiguez Goia
9ff47bda54
Update README.md 2020-02-25 01:52:01 +01:00
Gustavo Iñiguez Goia
9d0f7c27ca
Update go.yml 2020-02-25 01:41:18 +01:00
Gustavo Iñiguez Goia
aad5eb8a48
Update go.yml 2020-02-25 01:39:24 +01:00
Gustavo Iñiguez Goia
e617dd834f
Update go.yml 2020-02-25 01:36:04 +01:00
Gustavo Iñiguez Goia
de956b1bf4 Fixed DNS responses firewall rule not deleted on exit
Sometimes the INPUT rule for to queue DNS responses was not deleted.
The code has also been reorganized.

And a minor tweak to make an if{} more idiomatic.
2020-02-25 01:30:24 +01:00
Gustavo Iñiguez Goia
2a85a27685
Update go.yml 2020-02-25 00:26:50 +01:00
Gustavo Iñiguez Goia
7cb0a25119 Bump version to v1.0.0rc5 2020-02-24 20:07:22 +01:00
Gustavo Iñiguez Goia
4abe3ee4cc
Update go.yml 2020-02-24 20:03:04 +01:00
Gustavo Iñiguez Goia
2b1cfcd6ef Merged UI fixes. 2020-02-24 20:00:33 +01:00
Gustavo Iñiguez Goia
a34f215252 UI deb package: added qt sqlite lib dependency
On LinuxMint 19.3 it was not installed as part of the other packages,
so the UI couldn't load the driver.
2020-02-24 19:53:08 +01:00
Gustavo Iñiguez Goia
4479bb5155 UI: exit cleanly if there's no QtSql driver available 2020-02-24 19:39:34 +01:00
Gustavo Iñiguez Goia
be89865cd1 fixed UI autostart on Cinnamon 2020-02-24 10:18:44 +01:00
Gustavo Iñiguez Goia
d3eadd0edf
Update README.md 2020-02-23 23:02:33 +01:00
Gustavo Iñiguez Goia
13f4670be0
Update README.md 2020-02-23 23:01:45 +01:00
Gustavo Iñiguez Goia
f114439dba
Update go.yml 2020-02-23 16:16:17 +01:00
Gustavo Iñiguez Goia
8719286853
Update go.yml 2020-02-23 16:11:58 +01:00
Gustavo Iñiguez Goia
ceb5290b13
Create go.yml 2020-02-23 08:52:48 +01:00
Gustavo Iñiguez Goia
cad5339695 Fixed typo in ui/debian/postinst 2020-02-23 01:17:39 +01:00
Gustavo Iñiguez Goia
0f171f87d4 UI deb package improvements
* Purge files when using apt remove --purge
* Display a message to uninstall installed pkgs from pypi when invoking
apt remove
* link autostart .desktop file to /usr/share/applications instead of
copying it
2020-02-22 17:22:28 +01:00
Gustavo Iñiguez Goia
e3b0287e2e Merge UI fixes and enhancements from ui2.0 2020-02-22 01:00:24 +01:00