Commit Graph

1142 Commits

Author SHA1 Message Date
Stefan Schantl
51b63b4186 IDS: Allow to inspect traffic from or to OpenVPN
This commit allows to configure suricata to monitor traffic from or to
OpenVPN tunnels. This includes the RW server and all established N2N
connections.

Because the RW server and/or each N2N connection uses it's own tun?
device, it is only possible to enable monitoring all of them or to disable
monitoring entirely.

Fixes #12111.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2019-12-29 19:12:06 +00:00
Michael Tremer
d7190078ce unbound: Configure Safe Search dynamically
The safe search code relied on working DNS resolution, but
was executed before unbound was even started and no network
was brought up.

That resulted in no records being created and nothing being
filtered.

This will now set/reset safe search when the system connects
to the Internet.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2019-12-29 08:51:21 +00:00
Arne Fitzenreiter
dd12d8c54c leds: use new APUx ACPI Bios leds if exist.
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2019-12-09 14:50:44 +01:00
Arne Fitzenreiter
bedfda83c9 dhcpcd.exe: remove red.down run on "NOCARRIER"
after "NOCARRIER" the dhcp client always run "EXPIRE" event.

Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2019-12-01 18:33:19 +01:00
Arne Fitzenreiter
941520c69c Merge branch 'next' of git.ipfire.org:/pub/git/ipfire-2.x into next 2019-12-01 16:36:43 +01:00
Arne Fitzenreiter
d346d47467 up/down beep: move from ppp ip-up/down to general red.up/down
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2019-12-01 15:29:59 +01:00
Arne Fitzenreiter
455291f90e 70-dhcpdd.exe: don't run red.down scripts at "PREINIT"
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2019-12-01 14:43:49 +01:00
Arne Fitzenreiter
fff96e3945 networking red: add delay to wait for carrier
some nic's need some time after link up to get a carrier

Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2019-11-30 22:26:00 +01:00
Arne Fitzenreiter
f938083fb5 dhcpcd: 10-mtu break if carrier was lost
some nic's like Intel e1000e needs a reinit to change the
mtu. In this case the dhcp hook reinit the nic and terminate now
to let the dhcpcd reinit the card in backgrounnd without running the
rest of the hooks.

Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2019-11-30 22:21:42 +01:00
Stefan Schantl
c8b068a2b5 red.up: Generate Suricata DNS servers file on reconnect.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2019-11-13 19:14:20 +00:00
Michael Tremer
cdf373c8fc unbound: Fix whitespace error in initscript
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2019-11-13 18:53:50 +00:00
Michael Tremer
31a36bb951 initscripts: Tell users to report bugs on Bugzilla
I have been receiving a couple of emails recently directed
at info@ipfire.org with bug reports when a system did not
boot up or shut down properly.

This is obviously not the right way to report bugs, but
we are telling our users to do so.

This patch changes this to report bugs to Bugzilla like
it should be.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2019-11-13 18:47:38 +00:00
Arne Fitzenreiter
be967dc920 Revert "firewall: always allow outgoing DNS traffic to root servers"
This reverts commit 70cd5c42f0.

Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2019-10-18 16:13:49 +02:00
Michael Tremer
a3f4b8c6f7 99-geoip-database: Fix download
This script started a fresh download every time it was called,
which is unnecessary.

The check to skip the download did not work because it was
looking for the old data format.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2019-10-14 17:47:31 +00:00
peter.mueller@ipfire.org
41fe437400 fix typo in hostapd initscript
Fixes: #11237

Reported-by: Tom Rymes <tomvend@rymes.com>
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2019-10-14 17:40:25 +00:00
peter.mueller@ipfire.org
70cd5c42f0 firewall: always allow outgoing DNS traffic to root servers
Allowing outgoing DNS traffic (destination port 53, both TCP
and UDP) to the root servers is BCP for some reasons. First,
RFC 5011 assumes resolvers are able to fetch new trust ancors
from the root servers for a certain time period in order to
do key rollovers.

Second, Unbound shows some side effects if it cannot do trust
anchor signaling (see RFC 8145) or fetch the current trust anchor,
resulting in SERVFAILs for arbitrary requests a few minutes.

