<?xml version='1.0' encoding='UTF-8'?>
<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/security/shb-tcp.xml,v 1.2 2010/04/26 19:43:14 nightmorph Exp $ -->
<!DOCTYPE sections SYSTEM "/dtd/book.dtd">

<!-- The content of this document is licensed under the CC-BY-SA license -->
<!-- See http://creativecommons.org/licenses/by-sa/1.0 -->

<sections>

<version>1.1</version>
<date>2010-04-26</date>

<section>
<title>TCP Wrappers</title>
<body>

<p>
This is a way of controlling access to services normally run by inetd (which
Gentoo does not have), but it can also be used by xinetd and other services.
</p>

<note>
The service should be executing tcpd in its server argument (in xinetd). See the
chapter on xinetd for more information.
</note>

<pre caption="/etc/hosts.deny">
ALL:PARANOID
</pre>

<pre caption="/etc/hosts.allow">
ALL: LOCAL @wheel
time: LOCAL, .gentoo.org
</pre>

<p>
As you can see the format is very similar to the one in
<path>/etc/security/access.conf</path>. Tcpd supports a specific service; it
does not overlap with <path>/etc/security/access.conf</path>. These settings
only apply to services using tcp wrappers.
</p>

<p>
It is also possible to execute commands when a service is accessed (this can be
used when activating relaying for dial-in users) but it is not recommended,
since people tend to create more problems than they are trying to solve. An
example could be that you configure a script to send an e-mail every time
someone hits the deny rule, but then an attacker could launch a DoS attack by
keep hitting the deny rule. This will create a lot of I/O and e-mails so
don't do it!. Read the <c>man 5 hosts_access</c> for more information.
</p>

</body>
</section>

</sections>
