Commit Graph

18284 Commits

Author SHA1 Message Date
Stefan Schantl
e41bb76cc3 ids-functions.pl: Skip deleted.rules files
These rulefiles are used by various providers as a kind of reference and
to store rules which have been taken out for correctness, performance
reasons or because of other reasons.

Fixes #12794.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-03-15 17:53:40 +00:00
Michael Tremer
0dc98b19ee openssl: Update to 1.1.1n
OpenSSL Security Advisory [15 March 2022]
============================================

Infinite loop in BN_mod_sqrt() reachable when parsing certificates
(CVE-2022-0778)
==================================================================================

Severity: High

The BN_mod_sqrt() function, which computes a modular square root,
contains
a bug that can cause it to loop forever for non-prime moduli.

Internally this function is used when parsing certificates that contain
elliptic curve public keys in compressed form or explicit elliptic curve
parameters with a base point encoded in compressed form.

It is possible to trigger the infinite loop by crafting a certificate
that
has invalid explicit curve parameters.

Since certificate parsing happens prior to verification of the
certificate
signature, any process that parses an externally supplied certificate
may thus
be subject to a denial of service attack. The infinite loop can also be
reached when parsing crafted private keys as they can contain explicit
elliptic curve parameters.

Thus vulnerable situations include:

 - TLS clients consuming server certificates
 - TLS servers consuming client certificates
 - Hosting providers taking certificates or private keys from customers
 - Certificate authorities parsing certification requests from
   subscribers
 - Anything else which parses ASN.1 elliptic curve parameters

Also any other applications that use the BN_mod_sqrt() where the
attacker
can control the parameter values are vulnerable to this DoS issue.

In the OpenSSL 1.0.2 version the public key is not parsed during initial
parsing of the certificate which makes it slightly harder to trigger
the infinite loop. However any operation which requires the public key
from the certificate will trigger the infinite loop. In particular the
attacker can use a self-signed certificate to trigger the loop during
verification of the certificate signature.

This issue affects OpenSSL versions 1.0.2, 1.1.1 and 3.0.  It was
addressed in the releases of 1.1.1n and 3.0.2 on the 15th March 2022.

OpenSSL 1.0.2 users should upgrade to 1.0.2zd (premium support customers
only)
OpenSSL 1.1.1 users should upgrade to 1.1.1n
OpenSSL 3.0 users should upgrade to 3.0.2

This issue was reported to OpenSSL on the 24th February 2022 by Tavis
Ormandy
from Google. The fix was developed by David Benjamin from Google and
Tomáš Mráz
from OpenSSL.

Note
====

OpenSSL 1.0.2 is out of support and no longer receiving public updates.
Extended
support is available for premium support customers:
https://www.openssl.org/support/contracts.html

OpenSSL 1.1.0 is out of support and no longer receiving updates of any
kind.
It is affected by the issue.

Users of these versions should upgrade to OpenSSL 3.0 or 1.1.1.

References
==========

URL for this Security Advisory:
https://www.openssl.org/news/secadv/20220315.txt

Note: the online version of the advisory may be updated with additional
details
over time.

For details of OpenSSL severity classifications please see:
https://www.openssl.org/policies/secpolicy.html

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-03-15 17:53:06 +00:00
Michael Tremer
ebe404ef02 core165: Ship IPS rule updater again and unlock IPS page
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-03-15 11:16:22 +00:00
Michael Tremer
16cd2d674e core165: Rebuild IPS rules
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-03-14 15:56:40 +00:00
Stefan Schantl
41fda6cd14 ids-functions.pl: Do not longer extract all rulefiles in archive.
Only extract rulefiles which are located in a rules directory and/or in the archive
root.

This prevents us from extracting experimental or binary rules etc. which
often are located in corresponding sub-directories.

Reference: #12794.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-03-14 15:55:40 +00:00
Michael Tremer
12cd388967 firewall: Make blocking all traffic impossible on HOSTILE
The current setup can fail and block all traffic on RED if the RETURN
rules could not be created.

