Commit graph

14 commits

Author SHA1 Message Date
Gustavo Iñiguez Goia
b626e3fea2 bump nftables dependency version, packaging changes
- Bump nftable version to depend on latest version with fixes.
- Include opensnitch-dns.o eBPF object when creating the deb package.
- Replaced Suggests by Recommends, to install addtional but not
  essential packages (like python3-pyasnc, and others).
- Added python3-grpcio, python3-protobuf and python3-slugify as
  dependencies.
  For systems without these packages, we'll use the old debian/ dir.
2022-05-04 18:36:50 +02:00
Gustavo Iñiguez Goia
d9e0c59158
Allow to configure firewall rules from the GUI (#660)
* Allow to configure firewall rules from the GUI (WIP)

New features:
- Configure and list system firewall rules from the GUI (nftables).
- Configure chains' policies.
- Add simple rules to allow incoming ports.
- Add simple rules to exclude apps (ports) from being intercepted.

This feature is only available for nftables. iptables is still supported,
you can add rules to the configuration file and they'll be loaded, but
you can't configure them from the GUI.

More information: #592
2022-05-03 22:05:12 +02:00
Gustavo Iñiguez Goia
88b30e98d1 go.mod: updated nftables version
google/nftables removed koneu/natend lib, so we don't need it anymore.

Reported here: #623
2022-02-17 16:16:44 +01:00
Gustavo Iñiguez Goia
655f1ebe6e updated protoc command to generate the protobuffer
closes #521
2021-10-06 11:10:57 +02:00
themighty1
0776c1b895
github.com/golang/protobuf deprecated 2021-09-15 04:26:53 +00:00
Gustavo Iñiguez Goia
8d3540f7f9 added action reject
When blocking a connection via libnetfilter-queue using NF_DROP the
connection is discarded. If the blocked connection is a DNS query, the app
that initiated it will wait until it times out, which is ~30s.

This behaviour can for example cause slowdowns loading web pages: #481

This change adds the option to reject connections by killing the socket
that initiated them.

Denying:
    $ time telnet 1.1.1.1 22
    Trying 1.1.1.1...
    telnet: Unable to connect to remote host: Connection timed out

    real	2m10,039s

Rejecting:
    $ time telnet 1.1.1.1 22
    Trying 1.1.1.1...
    telnet: Unable to connect to remote host: Software caused connection abort

    real	0m0,005s
2021-09-12 10:54:24 +02:00
Gustavo Iñiguez Goia
da23c827f7 added nftables support
Added basic nftables support, which adds the needed rules to intercept
outgoing network traffic and DNS responses. System rules will be added
soon.

What netfilter subsystem to use is determined based on the following:
- nftables: if the _iptables_ binary is not present in the system, or
  if the iptables version (iptables -V) is
  "iptables vX.Y.Z (nf_tables)".
- iptables: in the rest of the cases.
2021-06-07 01:32:05 +02:00
Arnout Engelen
356428b6c9
Add gobpf to go.mod
gobpf was introduced in #397 but not added to go.mod yet
2021-05-19 21:21:27 +02:00
Arnout Engelen
1f26f66e8a
Support more recent protoc-gen-go
When building the project with protoc-gen-go version 1.5.1,
it fails with the following:

```
protoc -I. ui.proto --go_out=plugins=grpc:../daemon/ui/protocol/
protoc-gen-go: unable to determine Go import path for "ui.proto"

Please specify either:
	• a "go_package" option in the .proto source file, or
	• a "M" argument on the command line.

See https://developers.google.com/protocol-buffers/docs/reference/go-generated#package for more information.

--go_out: protoc-gen-go: Plugin failed with status code 1.
```

This can be fixed by adding the full go package as an option in the
proto file. To make sure the code is generated to the correct path,
we also have to add add the `paths=source_relative` option to the
protoc plugin.

After this, the code is generated correctly, but the generated code
references classes like grpc.ClientConnInterface which were introduced
in 1.27.0.
2021-03-28 16:38:21 +02:00
Gustavo Iñiguez Goia
e13015ce67 updated import paths 2020-12-09 18:18:42 +01:00
NP-Hardass
08abdd0950 go.mod: add netns as indirect dependency for netlink 2020-09-08 17:07:28 -04:00
Gustavo Iñiguez Goia
c0fb84a0e3 changed go.mod to not depend on a fixed release 2020-07-17 02:03:03 +02:00
Raphael
ffbb138bd6 equip go.mod file with packages 2020-07-16 23:06:32 +02:00
Raphael
563247a87c add go.mod and remove old Gopkg.lock 2020-07-16 23:05:25 +02:00