Commit Graph

1501 Commits

Author SHA1 Message Date
Michael Tremer
c6282b001b networking: Allow changing DHCP Option Rapid Commit
This option needs to be configurable since some (braindead) ISPs have
started running broken DHCP servers to be bug-compatible with cheap
broken plastic routers.

By default we keep this option enabled, but it can now be turned off
whenever needed.

Suggested-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Tested-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2024-11-05 09:06:01 +01:00
Michael Tremer
2e92bfc047 chown: Replace . with : on all shipped scripts
I don't like this messy bootup screen that we have with all sorts of
warnings that actually don't cause any problems, but make the boot
messy and send the wrong message to users.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2024-11-05 08:51:45 +01:00
Michael Tremer
3c904d268b hostapd: Enable logging to syslog
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2024-11-05 08:45:33 +01:00
Adolf Belka
1af2530c07 lcdproc: removal as discussed in Conf call 7th Oct
- removal of lfs, rootfile and config files
- backup includes file is also removed, althouigh it was an empty file, so not backing
   anything up.

Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-10-09 18:25:56 +00:00
Arne Fitzenreiter
a5c7005c3d mpd: fix chown syntax
this remove a warning at boot that user and group should
seperated by ":" and not by "."

Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-09-29 11:28:26 +00:00
Michael Tremer
6ca5fb74ab Merge branch 'master' into next 2024-09-24 08:54:50 +00:00
Michael Tremer
d99826dc71 suricata: Enable scanning IPsec packets
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-09-24 08:45:41 +00:00
Michael Tremer
db151ad716 suricata: Add support for zones having multiple interfaces
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-09-24 08:45:31 +00:00
Michael Tremer
09831e9ca9 suricata: Split marking packets off into a separate chain
This is required so that we can have different policies for incoming and
outgoing packets.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-09-24 08:45:26 +00:00
Michael Tremer
75a89ddf4a suricata: Clear IPS bits after use
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-09-24 08:44:54 +00:00
Michael Tremer
6826eed0a4 suricata: Always count the whitelisted packets
Even if there are no rules, if this does not exist, collectd will be
unhappy and we cannot generate the graph.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-09-24 08:44:48 +00:00
Michael Tremer
cf44d8d149 firewall: Move the IPS back to INPUT/FORWARD/OUTPUT
We cannot use the PREROUTING/POSTROUTING chains here because Suricata
will fail to track NAT-ed connections.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-09-24 08:44:24 +00:00
Michael Tremer
5da15c5d3b suricata: Track whitelisted traffic and add it to the IPS graph
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-09-24 08:44:18 +00:00
Michael Tremer
a85924cc25 suricata: Collect metrics on scanned and bypassed packets
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-09-24 08:44:07 +00:00
Michael Tremer
8b73307b15 suricata: Force Suricata to write a PID file again
The PID file does not get written when Suricata is not being started in
daemon mode and therefore we need to pass it as a command line
parameter.

The initscript should not deal with the PID file when starting but needs
it to terminate the process and to check the process status.

The web UI can use the PID file again.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-09-24 08:44:02 +00:00
Michael Tremer
0d38ebeb05 suricata: Remove debugging code
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-09-24 08:43:47 +00:00
Michael Tremer
525ff6d74d firewall: Move the IPS after the NAT marking
This is because we might still land in the scenario where Suricata
crashes and NFQUEUE will simply ACCEPT all packets which will terminate
the processing of the mangle table.

Therefore the NFQUEUE rule should be the last one so that we never skip
any of the other processing.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-09-24 08:43:41 +00:00
Michael Tremer
1b7d1abdf0 suricata: Add option to scan WireGuard
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-09-24 08:42:59 +00:00
Michael Tremer
72d501f923 suricata: Don't load /var/ipfire/ethernet/settings
We no longer need this directly as it is being pulled in from the
network functions.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-09-24 08:42:54 +00:00
Michael Tremer
eb3156ed6b suricata: Remove superfluous bits from the initscript
I don't know why these hacks are here.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-09-24 08:42:48 +00:00
Michael Tremer
79cce701a9 suricata: Restore the interface selection
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-09-24 08:42:43 +00:00
Michael Tremer
7e1c564ec8 suricata: Start the new watcher in the background
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-09-24 08:42:37 +00:00
Michael Tremer
17887e69a8 suricata: Add a watcher to restart on unexpected termination
This patch adds a watcher process that will restart suricata when it is
being killed by SIGKILL (e.g. by the OOM killer) or after a SEGV.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-09-24 08:42:32 +00:00
Michael Tremer
e088c21158 suricata: Be more efficient with marks
This patch changes that we introduce a new mark which allows us to
identify any newly bypassed connections and permanently store the bypass
flag.

We also only restore marks from the connection tracking when a packet
has no marks, yet.

Tested-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-09-24 08:42:25 +00:00
Michael Tremer
54a58a2891 suricata: Replace removed CPU count function
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-09-24 08:42:19 +00:00
Michael Tremer
84a73d5f39 suricata: Add whitelist to iptables
This allows us to workaround better against any problems in Suricata
because we never send any whitelisted packets to the IPS in the first
place.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-09-24 08:42:13 +00:00
Michael Tremer
655a95803a suricata: Remove some unused constants
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-09-24 08:42:06 +00:00
Michael Tremer
50d987cc21 suricata: Use getconf to determine the number of processors
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-09-24 08:41:59 +00:00
Michael Tremer
7e5ec56998 initscripts: Fix bash function definitions in suricata
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-09-24 08:41:53 +00:00
Michael Tremer
558dcc66e6 suricata: Move the IPS into the mangle table
This should make the IPS more efficient, we should have fewer rules and
the IPS will now sit at the edge of the networking stack as it will see
packets immediately when they come and and just before they leave.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-09-24 08:41:45 +00:00
Peter Müller
3b54d0377b apache: Drop RSA key and certificate generation
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-09-22 14:42:41 +00:00
Peter Müller
bc0fdeae6f sshd: Do not generate new RSA host key on first boot
This patch will also ensure the maximum supported key length
is used for ECDSA. Existing installations will remain unaffected.

