21722 Commits

Author SHA1 Message Date
Vincent Li
56c5212374 firewall.cgi XDP SYNPROXY UI option
only show XDP SYNPROXY option when protocol
TCP is selected.

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-04-17 16:09:54 +00:00
Vincent Li
13bb8928c9 Change header from IPFire_ to BPFire_
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-04-17 01:26:16 +00:00
Vincent Li
0bece3c17a Workaround ddos init script to xdp skb mode
if interface does not support native mode
re-run xdp-loader with skb mode, got error

Attaching XDP program in native mode not supported - try SKB mode.
TCP Native mode not supported, try SKB
Replacing allowed ports
Added port 80
Added port 8090
 libxdp: Retried more than 11 times, giving up
Couldn't attach XDP program on iface 'lo': Device or resource busy(-16)
UDP Native mode not supported, try SKB
Replacing allowed udp ports
Added port 10408

but it looks loaded ok

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-04-17 00:18:34 +00:00
Vincent Li
9924b85773 ddos init script to load/unload TCP/UDP XDP prog
make ddos init script to load/unload TCP/UDP
XDP program according to TCP/UDP setting

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-04-17 00:18:34 +00:00
Vincent Li
8b50f8d07c Rename FireBeeOS to BPFire
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-04-17 00:18:34 +00:00
Vincent Li
9a53289a23 ddos.cgi add UDP DDoS WebUI
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-04-17 00:17:41 +00:00
Vincent Li
6e71870648 ddos.cgi clean up and fix
write to /var/ipfire/ddos/settings file before
enable ddos to allow /etc/rc.d/init.d/ddos script
start up ddos according to the setting from
/var/ipfire/ddos/settings

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-04-14 03:16:53 +00:00
Vincent Li
d7544e6192 Enable kernel BPF without tracing capability
enable kernel BPF XDP/TC capability, no tracing

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-04-09 01:50:14 +00:00
Vincent Li
d9a8ed29e8 Revert "Enable kernel BPF/BTF"
We need to disable BPF trace capability and disallow
unprivileged BPF so

This reverts commit d0bd3cc033.

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-04-08 19:32:11 +00:00
Vincent Li
9f86b661cb Add xdp dns rate limit program with bpf_printk deleted
XDP dns rate limit program has static tail call
which requires revert xdp-tool commit:
(039bdea "xdp-loader: Only load the BPF program we need from object files")

XDP dns rate limit program also uses bpf_printk helper which is not
supported on FireBeeOS since kernel CONFIG_BPF_EVENTS which allows user
to do kprobe, uprobe, tracepoint is not enabled, so bpf_printk helper is
not available, so removed bpf_printk

see discussion in [0] xdp-loader load xdp program with bpf tail call result in Bad file descriptor(-9)

[0] https://github.com/xdp-project/xdp-tools/issues/377

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-04-08 19:15:32 +00:00
Vincent Li
33cc594e39 mount bpffs for xdp-tools for ISO build
xdp-loader will only load the XDP program without
xdp dispatcher if bpffs is not mounted, flash image
has bpffs mounted already, add bpffs mount for ISO image

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-04-07 22:15:12 +00:00
Vincent Li
35f1987b14 Revert "Add ecapture add-on"
This reverts commit 0864b3a5ba.

User might be concerned firewall admin user capture SSL clear
text, so remove ecapture.

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-04-07 15:22:00 +00:00
Vincent Li
ff7a427189 strip kernel module to reduce image size
set strip option to 1 which is to strip modules
debug info. tried to strip all but result in file
system not found during iso installation.

fix: https://github.com/vincentmli/FireBeeOS/issues/3

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-04-06 18:43:15 +00:00
Vincent Li
7b90358c1e Add missing xdp-tools utilities
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-04-06 18:43:15 +00:00
Vincent Li
ef347b3a28 Revert "Enable serial console in default grub"
This reverts commit 7773f82726.

After ISO installation in real hardware and reboot,
the boot process appears to be "stucking" in
"dracut: Switching root".

see https://github.com/vincentmli/FireBeeOS/issues/1

revert the commit resolves the issue, I suspect maybe
the output after "dractu: Switching root" is directed
to serial console? anyway revert this change temporarily.
flash image build still need to have serial console access
for better user experience when trying flash image in KVM/Libvirt
virtual environment.

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-04-06 18:43:15 +00:00
Vincent Li
0c908cf913 Update README with demo link and download link
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-04-06 18:43:08 +00:00
Vincent Li
1688d250dc Add chinese for XDP UI 2024-03-20 17:42:32 +00:00
Vincent Li
8f4b665fb3 populate ddos port map in ddos init script
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-03-20 17:42:31 +00:00
Vincent Li
addfe66863 Change ddos.cgi to call ddosctrl
call ddosctrl with safety from ddos.cgi

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-03-20 17:42:31 +00:00
Vincent Li
9353496864 Add ddosctrl program for safe execution
add ddosctrl to start/stop/status XDP
program from ddos.cgi safely.

permission of ddosctrl

chown root.nobody /usr/local/bin/ddosctrl
chmod u+s /usr/local/bin/ddosctrl

result:

