Commit Graph

148 Commits

Author SHA1 Message Date
Arne Fitzenreiter
ffd857d098 sysctl: kernel 5.13 has removed some scheduler variables.
sched_min_granularity_ns and sched_migration_cost_ns are not
available for sysctl anymore. They can only altered via debugfs
if scheduler debugging is enabled.

Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2021-11-30 09:50:38 +01:00
Michael Tremer
7ae1dcb33e Install sysctl.conf only on those architectures where needed
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-04-11 12:12:56 +00:00
Peter Müller
45022af1b8 sysctl.conf: Turn on BPF JIT hardening, if the JIT is enabled
The second version of this patch splits this up into different
architecture-specific sysctl config files, as i586 does not support BPF
JIT, hence the net.core.bpf_jit_harden does not exist on that
architecture.

Fixes: #12384

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-04-10 13:16:28 +00:00
Michael Tremer
4d622b7ebe sysctl.conf: prevent autoloading of TTY line disciplines
This reverts commit a9d90b1b3f.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2021-04-06 10:13:38 +00:00
Peter Müller
b474e87bb8 sysctl.conf: include PID in file names of generated core dumps
This is recommended by various Linux hardening guides in order to
prevent accidential overwriting of existing core dumps. While it has
probably little to no relevance to the average IPFire user, enabling it
won't harm and fixes a Lynis warning. :-)

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-11-05 23:37:53 +00:00
Michael Tremer
a9d90b1b3f Revert "sysctl.conf: prevent autoloading of TTY line disciplines"
This reverts commit 14c65ab71c.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-10-06 12:26:26 +00:00
Peter Müller
14c65ab71c sysctl.conf: prevent autoloading of TTY line disciplines
Malicious/vulnerable TTY line disciplines have been subject of some
kernel exploits such as CVE-2017-2636, and since - to put it in Greg
Kroah-Hatrman's words - we do not "trust the userspace to do the right
thing", this reduces local kernel attack surface.

Further, there is no legitimate reason why an unprivileged user should
load kernel modules during runtime, anyway.

See also:
- https://lkml.org/lkml/2019/4/15/890
- https://a13xp0p0v.github.io/2017/03/24/CVE-2017-2636.html

Cc: Arne Fitzenreiter <arne.fitzenreiter@ipfire.org>
Cc: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-10-06 12:04:14 +00:00
Peter Müller
b7b65e736e sysctl.conf: prevent unintentional writes into attacker-controlled files and FIFOs
Similar to hard- and symlink protection introduced a while ago, this
patch enables protections against unintentional writes into
attacker-controlled regular files or FIFOs, where a program expected to
create new ones. This makes exploiting TOCTOU flaws harder.

See also: https://www.kernel.org/doc/Documentation/sysctl/fs.txt

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-10-05 15:07:47 +00:00
Peter Müller
dc5a89c948 sysctl.conf: drop RST packets for sockets in TIME-WAIT state
RFC 1337 describes various TCP (side channel) attacks against
prematurely closed connections stalling in TIME-WAIT state, such as DoS
or injecting arbitrary TCP segments, and recommends to silently discard
RST packets for sockets in this state.

While applications still tied to such sockets should tolerate invalid
input (thanks to Jon Postel), there is little legitimate reason to send
such RST packets altogether.

At the time of writing, no collateral damage related to active RFC 1337
implementations is known. Measuerements in productive environments did
not reveal any side effects either, which is why I consider enabling RFC
1337 implementation to be a safe change.

See also: https://tools.ietf.org/html/rfc1337

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2020-09-30 17:14:07 +00:00
Arne Fitzenreiter
533c4312fa dhcpcd: create dhcpcd user and chroot folder
dhcpcd 9.x adds privelege seperation by creating a chroot
and running parts of the client not as root.

Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2020-04-19 17:27:23 +00:00
Peter Müller
29a8992b72 sysctl.conf: Turn on hard- and symlink protection
Cc: Michael Tremer <michael.tremer@ipfire.org>
Cc: Arne Fitzenreiter <arne_f@ipfire.org>
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>
2020-03-30 17:07:26 +00:00
Michael Tremer
58b3c9b58a sysctl: Adopt more settings from the IBM HPC guidelines
https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Welcome%20to%20High%20Performance%20Computing%20%28HPC%29%20Central/page/Linux%20System%20Tuning%20Recommendations