Note that the key size for ED25519 is fixed, and explicitly
setting it to 521 bytes will not have any impact.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-09-22 14:42:41 +00:00
Adolf Belka
5b75ddfff2 collectd: Fixes bug-13074, create collectd.d directory
- As requested in bug 13074, create a collectd.d directory to enable any addon definitions
   to be created.
- Added include statement in conf file to load everything that is stored in the collectd.d
   directory.
- collectd.precache and collectd.thermal have been left in their original locations
- Removed the arm section in the initscript as only aarch64 is now used.
- Modified the lfs to create the collectd.d directory
- Removal of collectd.custom file as this was the previous way to define custom collectd
   profiles but would have been overwritten by any update of collectd.
- Update of rootfile to take account of new path and removal of collectd.custom
- Tested out in vm testbed with Core Update 188 and all existing graphs were still created
   and updated. From my evaluation the changes have not affected anything.
- The creation of the collectd.d directory now allows users to add their own desired
   profiles but also if it is decided that an addon should be included in the processes
   graph, or if a new graph for addons is created then profiles for that addon can be
   placed in the collectd.d directory and will be automatically included by collectd.

Fixes: Bug13074
Tested-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-09-22 14:18:12 +00:00
Jonatan Schlag
80c1cb5a0a initscripts fkt: Fix shebang
We use features only available in bash. So we should state correctly
that the script should be executed in bash. As sh is a symlink to bash
this makes not differences on a ipfire system. But my linter is less
chatty with this change.

Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-08-24 12:19:56 +00:00
Jonatan Schlag
14ecdd86f1 initscripts fkt: keep readhash compatible with older implementation
With the use of eval BLUE_DEV='blue0 net0' stored "blue0 net0" in the
variable BLUE_DEV not "'blue0 net0'"

Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-08-24 12:19:56 +00:00
Jonatan Schlag
f1d94e7457 initscripts fkt: readhash should only parse lines with a =
A line without a = is clearly invalid.

Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-08-24 12:19:56 +00:00
Jonatan Schlag
9f72b7bc5f initscripts fkt: Check for invalid values in readhash
Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-08-24 12:19:56 +00:00
Jonatan Schlag
02254f5543 initscripts fkt: ignore invalid keys in readhash
Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-08-24 12:19:56 +00:00
Jonatan Schlag
d289bc28be initscripts fkt: Ignore comments in readhash
As '#Another Comment' is a valid key we test this change by checking if
the comments do not end up as keys in our array.

Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-08-24 12:19:56 +00:00
Jonatan Schlag
59e3c2a217 initscript fkt: ignore blank lines in readhash
Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-08-24 12:19:56 +00:00
Jonatan Schlag
96bb3ba8b8 initscript functions: add readhash
To avoid the usage of eval and to store the config in an key value
array, we introduce an new function. The tests only check if we
read the correct value to the correct variable.

One comment on the implementation as this has created some headache:

>From https://www.gnu.org/software/bash/manual/bash.html#Bourne-Shell-Builtins

	"When used in a function, declare makes each name local, as with the local command, unless the -g option is used."

So we need to use -g here

Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-08-24 12:19:56 +00:00
Stefan Schantl
823ece817f suricata: Use correct red device when using QMI
When using QMI the dial-in option has to be set to "ppp" during setup.

In this case the initscript of suricata will create all related firewall
rules for the ppp0 interface which is not correct when using QMI where
the RED device is called red0.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-08-18 12:46:14 +00:00
Michael Tremer
10210334fe Merge remote-tracking branch 'ms/cleanup' into next 2024-07-24 16:32:28 +00:00
Michael Tremer
175ba983f4 firewall: Implement generating SYNPROXY rules
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-02 09:30:28 +00:00
Michael Tremer
8711955b38 firewall: Enable SYNPROXY for untracked packets
This enables some DoS protection using SYNPROXY which will complete a
SYN handshake with the client before the connection is being forwarded.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-02 09:30:28 +00:00
Michael Tremer
be2774c0c6 firewall: Don't filter output INVALID packets
This should never cause any problems, but will cause that certain more
complicated featured like SYNPROXY won't work.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-02 09:30:28 +00:00
Michael Tremer
6342bb596b firewall: Split CONNTRACK chain
This is preparation to handle incoming/outgoing packets differently.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-07-02 09:30:28 +00:00
Michael Tremer
7825fd0f4b Revert "oci-setup: Fixes bug12763"
This reverts commit 238a47874f.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Reviewed-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2024-05-19 10:01:38 +02:00
Michael Tremer
731d944b2b Revert "gcp-setup: Fixes bug12763"
This reverts commit 2841a67548.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Reviewed-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2024-05-19 10:01:21 +02:00
Michael Tremer
d10fa6e64b Revert "exoscale-setup: Fixes bug12763"
This reverts commit 3162b6ccfa.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Reviewed-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2024-05-19 10:01:11 +02:00