-rwsr-x--- 1 root nobody 14672 Mar 19 09:58 /usr/local/bin/ddosctrl

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-03-20 17:42:30 +00:00
Vincent Li
936c1a4fa0 Add XDP program load/unload script
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-03-20 17:42:30 +00:00
Vincent Li
8e4e24a9b9 Add XDP DDoS ddos.cgi
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-03-20 17:42:07 +00:00
Vincent Li
31f89d1813 Add eBPF XDP DDoS menu
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-03-16 15:54:04 +00:00
Vincent Li
dbb9b7014f fix remote.cgi code style
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-03-16 03:26:26 +00:00
Vincent Li
e48a29a3f1 Add XDP SYNPROXY rules in raw and filter table
XDP SYNPROXY requires setting up iptables rule
in raw table PREROUTING chain and filter table
INPUT chain.

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-03-16 03:26:18 +00:00
Vincent Li
1f16691715 Add custom XDP SYNPROXY chain
XDP SYNPROXY rules needs to be first in filter table
INPUT user defined chain and raw table PREROUTING
user defined chain.

To list the custom chain evaluation order for example:

iptables -L INPUT --line-numbers
Chain INPUT (policy DROP)
num  target     prot opt source               destination
1    INSYNPROXY  all  --  anywhere             anywhere
2    IPSBYPASS  all  --  anywhere             anywhere             mark match 0xc0000000/0xc0000000
3    BADTCP     tcp  --  anywhere             anywhere
4    CUSTOMINPUT  all  --  anywhere             anywhere
5    HOSTILE    all  --  anywhere             anywhere
6    BLOCKLISTIN !icmp --  anywhere             anywhere
7    GUARDIAN   all  --  anywhere             anywhere
8    OVPNBLOCK  all  --  anywhere             anywhere
9    IPS_INPUT  all  --  anywhere             anywhere             mark match 0x0/0xc0000000
10   IPTVINPUT  all  --  anywhere             anywhere
11   ICMPINPUT  all  --  anywhere             anywhere
12   LOOPBACK   all  --  anywhere             anywhere
13   CAPTIVE_PORTAL  all  --  anywhere             anywhere
14   CONNTRACK  all  --  anywhere             anywhere
15   DHCPGREENINPUT  all  --  anywhere             anywhere
16   TOR_INPUT  all  --  anywhere             anywhere
17   LOCATIONBLOCK  all  --  anywhere             anywhere
18   IPSECINPUT  all  --  anywhere             anywhere
19   GUIINPUT   all  --  anywhere             anywhere
20   WIRELESSINPUT  all  --  anywhere             anywhere             ctstate NEW
21   OVPNINPUT  all  --  anywhere             anywhere
22   INPUTFW    all  --  anywhere             anywhere
23   REDINPUT   all  --  anywhere             anywhere
24   POLICYIN   all  --  anywhere             anywhere

iptables -t raw -L PREROUTING --line-numbers

Chain PREROUTING (policy ACCEPT)
num  target     prot opt source               destination
1    RAWSYNPROXY  all  --  anywhere             anywhere

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-03-15 02:56:41 +00:00
Vincent Li
baf1d4a604 Disable vim automatic visual mode on mouse select
when mouse select, vim automatically turns into
visual mode, this is not convienent when copy
and paste in vim with mouse select.

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-03-14 23:50:24 +00:00
Vincent Li
968fd0ca40 make sub routine for various rule check
with routine, we could reuse the code if possible.

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-03-14 23:49:14 +00:00
Vincent Li
852567122e Add XDP SYNPROXY iptables rule UI option
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-03-12 02:41:43 +00:00
Vincent Li
eefbd2ef87 mount bpffs for XDP program
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-03-04 22:15:09 +00:00
Vincent Li
11d2901fc7 Update README with FireBeeOS
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-03-01 04:08:02 +00:00
Vincent Li
0864b3a5ba Add ecapture add-on
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-03-01 04:08:02 +00:00
Vincent Li
05ac4be397 add bpftool and re-arrange lfs build order
add lfs bpftool from [0] first to meet lfs
xdp-tools requirement.

also re-arrange BPF related add-on build order
to meet lfs knot build since it requires XDP
xsk.h

[0] https://github.com/libbpf/bpftool/releases/download/v7.3.0/bpftool-libbpf-v7.3.0-sources.tar.gz

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-03-01 04:08:02 +00:00
Vincent Li
f8ca312cfa Add xdp-tools add-on with XDP Synproxy
add xdp-tools utilities with addition of
SYN flooding DDoS attack protection in XDP

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-03-01 04:08:02 +00:00
Vincent Li
292ed31c4d Add clang add-on
xdp-tools requires clang, add clang during build
to meet xdp-tools requirement.

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-03-01 04:08:02 +00:00
Vincent Li
5de4e5e9e9 Add pahole during build
add pahole add-on during build to
allow kernel with BPF/BTF enabled
to be built. no need to install pahole
since we only need it during build.

the procedure to prepare pahole tar ball:

download pahole from [0]
untar it and download libbpf from [1]
and untar libbpf

then:

rm pahole-1.25/lib/bpf
mv libbpf-1.3.0 to pahole-1.25/lib/
cd pahole-1.25/lib/
mv libbpf-1.3.0 bpf
cd ../../
tar -czcf pahole-1.25.tar.gz pahole-1.25

mv pahole-1.25.tar.gz ipfire-2.x/cache
b2sum ipfire-2.x/cache/pahole-1.25.tar.gz

Note cmake without optimization -O2 in
lfs/pahole result in _FORTIFY_SOURCE requires
optimzation error since ipfire glibc built
with --enable-fortify-source

this also avoid the hack in [2]

[0]https://git.kernel.org/pub/scm/devel/pahole/pahole.git/snapshot/pahole-1.25.tar.gz
[1]https://github.com/libbpf/libbpf/archive/refs/tags/v1.3.0.tar.gz
[2]https://community.ipfire.org/t/how-to-customize-config-kernel-kernel-config-x86-64-ipfire/11100/8

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-03-01 04:08:02 +00:00
Vincent Li
fc0c2fe6da Add GUI Chinese translation
Add China mainland, China hk, China tw
translation. remember to remove log/configroot
to re-build image with new language support

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-03-01 04:08:01 +00:00
Vincent Li
45f0a5d543 Add lfs libbpf 1.3.0 add-on
follow [0] to add libbpf add-on for bpf user space
program to open,load,attach bpf program.

to build libbpf add-on, follow [1] first, then follow [0]

[0] https://www.ipfire.org/docs/devel/ipfire-2-x/addon-howto
[1] https://www.ipfire.org/docs/devel/ipfire-2-x/build-howto

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-03-01 04:08:01 +00:00
Vincent Li
e97d70d152 Add bpftool
bpftool comes with Linux kernel source and
it is handy to have bpftool on ipfire kernel
with BPF/BTF enabled to diagnosis BPF related
issue.

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-03-01 04:08:01 +00:00
Vincent Li
d0bd3cc033 Enable kernel BPF/BTF
enable kernel BPF/BTF build for ebpf/XDP
program packet filtering

see hack in [1]

[1] https://community.ipfire.org/t/how-to-customize-config-kernel-kernel-config-x86-64-ipfire/11100/7

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-03-01 04:08:01 +00:00
Vincent Li
803c6baaea Increase img build partition size
increase img build partition size for
BPF/BTF enabled kernel

Singed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-03-01 04:08:01 +00:00
Vincent Li
2f621b80d5 Increase build tmpfs size
increase build tmpfs size to prepare space
for building BPF/BTF enabled kernel

Singed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-03-01 04:08:01 +00:00
Vincent Li
7773f82726 Enable serial console in default grub
serial console allows user to easy access
to ipfire image instance in KVM/Libvirt
environment by virt console <ipfire instance>

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
2024-03-01 04:08:01 +00:00
Arne Fitzenreiter
6d501c0558 cpufrequtils: hide output on disabled cores.
We disable cores if the are affected by some cpu vulnerabilities
this cores report errors if you try to change the settings.
So only print the output for core0 and hide it for all cores.

Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2024-02-18 11:41:20 +01:00
Arne Fitzenreiter
06a6788e51 core184: fix rtl8812au module compression
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2024-02-18 07:59:18 +01:00
Arne Fitzenreiter
1d1f9a9a06 rtl8812au: fix module compression
the kernel cannot load the compressed module so fix compression
parameters.

Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2024-02-17 19:58:52 +01:00
Arne Fitzenreiter
51fd73ea2b cpufrequtils: fix initskript for amd-pstate
the initskript loads a test-modul for amd-pstate (which traces on intel)
and off course reports errors if firmware settings are missing.

this also fix the error at start because also amd-pstate doesn't support
ondemand mode.

Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2024-02-17 19:57:42 +01:00
Adolf Belka
c9c9580c4e freeradius: Increment PAK_VER & ship freeradius to link to the updated libssl version
- OpenSSL was updated to 3.1.4 in CU181 and to 3.2.1 in CU183 but in both cases freeradius
   was not incremented to cause it to be shipped.
- This patch increments the freeradius PAK_VER to ensure it will be shipped.

Fixes: Bug#13590
Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-02-16 12:28:55 +00:00
Adolf Belka
dd24668627 files: Ship collectd.conf for bug#12981
Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2024-02-14 19:06:20 +00:00
Adolf Belka
2071b2964f graphs.pl: Fixes graph failure when the DROP_HOSTILE directory is missing
- If a fresh install is done then only the DROP_HOSTILE_IN & DROP_HOSTILE_OUT
   rrd directories are created.
- With the DROP_HOSTILE directory missing then when the fwhits graph is updated an error
   message is caused by the inability to open the required files.
- This patch adds an if/else loop into the fwhits graph code to deal with the two cases
   of the DROP_HOSTILE being present or not depending on the history and if a backup with
   logs has been restored from when DROP_HOSTILE was in use.
- Tested on vm testbed and created a historical line for the hostile data when it was not
   split
- There might be a simpler or better approach than this but it was the only option I
   could identify. I couldn't find anything about being able to use if loops within the
   RRD::Graph loop

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-02-14 19:01:44 +00:00