Commit Graph

1515 Commits

Author SHA1 Message Date
Vincent Li
53443e304a wireguard: Block unauthorized traffic
commit 89b976e9a7e4da13b82de4aadadb63ffaf3031a6
Author: Michael Tremer <michael.tremer@ipfire.org>
Date:   Thu Apr 25 20:32:57 2024 +0200

    wireguard: Block unauthorized traffic

    Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-06-25 17:09:00 -07:00
Vincent Li
5b18e6c763 wireguard: Select the correct source IP address for N2N peers
commit 76ea485d9edb781328e307c68b1f878d933408e5
Author: Michael Tremer <michael.tremer@ipfire.org>
Date:   Fri Sep 27 17:39:22 2024 +0200

    wireguard: Select the correct source IP address for N2N peers

    This is so that the firewall chooses the correct IP address when trying
    to establish connections to the remote networks.

    Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-06-25 17:09:00 -07:00
Vincent Li
b9262e849b haproxy: move haproxy to core
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-04-29 09:45:28 -07:00
Vincent Li
5df5d88abd loxilb: add loxilb init script
add loxilb init script and initial loxilb FW settings

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-04-27 10:48:42 -07:00
Vincent Li
14dce6df0c firewall: allow SSH access to bridge interface
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-04-17 09:13:50 -07:00
Vincent Li
cb07f32583 firewall: add firewall bridge IP for UI access
when firewall switched to bridge mode, we want to
have WebUI access to manage the firewall, allow user
setup IP address on the firewall bridge interface through
the UI.

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-04-17 09:13:50 -07:00
Vincent Li
6eef7f8535 firewall: add firewall bridge mode
add firewall bridge mode so it can be used as
layer 2 inline bridge for either DDoS protection
or firewall filter by iptable rules configured in
netfilter filter table forward chain.

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-04-17 09:13:50 -07:00
Vincent Li
245634dacd initscripts: add TCP DDoS XDP program init script
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-04-01 13:38:09 -07:00
Vincent Li
88c90aadcd ddos: add ddos init script
add ddos init to load/attach XDP DDoS main
program with empty tail call table as place
holder for tcp, udp, icmp...etc XDP DDoS program

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-04-01 13:38:02 -07:00
Vincent Li
6ff3d8e48e Firewall UI: Add iptables rules for XDP SYNPROXY
Add firewall WebUI and firewall iptables rules
for XDP SYNPROXY

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-03-27 19:24:05 -07:00
Vincent Li
8c30bad8f8 xdp-tailcall: add xdp-tailcall init script
xdp-tailcall init script to start/stop XDP
tail call program DNS and TLS SNI on green0
interface

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2025-01-10 10:56:15 -08:00
Michael Tremer
0d774f0db5 flash-image: Create a journal when the filesystem is being created
We recently started to have problems when a new installation was
launched from the flash image that creating the journal corrupted the
filesystem on the next mount operation.

Since we would like all IPFire installations to have a journal, we
create this now when we create the image and won't try to add it later.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-12-14 12:06:43 +00:00
Arne Fitzenreiter
e8b7c0bc3f networking/red: remove leftover debugging messages.
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2024-11-08 18:49:52 +01:00
Michael Tremer
76b6bc3e9d suricata: Explicitly ignore IPsec traffic unless enabled
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2024-11-05 14:29:53 +01:00
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