This can happen when the kernel fails to load the ipset module, as it is
the case after upgrading to a new kernel. Restarting the firewall will
cause that the system is being cut off the internet.

This design now changes that if those rules cannot be created, the
DROP_HOSTILE feature is just inactive, but it would not disrupt any
traffic.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Daniel Weismüller <daniel.weismueller@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-03-14 15:25:58 +00:00
Michael Tremer
fe6b15f843 core165: Actually ship the core files
This filelist is there to ship files that contain the version number of
a release and *must* be shipped every time. For that, they will need to
be a part of the filelist.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-03-10 10:35:44 +00:00
Michael Tremer
817f4c1410 Merge branch 'next' 2022-03-10 10:27:51 +00:00
Michael Tremer
eb41bf304e samba: Fix rootfile on x86_64
The web UI menu entry, samba.cgi and the control binary were lost in
61d7aaa3ef.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-03-10 10:25:19 +00:00
Stefan Schantl
47b2640d37 general-functions.pl: Do not die if no red interface could be determined.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-03-09 15:46:19 +00:00
Stefan Schantl
74659290e9 rules.pl: Do not create HOSTILE rules if no red dev is available.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-03-09 15:45:59 +00:00
Stefan Schantl
870c223e0f rules.pl: Adjust code to use sets generated by libloc 0.9.11
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-03-09 15:43:17 +00:00
Stefan Schantl
cd3e5923fe libloc: Update to 0.9.11
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-03-09 15:41:49 +00:00
Arne Fitzenreiter
ead01caeb8 rtl8189fs: add realtek wlan driver
this chip is the successor of the rtl8189es look some boards has
silently switched to the new chip.

Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
Reviewed-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-03-09 15:25:57 +00:00
Arne Fitzenreiter
5643fd8a90 rtl8189fs: add realtek wlan driver
this chip is the successor of the rtl8189es look some boards has
silently switched to the new chip.

Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
Reviewed-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-03-09 15:22:38 +00:00
Stefan Schantl
e895c2de72 optionsfw.cgi: Add default settings for newly added options.
If no settings for those features can be obtained from the settings
file, set them to the following defaults.

* DROPSPOOFEDMARTIAN -> on (yes)
* DROPHOSTILE -> off (no - because only fresh installed systems should
                     do this)
* LOGDROPCTINVALID -> on (yes)

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Reviewed-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-03-08 11:30:18 +00:00
Michael Tremer
7f8bb55a60 core165: Ship hyperscan
This package is being built with a different configuration.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-03-08 10:42:00 +00:00
Michael Tremer
de686e49e2 linux: Fix for CVE-2022-0847 aka Dirty Pipe
https://dirtypipe.cm4all.com

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-03-08 10:04:15 +00:00
Michael Tremer
32ce7ab402 linux: Fix for CVE-2022-0847 aka Dirty Pipe
https://dirtypipe.cm4all.com

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-03-08 09:59:43 +00:00
Michael Tremer
b69659af02 core164: Ship backup exclude file
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-03-07 18:53:09 +00:00
Michael Tremer
c7e0d73e7c backup: Make include/exclude files relative
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-03-07 18:51:23 +00:00
Michael Tremer
3f8e70f6b3 backup: Don't restore excluded files
Sometimes, we restore a backup that has been created earlier before
exclude files have been changed. To avoid overwriting those files, we
will consider the exlude list upon restore.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-03-07 18:51:20 +00:00
Michael Tremer
ca1fdb6954 backup: Exclude oinkmaster.conf
This file is a system configuration file and does not contain any
configruation from the user.

Since it can be overwritten in a backup and restored to an older state,
this can cause problems such as #12788.

