<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://freebsdwiki.net/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://freebsdwiki.net/index.php?action=history&amp;feed=atom&amp;title=Sysctl.conf_Security_Knobs</id>
		<title>Sysctl.conf Security Knobs - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://freebsdwiki.net/index.php?action=history&amp;feed=atom&amp;title=Sysctl.conf_Security_Knobs"/>
		<link rel="alternate" type="text/html" href="http://freebsdwiki.net/index.php?title=Sysctl.conf_Security_Knobs&amp;action=history"/>
		<updated>2026-04-06T05:50:52Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.18.0</generator>

	<entry>
		<id>http://freebsdwiki.net/index.php?title=Sysctl.conf_Security_Knobs&amp;diff=13005&amp;oldid=prev</id>
		<title>173.88.199.104: /* Sysctl.conf Security Knobs */</title>
		<link rel="alternate" type="text/html" href="http://freebsdwiki.net/index.php?title=Sysctl.conf_Security_Knobs&amp;diff=13005&amp;oldid=prev"/>
				<updated>2012-08-06T18:57:33Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Sysctl.conf Security Knobs&lt;/span&gt;&lt;/p&gt;
&lt;a href=&quot;http://freebsdwiki.net/index.php?title=Sysctl.conf_Security_Knobs&amp;amp;diff=13005&amp;amp;oldid=13004&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>173.88.199.104</name></author>	</entry>

	<entry>
		<id>http://freebsdwiki.net/index.php?title=Sysctl.conf_Security_Knobs&amp;diff=13004&amp;oldid=prev</id>
		<title>173.88.199.104: Sysctl.conf Security Knobs</title>
		<link rel="alternate" type="text/html" href="http://freebsdwiki.net/index.php?title=Sysctl.conf_Security_Knobs&amp;diff=13004&amp;oldid=prev"/>
				<updated>2012-08-06T18:34:17Z</updated>
		
		<summary type="html">&lt;p&gt;Sysctl.conf Security Knobs&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
