diff options
Diffstat (limited to 'docs/htmldocs/securing-samba.html')
-rw-r--r-- | docs/htmldocs/securing-samba.html | 413 |
1 files changed, 86 insertions, 327 deletions
diff --git a/docs/htmldocs/securing-samba.html b/docs/htmldocs/securing-samba.html index 7fd34c5fa5..ae6408ea7b 100644 --- a/docs/htmldocs/securing-samba.html +++ b/docs/htmldocs/securing-samba.html @@ -1,357 +1,116 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<HTML -><HEAD -><TITLE ->Securing Samba</TITLE -><META -NAME="GENERATOR" -CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK -REL="HOME" -TITLE="SAMBA Project Documentation" -HREF="samba-howto-collection.html"><LINK -REL="UP" -TITLE="Advanced Configuration" -HREF="optional.html"><LINK -REL="PREVIOUS" -TITLE="Improved browsing in samba" -HREF="improved-browsing.html"><LINK -REL="NEXT" -TITLE="Unicode/Charsets" -HREF="unicode.html"></HEAD -><BODY -CLASS="CHAPTER" -BGCOLOR="#FFFFFF" -TEXT="#000000" -LINK="#0000FF" -VLINK="#840084" -ALINK="#0000FF" -><DIV -CLASS="NAVHEADER" -><TABLE -SUMMARY="Header navigation table" -WIDTH="100%" -BORDER="0" -CELLPADDING="0" -CELLSPACING="0" -><TR -><TH -COLSPAN="3" -ALIGN="center" ->SAMBA Project Documentation</TH -></TR -><TR -><TD -WIDTH="10%" -ALIGN="left" -VALIGN="bottom" -><A -HREF="improved-browsing.html" -ACCESSKEY="P" ->Prev</A -></TD -><TD -WIDTH="80%" -ALIGN="center" -VALIGN="bottom" -></TD -><TD -WIDTH="10%" -ALIGN="right" -VALIGN="bottom" -><A -HREF="unicode.html" -ACCESSKEY="N" ->Next</A -></TD -></TR -></TABLE -><HR -ALIGN="LEFT" -WIDTH="100%"></DIV -><DIV -CLASS="CHAPTER" -><H1 -><A -NAME="SECURING-SAMBA" -></A ->Chapter 25. Securing Samba</H1 -><DIV -CLASS="TOC" -><DL -><DT -><B ->Table of Contents</B -></DT -><DT ->25.1. <A -HREF="securing-samba.html#AEN4073" ->Introduction</A -></DT -><DT ->25.2. <A -HREF="securing-samba.html#AEN4076" ->Using host based protection</A -></DT -><DT ->25.3. <A -HREF="securing-samba.html#AEN4086" ->Using interface protection</A -></DT -><DT ->25.4. <A -HREF="securing-samba.html#AEN4094" ->Using a firewall</A -></DT -><DT ->25.5. <A -HREF="securing-samba.html#AEN4101" ->Using a IPC$ share deny</A -></DT -><DT ->25.6. <A -HREF="securing-samba.html#AEN4110" ->Upgrading Samba</A -></DT -></DL -></DIV -><DIV -CLASS="SECT1" -><H1 -CLASS="SECT1" -><A -NAME="AEN4073" ->25.1. Introduction</A -></H1 -><P ->This note was attached to the Samba 2.2.8 release notes as it contained an +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 24. Securing Samba</title><link rel="stylesheet" href="samba.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.59.1"><link rel="home" href="index.html" title="SAMBA Project Documentation"><link rel="up" href="optional.html" title="Part III. Advanced Configuration"><link rel="previous" href="integrate-ms-networks.html" title="Chapter 23. Integrating MS Windows networks with Samba"><link rel="next" href="unicode.html" title="Chapter 25. Unicode/Charsets"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 24. Securing Samba</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="integrate-ms-networks.html">Prev</a> </td><th width="60%" align="center">Part III. Advanced Configuration</th><td width="20%" align="right"> <a accesskey="n" href="unicode.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><h2 class="title"><a name="securing-samba"></a>Chapter 24. Securing Samba</h2></div><div><div class="author"><h3 class="author">Andrew Tridgell</h3><div class="affiliation"><span class="orgname">Samba Team<br></span><div class="address"><p><tt><<a href="mailto:tridge@samba.org">tridge@samba.org</a>></tt></p></div></div></div></div><div><div class="author"><h3 class="author">John H. Terpstra</h3><div class="affiliation"><span class="orgname">Samba Team<br></span><div class="address"><p><tt><<a href="mailto:jht@samba.org">jht@samba.org</a>></tt></p></div></div></div></div><div><p class="pubdate">17 March 2003</p></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="securing-samba.html#id2900501">Introduction</a></dt><dt><a href="securing-samba.html#id2900517">Using host based protection</a></dt><dt><a href="securing-samba.html#id2900967">Using interface protection</a></dt><dt><a href="securing-samba.html#id2901018">Using a firewall</a></dt><dt><a href="securing-samba.html#id2901061">Using a IPC$ share deny</a></dt><dt><a href="securing-samba.html#id2900617">NTLMv2 Security</a></dt><dt><a href="securing-samba.html#id2900653">Upgrading Samba</a></dt></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="id2900501"></a>Introduction</h2></div></div><p> +This note was attached to the Samba 2.2.8 release notes as it contained an important security fix. The information contained here applies to Samba -installations in general.</P -></DIV -><DIV -CLASS="SECT1" -><H1 -CLASS="SECT1" -><A -NAME="AEN4076" ->25.2. Using host based protection</A -></H1 -><P ->In many installations of Samba the greatest threat comes for outside +installations in general. +</p></div><div class="sect1" lang="en"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="id2900517"></a>Using host based protection</h2></div></div><p> +In many installations of Samba the greatest threat comes for outside your immediate network. By default Samba will accept connections from any host, which means that if you run an insecure version of Samba on a host that is directly connected to the Internet you can be -especially vulnerable.</P -><P ->One of the simplest fixes in this case is to use the <B -CLASS="COMMAND" ->hosts allow</B -> and -<B -CLASS="COMMAND" ->hosts deny</B -> options in the Samba <TT -CLASS="FILENAME" ->smb.conf</TT -> configuration file to only +especially vulnerable. +</p><p> +One of the simplest fixes in this case is to use the <b>hosts allow</b> and +<b>hosts deny</b> options in the Samba <tt>smb.conf</tt> configuration file to only allow access to your server from a specific range of hosts. An example -might be:</P -><P -><PRE -CLASS="PROGRAMLISTING" -> hosts allow = 127.0.0.1 192.168.2.0/24 192.168.3.0/24 - hosts deny = 0.0.0.0/0</PRE -></P -><P ->The above will only allow SMB connections from 'localhost' (your own +might be: +</p><pre class="programlisting"> + hosts allow = 127.0.0.1 192.168.2.0/24 192.168.3.0/24 + hosts deny = 0.0.0.0/0 +</pre><p> +The above will only allow SMB connections from 'localhost' (your own computer) and from the two private networks 192.168.2 and -192.168.3. All other connections will be refused connections as soon +192.168.3. All other connections will be refused as soon as the client sends its first packet. The refusal will be marked as a -'not listening on called name' error.</P -></DIV -><DIV -CLASS="SECT1" -><H1 -CLASS="SECT1" -><A -NAME="AEN4086" ->25.3. Using interface protection</A -></H1 -><P ->By default Samba will accept connections on any network interface that +'not listening on called name' error. +</p></div><div class="sect1" lang="en"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="id2900967"></a>Using interface protection</h2></div></div><p> +By default Samba will accept connections on any network interface that it finds on your system. That means if you have a ISDN line or a PPP connection to the Internet then Samba will accept connections on those -links. This may not be what you want.</P -><P ->You can change this behaviour using options like the following:</P -><P -><PRE -CLASS="PROGRAMLISTING" -> interfaces = eth* lo - bind interfaces only = yes</PRE -></P -><P ->This tells Samba to only listen for connections on interfaces with a +links. This may not be what you want. +</p><p> +You can change this behaviour using options like the following: +</p><pre class="programlisting"> + interfaces = eth* lo + bind interfaces only = yes +</pre><p> +This tells Samba to only listen for connections on interfaces with a name starting with 'eth' such as eth0, eth1, plus on the loopback interface called 'lo'. The name you will need to use depends on what OS you are using, in the above I used the common name for Ethernet -adapters on Linux.</P -><P ->If you use the above and someone tries to make a SMB connection to +adapters on Linux. +</p><p> +If you use the above and someone tries to make a SMB connection to your host over a PPP interface called 'ppp0' then they will get a TCP connection refused reply. In that case no Samba code is run at all as the operating system has been told not to pass connections from that -interface to any process.</P -></DIV -><DIV -CLASS="SECT1" -><H1 -CLASS="SECT1" -><A -NAME="AEN4094" ->25.4. Using a firewall</A -></H1 -><P ->Many people use a firewall to deny access to services that they don't +interface to any samba process. +</p></div><div class="sect1" lang="en"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="id2901018"></a>Using a firewall</h2></div></div><p> +Many people use a firewall to deny access to services that they don't want exposed outside their network. This can be a very good idea, although I would recommend using it in conjunction with the above methods so that you are protected even if your firewall is not active -for some reason.</P -><P ->If you are setting up a firewall then you need to know what TCP and -UDP ports to allow and block. Samba uses the following:</P -><P -><PRE -CLASS="PROGRAMLISTING" ->UDP/137 - used by nmbd -UDP/138 - used by nmbd -TCP/139 - used by smbd -TCP/445 - used by smbd</PRE -></P -><P ->The last one is important as many older firewall setups may not be +for some reason. +</p><p> +If you are setting up a firewall then you need to know what TCP and +UDP ports to allow and block. Samba uses the following: +</p><pre class="programlisting"> + UDP/137 - used by nmbd + UDP/138 - used by nmbd + TCP/139 - used by smbd + TCP/445 - used by smbd +</pre><p> +The last one is important as many older firewall setups may not be aware of it, given that this port was only added to the protocol in -recent years. </P -></DIV -><DIV -CLASS="SECT1" -><H1 -CLASS="SECT1" -><A -NAME="AEN4101" ->25.5. Using a IPC$ share deny</A -></H1 -><P ->If the above methods are not suitable, then you could also place a +recent years. +</p></div><div class="sect1" lang="en"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="id2901061"></a>Using a IPC$ share deny</h2></div></div><p> +If the above methods are not suitable, then you could also place a more specific deny on the IPC$ share that is used in the recently discovered security hole. This allows you to offer access to other shares while denying access to IPC$ from potentially untrustworthy -hosts.</P -><P ->To do that you could use:</P -><P -><PRE -CLASS="PROGRAMLISTING" -> [ipc$] - hosts allow = 192.168.115.0/24 127.0.0.1 - hosts deny = 0.0.0.0/0</PRE -></P -><P ->this would tell Samba that IPC$ connections are not allowed from +hosts. +</p><p> +To do that you could use: +</p><pre class="programlisting"> + [ipc$] + hosts allow = 192.168.115.0/24 127.0.0.1 + hosts deny = 0.0.0.0/0 +</pre><p> +this would tell Samba that IPC$ connections are not allowed from anywhere but the two listed places (localhost and a local subnet). Connections to other shares would still be allowed. As the IPC$ share is the only share that is always accessible anonymously this provides some level of protection against attackers that do not -know a username/password for your host.</P -><P ->If you use this method then clients will be given a 'access denied' +know a username/password for your host. +</p><p> +If you use this method then clients will be given a 'access denied' reply when they try to access the IPC$ share. That means that those clients will not be able to browse shares, and may also be unable to -access some other resources. </P -><P ->This is not recommended unless you cannot use one of the other -methods listed above for some reason.</P -></DIV -><DIV -CLASS="SECT1" -><H1 -CLASS="SECT1" -><A -NAME="AEN4110" ->25.6. Upgrading Samba</A -></H1 -><P ->Please check regularly on <A -HREF="http://www.samba.org/" -TARGET="_top" ->http://www.samba.org/</A -> for updates and +access some other resources. +</p><p> +This is not recommended unless you cannot use one of the other +methods listed above for some reason. +</p></div><div class="sect1" lang="en"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="id2900617"></a>NTLMv2 Security</h2></div></div><p> +To configure NTLMv2 authentication the following registry keys are worth knowing about: +</p><p> +</p><pre class="programlisting"> + [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa] + "lmcompatibilitylevel"=dword:00000003 + + 0x3 - Send NTLMv2 response only. Clients will use NTLMv2 authentication, + use NTLMv2 session security if the server supports it. Domain + controllers accept LM, NTLM and NTLMv2 authentication. + + [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0] + "NtlmMinClientSec"=dword:00080000 + + 0x80000 - NTLMv2 session security. If either NtlmMinClientSec or + NtlmMinServerSec is set to 0x80000, the connection will fail if NTLMv2 + session security is not negotiated. +</pre><p> +</p></div><div class="sect1" lang="en"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="id2900653"></a>Upgrading Samba</h2></div></div><p> +Please check regularly on <a href="http://www.samba.org/" target="_top">http://www.samba.org/</a> for updates and important announcements. Occasionally security releases are made and it is highly recommended to upgrade Samba when a security vulnerability -is discovered.</P -></DIV -></DIV -><DIV -CLASS="NAVFOOTER" -><HR -ALIGN="LEFT" -WIDTH="100%"><TABLE -SUMMARY="Footer navigation table" -WIDTH="100%" -BORDER="0" -CELLPADDING="0" -CELLSPACING="0" -><TR -><TD -WIDTH="33%" -ALIGN="left" -VALIGN="top" -><A -HREF="improved-browsing.html" -ACCESSKEY="P" ->Prev</A -></TD -><TD -WIDTH="34%" -ALIGN="center" -VALIGN="top" -><A -HREF="samba-howto-collection.html" -ACCESSKEY="H" ->Home</A -></TD -><TD -WIDTH="33%" -ALIGN="right" -VALIGN="top" -><A -HREF="unicode.html" -ACCESSKEY="N" ->Next</A -></TD -></TR -><TR -><TD -WIDTH="33%" -ALIGN="left" -VALIGN="top" ->Improved browsing in samba</TD -><TD -WIDTH="34%" -ALIGN="center" -VALIGN="top" -><A -HREF="optional.html" -ACCESSKEY="U" ->Up</A -></TD -><TD -WIDTH="33%" -ALIGN="right" -VALIGN="top" ->Unicode/Charsets</TD -></TR -></TABLE -></DIV -></BODY -></HTML ->
\ No newline at end of file +is discovered. +</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="integrate-ms-networks.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="optional.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="unicode.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 23. Integrating MS Windows networks with Samba </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 25. Unicode/Charsets</td></tr></table></div></body></html> |