Fixes: #12788
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-03-07 18:51:17 +00:00
Michael Tremer
fc717041c4 backup: Abort when the backup could not be extracted
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-03-07 18:51:14 +00:00
Stefan Schantl
18f0991c35 ids.cgi: Only read-in ignored hosts, if the ignore file exists.
Otherwise the CGI will crash.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-03-07 18:50:45 +00:00
Stefan Schantl
dcacf03e80 ids-functions.pl: Do not create an empty ignored settings file.
The file will be created by the WUI, when adding the first host.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-03-07 18:50:34 +00:00
Stefan Schantl
85b1d83b2a update-ids-ruleset: Always drop the lock file if it has been created during runtime.
In some situations or if an error happened, the lock file could be
keep on the system. In such a case the IDS page would be locked forever
until user interaction or reboot of the system.

Now the script checks if it has created such a lock and release it when
the script exists.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
Acked-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-03-07 18:49:59 +00:00
Stefan Schantl
da3611b276 ids-functions.pl: Do not try to chown files while extracting them.
We are almost running as an unprivileged user and therfore have not
the permissions to do this.

This will save us a lot of confusion error messages.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-03-07 18:49:37 +00:00
Peter Müller
6fe4eb6094 Core Update 165: Rename squid-accounting add-on to proxy-accounting
https://lists.ipfire.org/pipermail/development/2022-February/012482.html

The second version of this patch omits bogus directives for restarting a
service, which proxy-accounting is not.

Cc: Michael Tremer <michael.tremer@ipfire.org>
Cc: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-03-07 18:47:23 +00:00
Michael Tremer
ea04468d07 core165: Ship ids.cgi
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-03-07 18:46:34 +00:00
Stefan Schantl
fad7d1c4c6 ids.cgi: Only read-in ignored hosts, if the ignore file exists.
Otherwise the CGI will crash.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-03-07 18:46:15 +00:00
Michael Tremer
7b82d83d7e core165: Ship optionsfw.cgi
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-03-07 18:45:58 +00:00
Stefan Schantl
8f51b0a4f5 optionsfw.cgi: Add default settings for newly added options.
If no settings for those features can be obtained from the settings
file, set them to the following defaults.

* DROPSPOOFEDMARTIAN -> on (yes)
* DROPHOSTILE -> off (no - because only fresh installed systems should
                     do this)
* LOGDROPCTINVALID -> on (yes)

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Reviewed-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-03-07 18:45:28 +00:00
Stefan Schantl
9106bfca42 ids-functions.pl: Merge same named rulefiles during extract.
In case a rulestarball contains several same-named rulefiles
they have been overwritten each time and so only contained the content
from the last extracted one.

Now the content of those files will be merged by appending the content
to the first extracted one for each time.

Fixes #12792.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-03-07 17:04:15 +00:00
Stefan Schantl
cad8657532 ids-functions.pl: Do not create an empty ignored settings file.
The file will be created by the WUI, when adding the first host.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2022-03-05 19:28:24 +00:00
Stefan Schantl
2b12a010d7 ids-functions.pl: Merge same named rulefiles during extract.
In case a rulestarball contains several same-named rulefiles
they have been overwritten each time and so only contained the content
from the last extracted one.

Now the content of those files will be merged by appending the content
to the first extracted one for each time.

Fixes #12792.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2022-03-05 19:28:08 +00:00
Peter Müller
ade2424f6b Revert "Core Update 165: Ship update-ids-ruleset"
update-ids-rulesets is relevant for Core Update 164, not Core Update 165.

This reverts commit 9713023546.
2022-03-05 14:35:09 +00:00
Peter Müller
4003479449 Core Update 164: Ship update-ids-rulesets
@Michael: Please cherry-pick this one into "master" as well.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
2022-03-05 14:34:39 +00:00
Stefan Schantl
96e2e870aa firewall-lib.pl: Remove prefix when dealing with ipset sets.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2022-03-05 14:32:58 +00:00
Stefan Schantl
5841800969 rules.pl: Autodetect ipset db file to restore.
This commit allows the ipset_restore() function to auto-detect
which set file needs to be restored.