There is little security implication of allowing DNS traffic
to the root servers: An attacker might abuse this for exfiltrating
data via DNS queries, but is unable to infiltrate data unless
he gains control over at least one root server instance. If
there is no firewall ruleset in place which prohibits any other
DNS traffic than to chosen DNS servers, this patch will not
have security implications at all.

The second version of this patch does not use unnecessary xargs-
call nor changes anything else not related to this issue.

Fixes #12183

Cc: Michael Tremer <michael.tremer@ipfire.org>
Suggested-by: Horace Michael <horace.michael@gmx.com>
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Acked-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2019-10-08 18:48:40 +00:00
Michael Tremer
974d86532f unbound: Add option to force using TCP for upstream servers
Some users have problems to reach DNS servers. This change adds an option
which allows to force using TCP for upstream name servers.

This is a good workaround for users behind a broken Fritz!Box in modem
mode which does not allow resolving any records of the root zone.

The name server tests in the script will also only use TCP.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2019-10-08 18:42:18 +00:00
Michael Tremer
1ad45a5a09 sane: Update to 1.0.28
This patch updates the package and removes the sanedloop script
which was needed to launch saned, but that program can now run
in standalone mode.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2019-10-08 18:39:47 +00:00
Michael Tremer
4f66bad488 dnsdist: Increase number of open files to 64k
dnsdist might need to open large number of connections
and therefore the default limit of 1024 needs to be
raised.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2019-08-28 08:16:32 +00:00
Peter Müller
8ee3a13552 firewall: raise log rate limit to 10 packets per second
Previous setting was to log 10 packets per minute for each
event logging is turned on. This made debugging much harder,
as the limit was rather strict and chances of dropping a
packet without logging it were good.

This patch changes the log rate limit to 10 packets per
second per event, to avoid DoS attacks against the log file.
I plan to drop log rate limit entirely in future changes,
if a better solution for this attack vector is available.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Cc: Tim FitzGeorge <ipfr@tfitzgeorge.me.uk>
Cc: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2019-08-20 17:22:48 +00:00
Arne Fitzenreiter
559e94bafb initskripts: smt: hide error on cpu's that not support smt at all
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2019-08-09 08:14:29 +02:00
Arne Fitzenreiter
99f2c69511 partresize: check for apu only if dmi is present
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2019-08-09 08:02:19 +02:00
Arne Fitzenreiter
10dd2afd6d sysctl: add seperate sysctl-x86_64.conf and move x86_64 only parameters
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2019-08-08 09:30:49 +02:00
Arne Fitzenreiter
ca75ec5278 led initskript: add nanopi-r1
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2019-08-01 07:18:20 +00:00
Arne Fitzenreiter
fa5e921ccb partresize: add copy of broadcom firmware settings for nanopi-r1
I added this to partresize like the APU scon enable because this
is the only script that runs on flashimage at first boot only and
remount root writeable.

Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2019-08-01 07:09:34 +00:00
Arne Fitzenreiter
3ec3329dff unbound: rework dns-forwader handling
add check if red interface has an IPv4 address before test the servers at
red up and simply remove forwarders at down process.

This also fix the hung at dhcpd shutdown.

Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2019-07-16 19:20:48 +02:00
Arne Fitzenreiter
4cd82be05f unbound: check if red/iface exists before read it
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2019-07-04 20:42:47 +02:00
Michael Tremer
abccd997c0 azure: Do not drop last byte of MAC addresses
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-07-01 07:53:58 +01:00
Michael Tremer
bc5037150a Enable serial console on all Azure instances
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-07-01 07:53:58 +01:00
Michael Tremer
8bd0c4b17d cloud-init: Move detection functions into initscript function library
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-07-01 07:53:58 +01:00
Michael Tremer
acf47bfa80 cloud-init: Import experimental configuration script for Azure
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-07-01 07:53:58 +01:00
Michael Tremer
b9021f9277 cloud-init: Execute setup script for Azure if needed
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-07-01 07:53:58 +01:00
Michael Tremer
d035f60c9f cloud-init: Add function to detect if we are running on Azure
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-07-01 07:53:58 +01:00
Michael Tremer
ffb37e51d4 Rename AWS initscript to cloud-init
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-07-01 07:53:58 +01:00
Arne Fitzenreiter
4b75e9c92e unbound: use nic carrier instead of /var/ipfire/red/active
This speed boot with static settings and no link and
dhcp on intel nics if the mtu is changed by the dhcp lease
because the nic loose the carrier and restart the dhcp action
at mtu set.

Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2019-06-29 11:36:49 +02:00
Alexander Marx
1722701a9a BUG12015: Redirecting to Captive portal does not work after IPFire restart
When the Captive portal is enabled, the needed firewall rules are applied. But when restarting IPFire,
the rules are not applied because there is no call to do so.
Added call to captivectrl in the initscrip 'firewall'.

