Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document expected performance impact of standard settings we use #291

Closed
AdSchellevis opened this issue Oct 30, 2020 · 6 comments
Closed
Assignees
Labels
feature Adding new functionality

Comments

@AdSchellevis
Copy link
Member

In OPNsense we have different security measures enabled by default, since most of them don't come free (in terms of performance), it would help to document which choices people can make.
Think of Meltdown/Spectre mitigations for example.

@AdSchellevis AdSchellevis added the feature Adding new functionality label Oct 30, 2020
@AdSchellevis AdSchellevis self-assigned this Oct 30, 2020
@lattera lattera self-assigned this Nov 2, 2020
@AdSchellevis
Copy link
Member Author

AdSchellevis commented Nov 29, 2020

Some of the differences are explained in the hardening manual page (man hardening), it would probably be best if this man page got updated to include other differences as well, but for the scope of this ticket it's lets focus on the sysctl parameter difference between OPNsense and standard FreeBSD (knowing that not all of them are expected to impact performance).

I'm having some difficulties to extract all the differences between HBSD and stock FreeBSD (12.1), but these are the ones that stand our when comparing sysctl from both machines semi manually:

  • Also in man hardening
    • net.inet.ip.random_id (see man page)
    • security.bsd.hardlink_check_gid
    • security.bsd.hardlink_check_uid
    • security.bsd.unprivileged_proc_debug
    • security.bsd.see_other_gids
    • security.bsd.see_other_uids
    • security.bsd.unprivileged_read_msgbuf
    • kern.randompid
    • security.bsd.unprivileged_read_msgbuf
  • not standard and not in man hardening
    • hw.ibrs_disable
    • vm.pmap.pti
    • hw.kbd.keymap_restrict_change

below values are not equal to the ones specified in man hardening:

  • kern.msgbuf_show_timestamp (ours is default)
  • net.inet6.ip6.use_deprecated (ours is default)
  • net.inet6.ip6.use_tempaddr (ours is default)
  • net.inet6.ip6.prefer_tempaddr (ours is default)
  • security.bsd.stack_guard_page (upstream also enabled)

Our explicit changes made from within OPNsense can usually be found in system_advanced_sysctl.php, it could be an option to add these defaults as well to make these adjustments more explicit.

@lattera
Copy link

lattera commented Nov 29, 2020

The HardenedBSD wiki is mostly up-to-date: https://git-01.md.hardenedbsd.org/HardenedBSD/HardenedBSD/wiki

I need to make a few more updates to changes in 13-CURRENT.

@lattera
Copy link

lattera commented Nov 29, 2020

The kernel-level changes that would impact performance the most would be the force-enabling of IBRS and PTI. IBRS especially can have a performance hit on network-heavy workloads.

@AdSchellevis
Copy link
Member Author

@lattera thanks, I'll try to add a document on our end within a couple of weeks combining the relevant information.

@fichtner
Copy link
Member

Some sort of one-click template would be nice. I fear complaints about performance won’t go away when people have to flip a number of hardening options just to get a system they think they want/need/should have despite the clear path of HardenedBSD.

@AdSchellevis
Copy link
Member Author

@fichtner we could "institutionalize" it by adding an additional button on the tunables page ("less secure, more performance defaults"), which could be a next step.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Adding new functionality
Development

No branches or pull requests

3 participants