<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Hardening on UNIX Esoterica</title>
    <link>https://unix-esoterica.com/tags/hardening/</link>
    <description>Recent content in Hardening on UNIX Esoterica</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Tue, 29 Apr 2025 08:41:24 +0200</lastBuildDate>
    <atom:link href="https://unix-esoterica.com/tags/hardening/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Sysctl Hardening</title>
      <link>https://unix-esoterica.com/posts/sysctl-hardening/</link>
      <pubDate>Tue, 29 Apr 2025 08:41:24 +0200</pubDate>
      <guid>https://unix-esoterica.com/posts/sysctl-hardening/</guid>
      <description>&lt;p&gt;/etc/sysctl.conf - hardening&lt;/p&gt;&#xA;&lt;p&gt;Official OpenBSD Documentation&lt;/p&gt;&#xA;&lt;p&gt;sysctl(8) manpage - &lt;a href=&#34;https://man.openbsd.org/sysctl.8&#34; rel=&#34;noopener noreferrer&#34; target=&#34;_blank&#34;&gt;https://man.openbsd.org/sysctl.8&lt;/a&gt;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;sysctl.conf(5) manpage - &lt;a href=&#34;https://man.openbsd.org/sysctl.conf.5&#34; rel=&#34;noopener noreferrer&#34; target=&#34;_blank&#34;&gt;https://man.openbsd.org/sysctl.conf.5&lt;/a&gt;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;malloc(3) manpage - &lt;a href=&#34;https://man.openbsd.org/free&#34; rel=&#34;noopener noreferrer&#34; target=&#34;_blank&#34;&gt;https://man.openbsd.org/free&lt;/a&gt;&#xA;&lt;/p&gt;&#xA;&lt;table&gt;&#xA;  &lt;thead&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;th style=&#34;text-align: left&#34;&gt;Sysctl Parameter&lt;/th&gt;&#xA;          &lt;th style=&#34;text-align: left&#34;&gt;Description&lt;/th&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/thead&gt;&#xA;  &lt;tbody&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td style=&#34;text-align: left&#34;&gt;&lt;code&gt;ddb.panic=0&lt;/code&gt;&lt;/td&gt;&#xA;          &lt;td style=&#34;text-align: left&#34;&gt;Reboot on a panic, instead of dropping into the debugger.&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td style=&#34;text-align: left&#34;&gt;&lt;code&gt;ddb.console=0&lt;/code&gt;&lt;/td&gt;&#xA;          &lt;td style=&#34;text-align: left&#34;&gt;Prevent entry into the kernel debugger.&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td style=&#34;text-align: left&#34;&gt;&lt;code&gt;net.inet.ip.forwarding=0&lt;/code&gt;&lt;/td&gt;&#xA;          &lt;td style=&#34;text-align: left&#34;&gt;Prevent inet4 forwarding for standalone workstations ( unless needed ).&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td style=&#34;text-align: left&#34;&gt;&lt;code&gt;machdep.allowaperature=0&lt;/code&gt;&lt;/td&gt;&#xA;          &lt;td style=&#34;text-align: left&#34;&gt;For systems that don&amp;rsquo;t run X.&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td style=&#34;text-align: left&#34;&gt;&lt;code&gt;vm.malloc_conf=CFGU&lt;/code&gt;&lt;/td&gt;&#xA;          &lt;td style=&#34;text-align: left&#34;&gt;Individual arguments explained below.&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td style=&#34;text-align: left&#34;&gt;C ( Cache disabled )&lt;/td&gt;&#xA;          &lt;td style=&#34;text-align: left&#34;&gt;Reduces the chance that sensitive data ( like passwords, keys, etc ) remains in memory after being freed.&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td style=&#34;text-align: left&#34;&gt;F ( Free junking )&lt;/td&gt;&#xA;          &lt;td style=&#34;text-align: left&#34;&gt;Easier to detect user-after-free bugs ( access to freed memory ), and prevents old data from leaking if memory is later misused.&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td style=&#34;text-align: left&#34;&gt;G ( Guard pages )&lt;/td&gt;&#xA;          &lt;td style=&#34;text-align: left&#34;&gt;Helps catch buffer overflows immediately by causing a segmentation fault when memory writes go past their bounds.&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td style=&#34;text-align: left&#34;&gt;U ( Use junking )&lt;/td&gt;&#xA;          &lt;td style=&#34;text-align: left&#34;&gt;Helps catch bugs where programs wrongly assume newly allocated memory.&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/tbody&gt;&#xA;&lt;/table&gt;&#xA;&lt;h3 id=&#34;server-example---etcsysctlconf&#34;&gt;Server Example - /etc/sysctl.conf&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;ddb.panic=0&#xA;ddb.console=0&#xA;vm.malloc_conf=CFGU&#xA;net.inet.ip.forwarding=0&#xA;machdep.allowaperature=0&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;firewall-example---etcsysctlconf&#34;&gt;Firewall Example - /etc/sysctl.conf&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;ddb.panic=0&#xA;ddb.console=0&#xA;vm.malloc_conf=CFGU&#xA;net.inet.ip.forwarding=1&#xA;machdep.allowaperature=0&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;workstation-example---etcsysctlconf&#34;&gt;Workstation Example - /etc/sysctl.conf&lt;/h3&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;ddb.panic=1&#xA;ddb.console=1&#xA;vm.malloc_conf=CFGU&#xA;net.inet.ip.forwarding=0&#xA;machdep.allowaperature=1&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Thanks to the author of the following page for teaching me about the malloc stuff:&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