Currently it is limitated to country codes only, because we currently
does not support anything else.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2022-03-05 14:32:44 +00:00
Stefan Schantl
7b529f5417 firewall: Move dropping hostile networks to rules.pl.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
2022-03-05 14:31:55 +00:00
Stefan Schantl
2801213dcc rules.pl: Allow dynamic destory of loaded but unused ipset sets.
Instead of stupidly destroying all ipsets, we now grab the already loaded sets
and compare them with the loaded sets during runtime of the script.

So we are now able to determine which sets are not longer required and
safely can destroy (unload) at a later time.

This saves us from taking care about dropping/flushing rules which are
based on ipset before we can destroy them - because only unused sets are
affected.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Inspired-by: Tim FitzGeorge <ipfr@tfitzgeorge.me.uk>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
2022-03-05 14:31:51 +00:00
Peter Müller
65808f8478 update ca-certificates CA bundle
Update the CA certificates list to what Mozilla NSS ships currently.

The original file can be retrieved from:
https://hg.mozilla.org/mozilla-central/raw-file/tip/security/nss/lib/ckfw/builtins/certdata.txt

Please note that the certdata.txt file only appears to drop MD5
checksums in favour of SHA256, so there is no need in shipping
ca-certificates with the next Core Update.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
2022-03-05 14:31:02 +00:00
Peter Müller
975a000753 Tor: Update to 0.4.6.10
Full changelog as per https://gitweb.torproject.org/tor.git/plain/ChangeLog?h=tor-0.4.6.10 :

Changes in version 0.4.6.10 - 2022-02-04
  This version contains minor bugfixes but one in particular is that relays
  don't advertise onion service v2 support at the protocol version level.

  o Minor features (fallbackdir):
    - Regenerate fallback directories generated on February 04, 2022.

  o Minor features (geoip data):
    - Update the geoip files to match the IPFire Location Database, as
      retrieved on 2022/02/04.

  o Minor bugfix (logging):
    - Update a log notice dead URL to a working one. Fixes bug 40544;
      bugfix on 0.3.5.1-alpha.

  o Minor bugfix (relay):
    - Remove the HSDir and HSIntro onion service v2 protocol versions so
      relay stop advertising that they support them. Fixes bug 40509;
      bugfix on 0.3.5.17.

  o Minor bugfixes (MetricsPort, Prometheus):
    - Add double quotes to the label values of the onion service
      metrics. Fixes bug 40552; bugfix on 0.4.5.1-alpha.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
2022-03-05 14:30:52 +00:00
Peter Müller
9713023546 Core Update 165: Ship update-ids-ruleset
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
2022-03-05 14:30:10 +00:00
Stefan Schantl
a956712e75 update-ids-ruleset: Always drop the lock file if it has been created during runtime.
In some situations or if an error happened, the lock file could be
keep on the system. In such a case the IDS page would be locked forever
until user interaction or reboot of the system.

Now the script checks if it has created such a lock and release it when
the script exists.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
Acked-by: Peter Müller <peter.mueller@ipfire.org>
2022-03-05 14:30:06 +00:00
Stefan Schantl
8353e28ad2 ids-functions.pl: Do not try to chown files while extracting them.
We are almost running as an unprivileged user and therfore have not
the permissions to do this.

This will save us a lot of confusion error messages.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2022-03-05 14:28:36 +00:00
Michael Tremer
419153571b backup: Make include/exclude files relative
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-03-04 10:41:30 +00:00
Michael Tremer
e5ad6e2ab1 backup: Don't restore excluded files
Sometimes, we restore a backup that has been created earlier before
exclude files have been changed. To avoid overwriting those files, we
will consider the exlude list upon restore.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-03-04 10:37:00 +00:00
Michael Tremer
026935a137 backup: Exclude oinkmaster.conf
This file is a system configuration file and does not contain any
configruation from the user.

Since it can be overwritten in a backup and restored to an older state,
this can cause problems such as #12788.

Fixes: #12788
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2022-03-04 10:27:01 +00:00