Fixes: #12015

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-06-21 01:39:18 +01:00
Michael Tremer
e263c29c92 unbound: Make some zones type-transparent
If we remove other records (like MX) from the response, we won't
be able to send mail to those hosts any more.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-06-12 17:14:28 +01:00
Michael Tremer
91056adea5 unbound: Add yandex.com to safe search feature
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-06-12 17:11:32 +01:00
Michael Tremer
043e7aa50f unbound: safe search: Resolve hosts at startup
unbound is not able to expand CNAMEs in local-data. Therefore we
have to do it manually at startup.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-06-13 11:12:07 +01:00
Michael Tremer
894eaf5184 smt: Only disable SMT when the kernel thinks it is vulnerable
On virtual machines, it does not make sense to disable SMT for the
virtual cores. This has to be done by the hypervisor.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-06-11 17:07:23 +00:00
Michael Tremer
0bb25a4f61 SMT: Disable when system is vulnerable to L1TF (Foreshadow)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-06-04 23:55:17 +01:00
Michael Tremer
b0ec4158f3 miau: Drop package
This is not maintained since 2010

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-05-29 15:24:29 +01:00
Michael Tremer
f617fd912b unbound: Safe Search: Enable Restrict-Moderate for YouTube
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-05-22 15:29:32 +01:00
Michael Tremer
6a83dbb451 SMT: Apply settings according to configuration
SMT can be forced on.

By default, all systems that are vulnerable to RIDL/Fallout
will have SMT disabled by default.

Systems that are not vulnerable to that will keep SMT enabled.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-05-20 21:30:26 +01:00
Stefan Schantl
a8387f8d6e suricata: Limit to a maximum of "16" netfilter queues.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2019-05-20 07:09:25 +02:00
Michael Tremer
661ab15389 unbound: Add Safe Search
This is a feature that will filter adult content from search
engine's results.

The old method of rewriting the HTTP request no longer works.

This method changes the DNS response for supported search engines
which violates our belief in DNSSEC and won't allow these search
engines to ever enable DNSSEC.

However, there is no better solution available to this and this
an optional feature, too.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Reviewed-by: Peter Müller <peter.mueller@ipfire.org>
2019-05-11 04:19:37 +01:00
Stefan Schantl
62910a28a6 suricata: Remove PID file on stop
Force the initscript to remove the PID file when calling "stop" section.

If suricata crashes during startup, the PID file still remains and the service
cannot be started anymore until the file has been deleted.

Now when calling "stop" or "restart" the PID file will be deleted and the service
can be used again.

Fixes #12067.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2019-05-01 18:04:15 +02:00
Stefan Schantl
9cf253e150 initscripts/suricata: Rework creation of firewall rules.
The script now will use the previously introduced seperate firewall chains called
IPS_INPUT, IPS_FORWARD and IPS_OUTPUT.

The commit also creates an AND connection between the choosen network zones in the UI and
the final firwall rules.

Fixes #12062.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2019-04-26 07:46:15 +02:00
Stefan Schantl
5e3067cb52 initscripts/suricata: Move functions order and always use flush_fw_chain function
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2019-04-26 07:46:15 +02:00
Stefan Schantl
686c4b9f25 firewall: Use seperate firewall chains for passing traffic to the IPS
Create and use seperate iptables chain called IPS_INPUT, IPS_FORWARD and IPS_OUTPUT
to be more flexible which kind of traffic should be passed to suricata.

Reference #12062

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2019-04-26 07:46:15 +02:00