Since we have already configured most of our IP/TCP stack
for low latency and fast throughput, these settings complete
those efforts.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2019-10-14 17:56:30 +00:00
Matthias Fischer
686ada3158 Added Mail log file to '/etc/logrotate.conf'
Fixes Bug #12155: logrotate wasn't set up to rotate this file.

For details see:
https://bugzilla.ipfire.org/show_bug.cgi?id=12155

Signed-off-by: Matthias Fischer <matthias.fischer@ipfire.org>
Acked-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2019-10-08 18:17:06 +00: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
Peter Müller
ef21f3e49d sysctl: improve KASLR effectiveness for mmap
By feeding more random bits into mmap allocation, the
effectiveness of KASLR will be improved, making attacks
trying to bypass address randomisation more difficult.

Changed sysctl values are:

vm.mmap_rnd_bits = 32 (default: 28)
vm.mmap_rnd_compat_bits = 16 (default: 8)

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-07-04 11:22:13 +01:00
Alexander Koch
68d7ae338e apache / WPAD: Add correct MIME type for wpad.dat and proxy.pac
Some clients require the correct MIME type to be set for accepting/handling the Proxy-Settings properly.

See: http://findproxyforurl.com/deploying-wpad/

Signed-off-by: Alexander Koch <ipfire@starkstromkonsument.de>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-04-23 20:19:43 +01:00
Michael Tremer
01604708c3 Merge remote-tracking branch 'stevee/next-suricata' into next 2019-03-14 13:19:35 +00:00
Stefan Schantl
fd378b3b08 Rename snort user and group to suricata
This only affects new installations.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2019-03-10 18:50:37 +01:00
Michael Tremer
50fcec161c /etc/group: Order groups by ID
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-03-08 10:11:23 +00:00
Michael Tremer
3d0a190843 /etc/passwd: Order users by ID
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-03-08 10:08:02 +00:00
Alexander Koch
06fc6170a2 zabbix_agentd: New addon
New addon for monitoring IPFire by Zabbix Monitoring (https://www.zabbix.com/features).
See https://forum.ipfire.org/viewtopic.php?f=52&t=22039 and https://lists.ipfire.org/pipermail/development/2019-February/005324.html for further details.

Best regards,
Alex

Signed-off-by: Alexander Koch <ipfire@starkstromkonsument.de>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-03-08 09:55:18 +00:00
Michael Tremer
0e28ea9f3e suricata: Log to syslog
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2019-03-01 17:56:46 +01:00
Michael Tremer
e37e796206 sysctl.conf: Revert enabling busy loop waiting on sockets
This causes the firmware in my ath10k module to crash.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-02-28 18:53:22 +00:00
Stefan Schantl
1ef235f08d logrotate: Rotate suricata logs instead of snort ones
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
2019-02-15 11:22:14 +01:00
Michael Tremer
d03916e558 Enable some performance tuning
These parameters increase the throughput on various (large-ish)
systems by 5-10% on the slight expense of higher power consumption.

Socket buffers are increases and the system is configured to be
less aggressive when scheduling processes from one processor to
another one which ensures that the cache remains "hot" for longer.

On a slower system (apu1d) no performance improvement or loss
could have been measured.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-01-24 12:31:27 +00:00
Michael Tremer
93d516bd70 Revert "Disable Path MTU discovery"
This reverts commit 1c0cfaa594.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-01-17 19:24:46 +00:00
Michael Tremer
f0092a6e3e keepalived: Move change of conntrack sysctl option into package
The setting cannot be set on the default system because the ip_vs
module is not loaded by default and there is no reason to load it
just because we would be able to set the setting.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-01-13 12:50:26 +01:00
Michael Tremer
af2cc3be64 IPVS: Enable connection tracking by default
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2019-01-06 21:33:43 +00:00
Michael Tremer
3ed2de1251 Merge branch 'haproxy' into next 2018-10-29 11:59:18 +01:00
Michael Tremer
c5494ad098 haproxy: Log to syslog and install logrotate script
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-10-22 21:47:05 +02:00
Tim FitzGeorge
dfb985caa9 Allow kernel to swap memory on high demand
Signed-off-by: Tim FitzGeorge <ipfr@tfitzgeorge.me.uk>
Fixes: Bug 11839
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-10-18 14:34:33 +01:00
Peter Müller
d5fe332283 do not expose kernel address spaces even to privileged users
Change this setting from 1 to 2 so kernel addresses are not
displayed even if a user has CAPS_SYSLOG privileges.

See also:
- https://lwn.net/Articles/420403/
- https://tails.boum.org/contribute/design/kernel_hardening/

Signed-off-by: Peter Müller <peter.mueller@link38.eu>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-09-09 17:47:08 +01:00
Peter Müller
373590b7c3 hide kernel addresses in /proc
Make sure kernel address space is hidden from files somewhere
in /proc . This reduces attack surface and partially addresses #11659.

Signed-off-by: Peter Müller <peter.mueller@link38.eu>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-07-03 10:32:56 +01:00
Michael Tremer
a1c5ceeb34 nsswitch.conf: Use nss-myhostname to resolve local hostname
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-06-30 19:56:56 +01:00
Arne Fitzenreiter
302dba205b Merge remote-tracking branch 'origin/master' into kernel-4.14 2018-03-30 10:26:01 +02:00
Arne Fitzenreiter
ea9d53c822 inittab: change tty1 to console
this reduce the differences between tty and scon installations
and make it easier to switch between.

Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2018-03-24 13:26:32 +01:00
Michael Tremer
1c0cfaa594 Disable Path MTU discovery
This seems to be a failed concept and causes issues with transferring
large packets through an IPsec tunnel connection.

This configures the kernel to still respond to PMTU ICMP discovery
messages, but will not try this on its own.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-02-26 15:37:49 +00:00
Michael Tremer
2d5940daca Drop MySQL
This is outdated and still on 5.0.x and nobody volunteered to
update this package.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2018-02-12 12:05:46 +00:00
Michael Tremer
56720befc7 Drop vsftpd which isn't actively maintained any more
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2017-11-28 17:30:08 +00:00
Arne Fitzenreiter
874eabd6f5 serial-console: remove baudrate from inittab
new versions of agetty missinterpretes the baudrate and set it as TERM
without the parameter agetty use the previous rate that was set by the
kernel via console=XXX,Baudrate parameter.

Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
2017-08-15 20:08:22 +02:00
Jonatan Schlag
0f1cda211c Disable netfilter on all bridges per default
Fixes: #11301

Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2017-03-11 10:08:16 +00:00
Michael Tremer
5056b4f104 Drop mldonkey files
The packages has been dropped years ago. However, some
files remained in the source tree.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2017-01-16 16:53:35 +00:00
Michael Tremer
adb11e90df Always enable asynchronous logging
This patch always enables asynchronous logging which slows
down the system a lot on slow storage and some virtual environments.

It also removes the configuration options in the web
user interface, since this is not configurable any more.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2016-11-29 12:18:41 +00:00
Michael Tremer
61b4250af5 Drop dnsmasq
This will be replaced by unbound

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2016-08-06 19:25:48 +01:00
Michael Tremer
8a1a3bf393 Merge remote-tracking branch 'ms/iptables-conntrack' into next 2016-01-22 00:54:14 +00:00
Lars Schuhmacher
18f4c007f1 fix typo in ipsec.user.secrets
Fixes a little typo

Signed-off-by: Lars Schuhmacher <larsen007@web.de>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
2015-08-25 22:06:30 +01:00
Michael Tremer
b1109b8af5 Enhance the security of the netfilter conntrack helpers
This is suggested here
  https://home.regit.org/netfilter-en/secure-use-of-helpers/
and deprecated in the kernel (#10665).
2015-04-22 18:10:59 +02:00
Arne Fitzenreiter
a762fcd037 modprobe.d: blacklist btmrvl_sdio. 2015-01-20 09:14:23 +01:00
Michael Tremer
da840da867 Remove template of /etc/fstab 2014-08-24 16:09:54 +02:00
Michael Tremer
aa7f55b2df Merge remote-tracking branch 'origin/next' into install-raid 2014-08-20 21:46:49 +02:00