Skip to content

Piero Bosio Social Web Site Personale Logo Fediverso

Social Forum federato con il resto del mondo. Non contano le istanze, contano le persone

Proper FreeBSD system hardning :)(all for sysctl)

  • Proper FreeBSD system hardning :)
    (all for sysctl)

    security.bsd.see_other_uids
    security.bsd.see_other_gids
    --> Don't show other users processes

    security.bsd.unprivileged_read_msgbuf
    --> Don't allow unprivileges to read kernel buffer (dmesg)

    security.bsd.unprivileged_proc_debug
    --> Don't allow unprivileged to use debugging

    security.bsd.hardlink_check_uid
    security.bsd.hardlink_check_gid
    --> restrict hardlinks to same user/group

    kern.elf64.aslr.enable
    kern.elf32.aslr.enable
    --> Enable kernel address randomization (ASLR)

    security.bsd.unprivileged_mlock
    --> Restrict unprivileged users from loading kernel modules

    sysctl kern.securelevel=1
    --> Cannot lower securelevel
    --> Cannot write directly to mounted disks
    --> Cannot write to /dev/mem or /dev/kmem
    --> Cannot load/unload kernel modules
    --> Cannot change firewall rules (if compiled with IPFIREWALL_STATIC)
    --> System immutable and append-only file flags cannot be removed

    This can make a FreeBSD system more secure, especially on multi-user systems. Securelevel ca even go higher, but those restrictions generally need care.

  • Proper FreeBSD system hardning :)
    (all for sysctl)

    security.bsd.see_other_uids
    security.bsd.see_other_gids
    --> Don't show other users processes

    security.bsd.unprivileged_read_msgbuf
    --> Don't allow unprivileges to read kernel buffer (dmesg)

    security.bsd.unprivileged_proc_debug
    --> Don't allow unprivileged to use debugging

    security.bsd.hardlink_check_uid
    security.bsd.hardlink_check_gid
    --> restrict hardlinks to same user/group

    kern.elf64.aslr.enable
    kern.elf32.aslr.enable
    --> Enable kernel address randomization (ASLR)

    security.bsd.unprivileged_mlock
    --> Restrict unprivileged users from loading kernel modules

    sysctl kern.securelevel=1
    --> Cannot lower securelevel
    --> Cannot write directly to mounted disks
    --> Cannot write to /dev/mem or /dev/kmem
    --> Cannot load/unload kernel modules
    --> Cannot change firewall rules (if compiled with IPFIREWALL_STATIC)
    --> System immutable and append-only file flags cannot be removed

    This can make a FreeBSD system more secure, especially on multi-user systems. Securelevel ca even go higher, but those restrictions generally need care.

    @Larvitz we enable a bunch of these (and more) by default in BastilleBSD

  • stefano@mastodon.bsd.cafeundefined stefano@mastodon.bsd.cafe shared this topic on

Gli ultimi otto messaggi ricevuti dalla Federazione
Post suggeriti
  • 0 Votes
    1 Posts
    4 Views
    Why I Love freeBSDfreeBSDProcessingI've only skimmed this nice post.Thorough reading will follow laterSome highlights which resonate with me *as flageolets on a string instrument* are captured here in screenshots I've made on an AndroidMany tools still work exactly as they did (decades ago)The feeBSD handbook taught me an enormous ammount, more than many of my University courses, including things that had nothing to do with freeBSD specificallyThis is vitalThe handbook taught me the right approachunderstand first, act secondThis is a principle I use since I've been a peuter (NL).Analyze what occuredunderstand why it occuredfind out under what circumstances it can occurclose or limit those conditionsfix the problem by repairing, cooling, modifying the breakanalyse the proposed fix before implementingOnly replace when all other methods fail or repair is more expensive than replacement Sourceshttps://it-notes.dragas.net/2026/03/16/why-i-love-freebsd/#freeBSD #IT #notes #ITNotes #dragas #programming #OpenSource #no #Linux #logic #analysis
  • 0 Votes
    1 Posts
    13 Views
    Today, I installed my first FreeBSD update after switching to pkgbase. It worked perfectly and felt much faster than the “old way” using `freebsd-update`. As a user, I also feel that I can better understand what is happening.However, boot environments are no longer created automatically before updates to the base system.#FreeBSD #pkgbase
  • 0 Votes
    1 Posts
    17 Views
    So, I get to build some ZFS file servers for $dayJorb. These will be hosting VM images. Does anyone have any thoughts on disk types and layout? I'm hoping for about 30 TB of usable space each. The last time I got to build this big, we did it with spinning rust because we were cost constrained. I am being lead to believe I have significant funding this time.#FreeBSD #ZFS
  • 0 Votes
    3 Posts
    30 Views
    @stefano Thank you from the depths of my heart 💜 🌷