== Sysctl.conf Security Knobs ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Add the following statements to the /etc/sysctl.conf file. You can drop the comments, but I always find them helpful later when I am looking for a problem.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
####################################################################&lt;br /&gt;
#&lt;br /&gt;
# The sysctl.conf file contains MIB's to change the default setting&lt;br /&gt;
# of internal options of the kernel at boot up time. These MIB's&lt;br /&gt;
# control how network packets are handled after the IPFW or IPFILTER &lt;br /&gt;
# software application firewalls return the packet to the kernel. &lt;br /&gt;
# Some of these MIB's may seem like they are doing the same thing, &lt;br /&gt;
# but because there is no FBSD provided documentation on the order&lt;br /&gt;
# these MIB's get control, they all get enabled here and we let the &lt;br /&gt;
# kernel do its thing.&lt;br /&gt;
#&lt;br /&gt;
# NOTE: Some of these MIB's can also be set in rc.conf and/or the&lt;br /&gt;
# kernel source. This will not hurt anything.&lt;br /&gt;
#&lt;br /&gt;
####################################################################&lt;br /&gt;
&lt;br /&gt;
####################################################################&lt;br /&gt;
# Redirect attacks are the purposeful mass issuing of ICMP type 5 packets.&lt;br /&gt;
# In a normal network, redirects to the end stations should not be required.&lt;br /&gt;
# To defend against this type of attack both the sending and accepting of&lt;br /&gt;
# redirect should be disabled. The first statement below enables the MIB&lt;br /&gt;
# to drop all inbound icmp redirect packets without returning any response.&lt;br /&gt;
# The second statement turns off the logging of redirect packets because&lt;br /&gt;
# there in no limit and this could fill up your logs consuming your whole&lt;br /&gt;
# hard drive. But there is no information about where the redirect packets&lt;br /&gt;
# get logged. The last statement changes the FBSD default about allowing&lt;br /&gt;
# redirects to be sent from this system to the Internet from yes to no.&lt;br /&gt;
# This option is ignored unless the host is routing IP packets, and&lt;br /&gt;
# should normally be enabled (=1) on all systems&lt;br /&gt;
# man icmp(4) and inet(4) and man ip(4) do not contain info about these MIBs.&lt;br /&gt;
# man sysctl(3) does have info on ip.redirect&lt;br /&gt;
&lt;br /&gt;
net.inet.icmp.drop_redirect=1&lt;br /&gt;
net.inet.icmp.log_redirect=0&lt;br /&gt;
net.inet.ip.redirect=0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
####################################################################&lt;br /&gt;
# Source routing is another way for an attacker to try to reach non-routable&lt;br /&gt;
# addresses behind your box. It can also be used to probe for information&lt;br /&gt;
# about your internal networks. These functions come enabled as part of the&lt;br /&gt;
# standard FBSD core system. The following will disable them.&lt;br /&gt;
# man inet(4) and man ip(4) do not contain any information on these MIBs.&lt;br /&gt;
&lt;br /&gt;
net.inet.ip.sourceroute=0&lt;br /&gt;
net.inet.ip.accept_sourceroute=0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
####################################################################&lt;br /&gt;
# This MIB only drops ICMP echo requests which have a destination of your&lt;br /&gt;
# broadcast address. For example, if your network is 10.10.0.1/24, &lt;br /&gt;
# (making your subnet mask 255.255.255.0) then your network broadcast address&lt;br /&gt;
# is 10.10.0.255. When a host on your network needs to send a message to all&lt;br /&gt;
# other hosts on the subnet (which happens more often than you may think) it&lt;br /&gt;
# uses this address. Everyone listens on it. Hosts outside your network have&lt;br /&gt;
# no reason to be sending packets to your broadcast address. This MIB rejects&lt;br /&gt;
# all of the broadcast echo traffic from the outside world to your network&lt;br /&gt;
# broadcast address. If this host is a firewall or gateway, it should not&lt;br /&gt;
# propagate directed broadcasts originating from outside your private network.&lt;br /&gt;
# The following statement sets the default to no, rejecting all external&lt;br /&gt;
# broadcasts requests.&lt;br /&gt;
# man sysctl(3) has some info.&lt;br /&gt;
# man inet(4) and man icmp(4) do not contain any information on these MIBs.&lt;br /&gt;
&lt;br /&gt;
net.inet.icmp.bmcastecho=0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
####################################################################&lt;br /&gt;
# This changes the system behavior when connection requests are received&lt;br /&gt;
# on TCP or UDP ports where there is no socket listening. The normal&lt;br /&gt;
# behavior, when a TCP SYN segment is received on a port where there&lt;br /&gt;
# is no socket accepting connections is for the system to return a &lt;br /&gt;
# RST segment and drop the connection. The requesting system will &lt;br /&gt;
# see this as a &amp;quot;Connection reset by peer&amp;quot;.&lt;br /&gt;
#&lt;br /&gt;
# By turning the TCP black hole MIB on with a numeric value of one, the&lt;br /&gt;
# incoming SYN segment is merely dropped, and no RST is sent, making &lt;br /&gt;
# the system appear as a blackhole.&lt;br /&gt;
#&lt;br /&gt;
# By setting the MIB value to two, any segment arriving on a closed &lt;br /&gt;
# port is dropped without returning a RST.&lt;br /&gt;
# This provides some degree of protection against stealth port scans.&lt;br /&gt;
# The following enables this MIB. man tcp(4) and man udp(4) blackhole(4) &lt;br /&gt;
# contain a little information on these MIBs.&lt;br /&gt;
&lt;br /&gt;
net.inet.tcp.blackhole=2&lt;br /&gt;
net.inet.udp.blackhole=1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
####################################################################&lt;br /&gt;
# The log_in_vain MIB will provide you with logging of attempted &lt;br /&gt;
# connections to your box on any port which does not have a service &lt;br /&gt;
# running on it. For example, if you do not have DNS server on your &lt;br /&gt;
# computer and someone would try to access your computer through DNS &lt;br /&gt;
# port 53, you would see a message such as: Connection attempt to &lt;br /&gt;
# UDP yourIP:53 from otherIP:X (where X is some high port #) displayed &lt;br /&gt;
# on the root console screen. This message also gets posted to &lt;br /&gt;
# /var/log/messages &amp;amp; /var/log/security.log.&lt;br /&gt;
# The following statements enable this function.&lt;br /&gt;
# man tcp(4) and man udp(4) contain a little information on these MIBs.&lt;br /&gt;
&lt;br /&gt;
net.inet.tcp.log_in_vain=1&lt;br /&gt;
net.inet.udp.log_in_vain=1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
####################################################################&lt;br /&gt;
# To defend against SYN attacks more commonly known as SYNFLOOD attacks,&lt;br /&gt;
# the two queues which are targeted by this type of attack should &lt;br /&gt;
# have their size increased so that the queues can withstand an attack &lt;br /&gt;
# of low to moderate intensity with little to no effect on the stability&lt;br /&gt;
# or availability of the system. FBSD maintains separate queues for &lt;br /&gt;
# inbound socket connection requests. One queue is for half-open sockets &lt;br /&gt;
# (SYN received, SYN|ACK sent), and the other queue for fully-open sockets &lt;br /&gt;
# awaiting an accept() call from the application. &lt;br /&gt;
# The following statement increases the queue size from 128.&lt;br /&gt;
&lt;br /&gt;
 kern.ipc.somaxconn=1024 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
####################################################################&lt;br /&gt;
# By allowing aged ARP entries to remain cached or lying around &lt;br /&gt;
# allows for the possibility of a hacker to create a resource &lt;br /&gt;
# exhaustion or performance degradation by filling the IP route cache&lt;br /&gt;
# with bogus ARP entries. This in turn can be used as a Denial of &lt;br /&gt;
# Service attack. To prevent this sort of problem, the following &lt;br /&gt;
# statement shortens the amount of time an ARP will be cached &lt;br /&gt;
# from 1200 to 600 seconds. &lt;br /&gt;
&lt;br /&gt;
net.link.ether.inet.max_age=600 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Securing FreeBSD]]&lt;br /&gt;
[[Category:FreeBSD for Servers]]&lt;/div&gt;</summary>
		<author><name>173.88.199.104</name></author>	</entry>

	</feed>