{"id":1327,"date":"2017-03-27T18:53:20","date_gmt":"2017-03-27T22:53:20","guid":{"rendered":"https:\/\/easy-admin.ca\/?p=1327"},"modified":"2017-03-27T18:53:20","modified_gmt":"2017-03-27T22:53:20","slug":"notes","status":"publish","type":"post","link":"https:\/\/easy-admin.ca\/index.php\/2017\/03\/27\/notes\/","title":{"rendered":"Notes"},"content":{"rendered":"<h2>Disable core dumps for all users<\/h2>\n<p>#nano\u00a0\/etc\/security\/limits.conf<\/p>\n<p><span class=\"k\">*<\/span> hard core 0<\/p>\n<h2 id=\"disable-core-dumps-for-suid-programs\">Disable core dumps for SUID programs<\/h2>\n<p><code><span style=\"font-family: 'Noto Serif', serif;\">#<\/span>sysctl -w fs.suid_dumpable=0<\/code><br \/>\n#<code>fs.suid_dumpable = 0<\/code><\/p>\n<p><strong><span class=\"c\">Set runtime for fs.suid_dumpable<\/span> <\/strong><br \/>\n<span class=\"c\">#<\/span>sysctl -q -n -w fs.suid_dumpable<span class=\"o\">=<\/span>0<br \/>\n<span class=\"c\"><br \/>\nIf fs.suid_dumpable present in \/etc\/sysctl.conf, change value to &#8220;0&#8221;<\/span> <span class=\"c\">else, add &#8220;fs.suid_dumpable = 0&#8221; to \/etc\/sysctl.conf<\/span><br \/>\n<span class=\"k\"><br \/>\nif grep &#8211;silent ^fs.suid_dumpable \/etc\/sysctl.conf ; then sed -i <span class=\"s1\">&#8216;s\/^fs.suid_dumpable.*\/fs.suid_dumpable = 0\/g&#8217;<\/span> \/etc\/sysctl.conf else <span class=\"nb\">echo<\/span> <span class=\"s2\">&#8220;&#8221;<\/span> &gt;&gt; \/etc\/sysctl.conf <span class=\"nb\">echo<\/span> <span class=\"s2\">&#8220;# Set fs.suid_dumpable to 0 per security requirements&#8221;<\/span> &gt;&gt; \/etc\/sysctl.conf <span class=\"nb\">echo<\/span> <span class=\"s2\">&#8220;fs.suid_dumpable = 0&#8221;<\/span> &gt;&gt; \/etc\/sysctl.conf<br \/>\nfi<br \/>\n<\/span><\/p>\n<h2 id=\"buffer-overflow-protection\">Buffer Overflow Protection<\/h2>\n<p>This section helps mitigate against Buffer Overflow attacks (BOF).<\/p>\n<p><strong>Enable ExecShield<\/strong><i class=\"fa fa-link\"><\/i><\/p>\n<p>Helps prevent stack smashing \/ BOF.<\/p>\n<p>Enable on current kernel: <code>sysctl -w kernel.exec-shield=1<\/code><\/p>\n<p>Add to \/etc\/sysctl.conf:<\/p>\n<figure class=\"highlight\">\n<pre><code class=\"language-bash\" data-lang=\"bash\">kernel.exec-shield <span class=\"o\">=<\/span> 1<\/code><\/pre>\n<\/figure>\n<h2 id=\"check--enable-aslr\">Check \/ Enable ASLR<i class=\"fa fa-link\"><\/i><\/h2>\n<p>Set runtime for kernel.randomize_va_space <code>sysctl -q -n -w kernel.randomize_va_space=2<\/code><\/p>\n<p>Add <code>kernel.randomize_va_space = 2<\/code> to \/etc\/sysctl.conf if it does not already exist.<\/p>\n<h2 id=\"enable-xd-or-nx-support-on-x86-systems\">Enable XD or NX Support on x86 Systems<i class=\"fa fa-link\"><\/i><\/h2>\n<p>Recent processors in the x86 family support the ability to prevent code execution on a per memory page basis. Generically and on AMD processors, this ability is called <strong>No Execute (NX)<\/strong>, while on Intel processors it is called <strong>Execute Disable (XD)<\/strong>. This ability can help prevent exploitation of buffer overflow vulnerabilities and should be activated whenever possible. Extra steps must be taken to ensure that this protection is enabled, particularly on 32-bit x86 systems. Other processors, such as Itanium and POWER, have included such support since inception and the standard kernel for those platforms supports the feature.<\/p>\n<p>Check bios and ensure XD\/NX is enabled, not relevant for VM\u2019s.<\/p>\n<h3 id=\"disable-ssh-support-for-rhosts-files\">Disable SSH Support for .rhosts Files<i class=\"fa fa-link\"><\/i><\/h3>\n<p>SSH can emulate the behavior of the obsolete rsh command in allowing users to enable insecure access to their accounts via .rhosts files.<\/p>\n<p>To ensure this behavior is disabled, add or correct the following line in <code>\/etc\/ssh\/sshd_config<\/code>:<\/p>\n<figure class=\"highlight\">\n<pre><code class=\"language-bash\" data-lang=\"bash\">IgnoreRhosts yes<\/code><\/pre>\n<\/figure>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Disable core dumps for all users #nano\u00a0\/etc\/security\/limits.conf * hard core 0 Disable core dumps for SUID programs #sysctl -w fs.suid_dumpable=0 #fs.suid_dumpable = 0 Set runtime for fs.suid_dumpable #sysctl -q -n -w fs.suid_dumpable=0 If fs.suid_dumpable present in \/etc\/sysctl.conf, change value to &#8220;0&#8221; else, add &#8220;fs.suid_dumpable = 0&#8221; to \/etc\/sysctl.conf if grep &#8211;silent ^fs.suid_dumpable \/etc\/sysctl.conf ; then &hellip; <a href=\"https:\/\/easy-admin.ca\/index.php\/2017\/03\/27\/notes\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Notes<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"slim_seo":{"title":"Notes - HP Server","description":"Disable core dumps for all users #nano\u00a0\/etc\/security\/limits.conf * hard core 0 Disable core dumps for SUID programs # sysctl -w fs.suid_dumpable=0 # fs.suid_dum"},"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1327","post","type-post","status-publish","format-standard","hentry","category-general"],"_links":{"self":[{"href":"https:\/\/easy-admin.ca\/index.php\/wp-json\/wp\/v2\/posts\/1327","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/easy-admin.ca\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/easy-admin.ca\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/easy-admin.ca\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/easy-admin.ca\/index.php\/wp-json\/wp\/v2\/comments?post=1327"}],"version-history":[{"count":0,"href":"https:\/\/easy-admin.ca\/index.php\/wp-json\/wp\/v2\/posts\/1327\/revisions"}],"wp:attachment":[{"href":"https:\/\/easy-admin.ca\/index.php\/wp-json\/wp\/v2\/media?parent=1327"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/easy-admin.ca\/index.php\/wp-json\/wp\/v2\/categories?post=1327"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/easy-admin.ca\/index.php\/wp-json\/wp\/v2\/tags?post=1327"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}