606 lines
25 KiB
Text
606 lines
25 KiB
Text
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" [
|
|
<!ENTITY base CDATA "..">
|
|
<!ENTITY date "$FreeBSD: www/en/security/security.sgml,v 1.153 2004/04/03 15:54:16 nectar Exp $">
|
|
<!ENTITY title "FreeBSD Security Information">
|
|
<!ENTITY % includes SYSTEM "../includes.sgml"> %includes;
|
|
<!ENTITY advisories.html.inc SYSTEM "advisories.html.inc">
|
|
]>
|
|
<!-- $FreeBSD: www/en/security/security.sgml,v 1.153 2004/04/03 15:54:16 nectar Exp $ -->
|
|
|
|
<html>
|
|
&header;
|
|
|
|
<H2>Introduction</H2>
|
|
|
|
<P>This web page is designed to assist both new and experienced users
|
|
in the area of FreeBSD security. FreeBSD
|
|
takes security very seriously and is constantly working
|
|
on making the OS as secure as possible.</P>
|
|
|
|
<P>Here you will find additional information, or links to information,
|
|
on how to protect your system against various types of attack,
|
|
on whom to contact if you find a security-related bug, and so on. There is
|
|
also a section on the various ways that the systems programmer can
|
|
become more security conscious so that he is less likely to
|
|
introduce vulnerabilities.</P>
|
|
|
|
<H2>Table of Contents</H2>
|
|
<UL>
|
|
<LI><A HREF="#sec">Information about the FreeBSD Security Officer</A></LI>
|
|
<LI><A HREF="#pol">Information handling policies</A></LI>
|
|
<LI><A HREF="#adv">FreeBSD Security Advisories</A></LI>
|
|
<LI><A HREF="#ml">FreeBSD Security Mailing Lists Information</A></LI>
|
|
<LI><A HREF="#tat">FreeBSD Security Tips and Tricks</A></LI>
|
|
<LI><A HREF="#spg">Secure Programming Guidelines</A></LI>
|
|
<LI><A HREF="#misc">Other Related Security Information</A></LI>
|
|
</UL>
|
|
|
|
<A NAME=sec></A>
|
|
<H2>The FreeBSD Security Officer and the Security Officer Team</H2>
|
|
|
|
<P>To better coordinate information exchange with others in the security
|
|
community, FreeBSD has a focal point for security-related communications:
|
|
the FreeBSD Security Officer.</P>
|
|
|
|
<P>If you need to contact the FreeBSD Project about
|
|
a possible security issue, you should therefore <A
|
|
HREF="mailto:security-officer@FreeBSD.org">send mail to the Security
|
|
Officer</A> with a description of what you have found and the type of
|
|
vulnerability it represents.</P>
|
|
|
|
<p>In order that the FreeBSD Project may respond to vulnerability
|
|
reports in a timely manner, there are four members of the Security
|
|
Officer mail alias: the Security Officer, the Deputy Security Officer,
|
|
and two Core Team members. Therefore, messages sent to the
|
|
<a
|
|
href="mailto:security-officer@FreeBSD.org"><security-officer@FreeBSD.org></a>
|
|
mail alias are currently delivered to:</p>
|
|
|
|
<table>
|
|
<tr valign="top">
|
|
<td>Jacques Vidrine <a
|
|
href="mailto:nectar@FreeBSD.org"><nectar@FreeBSD.org></a></td>
|
|
<td>Security Officer</td>
|
|
</tr>
|
|
<tr valign="top">
|
|
<td>Chris Faulhaber <a
|
|
href="mailto:jedgar@FreeBSD.org"><jedgar@FreeBSD.org></a></td>
|
|
<td>Deputy Security Officer</td>
|
|
</tr>
|
|
<tr valign="top">
|
|
<td>Robert Watson <a
|
|
href="mailto:rwatson@FreeBSD.org"><rwatson@FreeBSD.org></a></td>
|
|
<td>FreeBSD Core Team member, Release Engineering liaison,<br>
|
|
TrustedBSD Project liaison, system security architecture expert</td>
|
|
</tr>
|
|
<tr valign="top">
|
|
<td>Warner Losh <a
|
|
href="mailto:imp@FreeBSD.org"><imp@FreeBSD.org></a></td>
|
|
<td>FreeBSD Core Team liaison, Security Officer Emeritus</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<p>The Security Officer is supported by the <a
|
|
href="mailto:security-team@FreeBSD.org">FreeBSD Security Team
|
|
<security-team@FreeBSD.org></a>, a small group of committers
|
|
vetted by the Security Officer.</p>
|
|
|
|
<p>Please use the <a
|
|
href="ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/public_key.asc">Security
|
|
Officer PGP key</a> to encrypt your messages to the Security Officer
|
|
when appropriate.</p>
|
|
|
|
<a NAME="pol"></a>
|
|
<h2>Information handling policies</h2>
|
|
|
|
<p>As a general policy, the FreeBSD Security Officer favors full
|
|
disclosure of vulnerability information after a reasonable delay to
|
|
permit safe analysis and correction of a vulnerability, as well as
|
|
appropriate testing of the correction, and appropriate coordination
|
|
with other affected parties.</p>
|
|
|
|
<p>The Security Officer <em>will</em> notify one or more of the
|
|
<a href="mailto:admins@FreeBSD.org">FreeBSD Cluster Admins</a> of
|
|
vulnerabilities that put the FreeBSD Project's resources under
|
|
immediate danger.</p>
|
|
|
|
<p>The Security Officer may bring additional FreeBSD developers
|
|
or outside developers into discussion of a submitted security
|
|
vulnerability if their expertise is required to fully understand or
|
|
correct the problem. Appropriate discretion will be exercised to
|
|
minimize unnecessary distribution of information about the submitted
|
|
vulnerability, and any experts brought in will act in accordance of
|
|
Security Officer policies. In the past, experts have been brought
|
|
in based on extensive experience with highly complex components of
|
|
the operating system, including FFS, the VM system, and the network
|
|
stack.</p>
|
|
|
|
<p>If a FreeBSD release process is underway, the FreeBSD Release
|
|
Engineer may also be notified that a vulnerability exists, and its
|
|
severity, so that informed decisions may be made regarding the release
|
|
cycle and any serious security bugs present in software associated
|
|
with an up-coming release. If requested, the Security Officer will
|
|
not share information regarding the nature of the vulnerability with
|
|
the Release Engineer, limiting information flow to existence and
|
|
severity.</p>
|
|
|
|
<p>The FreeBSD Security Officer has close working relationships
|
|
with a number of other organizations, including third-party vendors
|
|
that share code with FreeBSD (the OpenBSD and NetBSD projects,
|
|
Apple, and other vendors deriving software from FreeBSD, as well
|
|
as the Linux vendor security list), as well as organizations
|
|
that track vulnerabilities and security incidents, such as CERT.
|
|
Frequently vulnerabilities may extend beyond the scope of the
|
|
FreeBSD implementation, and (perhaps less frequently) may have
|
|
broad implications for the global networking community. Under such
|
|
circumstances, the Security Officer may wish to disclose vulnerability
|
|
information to these other organizations: if you do not wish the
|
|
Security Officer to do this, please indicate so explicitly in any
|
|
submissions.</p>
|
|
|
|
<p>Submitters should be careful to explicitly document any special
|
|
information handling requirements.</p>
|
|
|
|
<p>If the submitter of a vulnerability is interested in a coordinated
|
|
disclosure process with the submitter and/or other vendors, this
|
|
should be indicated explicitly in any submissions. In the absence
|
|
of explicit requests, the FreeBSD Security Officer will select a
|
|
disclosure schedule that reflects both a desire for timely disclosure
|
|
and appropriate testing of any solutions. Submitters should be aware
|
|
that if the vulnerability is being actively discussed in public forums
|
|
(such as bugtraq), and actively exploited, the Security Officer may
|
|
choose not to follow a proposed disclosure timeline in order to
|
|
provide maximum protection for the user community.</p>
|
|
|
|
<p>Submitters should be aware that the FreeBSD Project is an open
|
|
source project, and source revision control information for every
|
|
change made to the FreeBSD source tree is publicly accessible. If a
|
|
disclosure schedule is provided, it should take into account both the
|
|
official release of advisory, patch, and update information, as well
|
|
as initial inclusion of fixes in the FreeBSD source tree. There is
|
|
necessarily a lag between the inclusion of fixes in the tree and the
|
|
generation and releases of advisories, patches, and binary updates, as
|
|
the source control system is used to generate them.</p>
|
|
|
|
<p>Submissions may be protected using PGP. If desired, responses will
|
|
also be protected using PGP.</p>
|
|
|
|
<A NAME=adv></A>
|
|
<H2>FreeBSD Security Advisories</H2>
|
|
|
|
<P>The FreeBSD Security Officer provides security advisories for
|
|
several branches of FreeBSD development. These are the <EM>-STABLE
|
|
Branches</EM> and the <EM>Security Branches</EM>. (Advisories are not
|
|
issued for the <EM>-CURRENT Branch</EM>.)</P>
|
|
|
|
<UL>
|
|
|
|
<LI><P>There is usually only a single -STABLE branch, although
|
|
during the transition from one major development line to another
|
|
(such as from FreeBSD 4.x to 5.x), there is a time span in which
|
|
there are two -STABLE branches. The -STABLE branch tags have names
|
|
like <TT>RELENG_4</TT>. The corresponding builds have names like
|
|
<TT>FreeBSD 4.6-STABLE</TT>.</P></LI>
|
|
|
|
<LI><P>Each FreeBSD Release has an associated Security Branch.
|
|
The Security Branch tags have names like <TT>RELENG_4_6</TT>.
|
|
The corresponding builds have names like <TT>FreeBSD
|
|
4.6-RELEASE-p7</TT>.</P></LI>
|
|
|
|
</UL>
|
|
|
|
<P>Issues affecting the FreeBSD Ports Collection are covered
|
|
in <A HREF="http://vuxml.FreeBSD.org/">the FreeBSD VuXML
|
|
document</A>.</P>
|
|
|
|
<P>Each branch is supported by the Security Officer for a limited time
|
|
only, and is designated as one of `<EM>Early adopter</EM>',
|
|
`<EM>Normal</EM>', or `<EM>Extended</EM>'. The designation is used as a
|
|
guideline for determining the lifetime of the branch as follows.</P>
|
|
|
|
<DL>
|
|
<DT>Early adopter</DT>
|
|
<DD>Releases which are published from the -CURRENT branch will be
|
|
supported by the Security Officer for a minimum of 6 months after
|
|
the release.</DD>
|
|
<DT>Normal</DT>
|
|
<DD>Releases which are published from the -STABLE branch will be
|
|
supported by the Security Officer for a minimum of 12 months after the
|
|
release.</DD>
|
|
<DT>Extended</DT>
|
|
<DD>Selected releases will be supported by the Security Officer for a
|
|
minimum of 24 months after the release.</DD>
|
|
</DL>
|
|
|
|
<P>The current designation and estimated lifetimes of the currently
|
|
supported branches are given below. The <EM>Estimated EoL
|
|
(end-of-life)</EM> column gives the earliest date on which that branch
|
|
is likely to be dropped. Please note that these dates may be extended
|
|
into the future, but only extenuating circumstances would lead to a
|
|
branch's support being dropped earlier than the date listed.</P>
|
|
|
|
<TABLE BORDER="3" CELLSPACING="0" CELLPADDING="2">
|
|
<TR>
|
|
<TH>Branch</TH>
|
|
<TH>Release</TH>
|
|
<TH>Type</TH>
|
|
<TH>Estimated EoL</TH>
|
|
</TR>
|
|
<TR>
|
|
<TD>RELENG_4</TD>
|
|
<TD>n/a</TD>
|
|
<TD>n/a</TD>
|
|
<TD>March 31, 2005</TD>
|
|
</TR>
|
|
<TR>
|
|
<TD>RELENG_4_8</TD>
|
|
<TD>4.8-RELEASE</TD>
|
|
<TD>Extended</TD>
|
|
<TD>March 31, 2005</TD>
|
|
</TR>
|
|
<TR>
|
|
<TD>RELENG_5_2</TD>
|
|
<TD>5.2.1-RELEASE</TD>
|
|
<TD>Early adopter</TD>
|
|
<TD>December 31, 2004</TD>
|
|
</TR>
|
|
<TR>
|
|
<TD>RELENG_4_9</TD>
|
|
<TD>4.9-RELEASE</TD>
|
|
<TD>Normal</TD>
|
|
<TD>October 31, 2004</TD>
|
|
</TR>
|
|
</TABLE>
|
|
|
|
<P>Older releases are not maintained and users are strongly encouraged
|
|
to upgrade to one of the supported releases mentioned above.</P>
|
|
|
|
<P>Like all development efforts, security fixes are first brought into
|
|
the <A HREF="../doc/en_US.ISO8859-1/books/handbook/cutting-edge.html#CURRENT">FreeBSD-current</A> branch.
|
|
After a couple of days and some testing, the fix is retrofitted into
|
|
the supported FreeBSD-stable branch(es) and an advisory is then sent
|
|
out.</P>
|
|
|
|
<P>Some statistics about advisories released during 2002:</P>
|
|
<UL>
|
|
<LI>44 advisories of varying severity were issued for the base system.</LI>
|
|
<LI>12 advisories described vulnerabilities found only in FreeBSD.
|
|
The remaining 32 were problems shared with at least one other OS
|
|
(often due to shared code).</LI>
|
|
<LI>6 security notices were issued, covering a total of 95 issues in
|
|
optional third party applications included in the Ports Collection.</LI>
|
|
</UL>
|
|
|
|
<P>Advisories are sent to the following FreeBSD mailing lists:</P>
|
|
<UL>
|
|
<LI>FreeBSD-security-notifications@FreeBSD.org</LI>
|
|
<LI>FreeBSD-security@FreeBSD.org</LI>
|
|
<LI>FreeBSD-announce@FreeBSD.org</LI>
|
|
</UL>
|
|
|
|
<P>Advisories are always signed using the FreeBSD Security Officer
|
|
<A HREF="ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/public_key.asc"> PGP key
|
|
</A> and are archived, along with their associated patches, at our
|
|
<A HREF="ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/index.html">FTP CERT
|
|
repository</A>. At the time of this writing, the following advisories are
|
|
currently available (note that this list may be a few days out of date -
|
|
for the very latest advisories please check the
|
|
<A HREF="ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/advisories/">FTP site</A>):</P>
|
|
|
|
&advisories.html.inc;
|
|
|
|
<A NAME=ml></A>
|
|
<H2>FreeBSD Security Mailing Lists Information</H2>
|
|
|
|
<P>If you are administering or using any number of FreeBSD systems, you
|
|
should probably be subscribed to one or more of the following lists:</P>
|
|
|
|
<TABLE>
|
|
<TR>
|
|
<TD><A HREF="http://lists.FreeBSD.org/mailman/listinfo/freebsd-security">freebsd-security</A></TD>
|
|
<TD>General security related discussion</TD>
|
|
</TR>
|
|
<TR>
|
|
<TD><A HREF="http://lists.FreeBSD.org/mailman/listinfo/freebsd-security-notifications">freebsd-security-notifications</A></TD>
|
|
<TD>Security notifications (low-volume moderated list)</TD>
|
|
</TR>
|
|
</TABLE>
|
|
|
|
<A NAME=spg></A>
|
|
<H2>Secure Programming Guidelines</H2>
|
|
<P></P><UL>
|
|
<LI>Never trust any source of input, i.e. command line arguments,
|
|
environment variables, configuration files, incoming TCP/UDP/ICMP packets,
|
|
hostname lookups, function arguments, etc. If the length of or contents of
|
|
the data received is at all subject to outside control, then the program or
|
|
function should watch for this when copying it around. Specific security
|
|
issues to watch for in this are:
|
|
<P></P>
|
|
<UL>
|
|
|
|
<LI>strcpy() and sprintf() calls from unbounded data. Use strncpy and
|
|
snprintf() when the length is known (or implement some other form of
|
|
bounds-checking when the length is unknown). In fact, never ever use
|
|
gets() or sprintf(), period. If you do - we will send evil dwarfs after you.
|
|
<P></P></LI>
|
|
|
|
<LI>If you have to check the user input so it does not contain bad
|
|
characters of some sort, do NOT check for those bad characters. Instead
|
|
simply verify that it consists ONLY of those characters that you do
|
|
allow. In general concept is: disallow anything that is not
|
|
explicitly allowed.
|
|
<P></P></LI>
|
|
|
|
<LI>Read man pages for strncpy() and strncat() calls. Be sure to
|
|
understand how they work!!! While strncpy() might not append a terminating
|
|
\0, strncat() on the other hand adds the \0.
|
|
<P></P></LI>
|
|
|
|
<LI>Watch for strvis() and getenv() abuse. With strvis() it is easy to get
|
|
the destination string wrong, and getenv() can return strings much
|
|
longer then the program might expect. These two functions are one of the
|
|
key ways an attack is often made on a program, causing it to overwrite stack
|
|
or variables by setting its environment variables to unexpected values. If
|
|
your program reads environment variables, be paranoid. Be very paranoid!
|
|
<P></P></LI>
|
|
|
|
<LI>Ever time you use open() or stat() call - ask yourself: "What if it
|
|
is a symbolic link?"
|
|
<P></P></LI>
|
|
|
|
<LI>Make sure to use mkstemp() instead of mktemp(), tempnam(), etc.
|
|
Also make sure to look for races in /tmp in general, being aware that
|
|
there are very few things which can be atomic in /tmp:
|
|
<UL>
|
|
<LI>Creating a directory. This will either succeed or fail.</LI>
|
|
<LI>Opening a file O_CREAT | O_EXCL</LI>
|
|
</UL>
|
|
If you use mkstemp() the above cases will be properly handled for you. Hence
|
|
all temp files should use mkstemp() to guarantee there is not race
|
|
condition and that the permissions are correct.
|
|
<P></P></LI>
|
|
|
|
<LI>If an attacker can force packets to go/come from another arbitrary
|
|
system then that attacker has complete control over the data that we get
|
|
and <B>NONE</B> of it should be trusted.
|
|
<P></P></LI>
|
|
|
|
<LI>Never trust a configuration file is correctly formatted or that it was
|
|
generated by the appropriate utility. Don't trust user input such as
|
|
terminal names or language strings to be free of '/' or '../../../' if
|
|
there is any chance that they can be used in a path name. Don't trust
|
|
<B>ANY</B> paths supplied by the user when you are running setuid root.
|
|
<P></P></LI>
|
|
|
|
<LI>Look for holes or weaknesses in how data is stored. All temp files
|
|
should have 600 permission in order to be protected from prying eyes.
|
|
<P></P></LI>
|
|
|
|
<LI>Do not just grep for the usual suspects in programs which run with
|
|
elevated privileges. Look line by line for possible overflows in these
|
|
cases since there are a lot more ways to cause buffer overflows than
|
|
by abusing strcpy() and friends.
|
|
<P></P></LI>
|
|
|
|
<LI>Just because you drop privileges somewhere, it does not mean that no
|
|
exploit is possible. The attacker may put the necessary code on the
|
|
stack to regain the privileges before executing /bin/sh.</LI></UL>
|
|
<P></P></LI>
|
|
|
|
<LI>Do uid management. Do drop privileges as soon as possible, and really
|
|
do drop them. Switching between euid and uid is NOT enough. Use setuid()
|
|
when you can.
|
|
<P></P></LI>
|
|
|
|
<LI>Never display configuration file contents on errors. A line number and
|
|
perhaps position count is enough. This is true for all libs and for any
|
|
suid/sgid program.
|
|
<P></P></LI>
|
|
|
|
<LI>Tips for those reviewing existing code for security problems:<P></P><UL>
|
|
|
|
<LI>If you are unsure of your security fixes, send them to a reviewer with
|
|
whom you already have arrangements for a second glance over your
|
|
code. Don't commit code you are not sure about since breaking something
|
|
in the name of a security fix is rather embarrassing.
|
|
<P></P></LI>
|
|
|
|
<LI>Those without CVS commit privileges should make sure that a reviewer
|
|
with such privileges is among the last to review the changes. That person
|
|
will both review and incorporate the final version you would like to have
|
|
go into the tree.
|
|
<P></P></LI>
|
|
|
|
<LI>When sending changes around for review, always use context or unidiff
|
|
format diffs - this way diffs can be easily fed to patch(1). Do not simply
|
|
send the whole files. Diffs are much easier to read and apply to local
|
|
sources (especially those in which multiple, simultaneous changes may be
|
|
taking place). All changes should be relative to the -current branch of
|
|
development.
|
|
<P></P></LI>
|
|
|
|
<LI>Always directly test your changes (e.g. build and run the affected
|
|
sources) before sending them to a reviewer. Nobody likes being sent
|
|
obviously broken stuff for review, and it just makes it appear as though
|
|
the submitter didn't even really look at what he was submitting
|
|
(which is also hardly
|
|
confidence building). If you need accounts on a machine with a specific
|
|
version which you don't have available - just ask. The project has
|
|
resources available for exactly such purposes.
|
|
<P></P></LI>
|
|
|
|
<LI>Note for committers: do not forget to retrofit -current patches into
|
|
the -stable branch as appropriate.
|
|
<P></P></LI>
|
|
|
|
<LI>Do not needlessly rewrite code to suit your style/tastes - it only
|
|
makes the reviewer's job needlessly more difficult. Do so only if there
|
|
are clear reasons for it.</LI></UL>
|
|
<P></P></LI>
|
|
|
|
<LI>Look out for programs doing complex things with signal
|
|
handlers. Many routines in the various libraries are not sufficiently
|
|
reentrant to make this safe.
|
|
<P></P></LI>
|
|
|
|
<LI>Pay special attention to realloc() usage - more often then not the
|
|
function is not used correctly.
|
|
<P></P></LI>
|
|
|
|
<LI>When using fixed size buffers, use sizeof() to prevent lossage
|
|
when a buffer size is changed but the code which uses it isn't. For
|
|
example:
|
|
<pre>
|
|
char buf[1024];
|
|
struct foo { ... };
|
|
...
|
|
BAD:
|
|
xxx(buf, 1024)
|
|
xxx(yyy, sizeof(struct foo))
|
|
GOOD:
|
|
xxx(buf, sizeof(buf))
|
|
xxx(yyy, sizeof(yyy))
|
|
</pre>
|
|
Be careful though with sizeof of pointers when you really want the size
|
|
of where it points to!
|
|
<P></P></LI>
|
|
|
|
<LI>Every time you see "char foo[###]", check every usage of foo to make
|
|
sure that it can't be overflowed. If you can't avoid overflow (and cases
|
|
of this have been seen), then at least malloc the buffer so that one can't
|
|
walk on the stack.
|
|
<P></P></LI>
|
|
|
|
<LI>Always close file descriptors as soon as you can - this makes it more
|
|
likely that the stdio buffer contents will be discarded. In library
|
|
routines, always set any file descriptors that you open to close-on-exec.
|
|
<P></P></LI>
|
|
</UL>
|
|
|
|
<P>A useful auditing tool is the its4 port, located in
|
|
/usr/ports/security/its4/. This is an automated C code auditor which
|
|
highlights potential trouble-spots in the code. It is a useful
|
|
first-pass tool, but should not be relied upon as being authoritative,
|
|
and a complete audit should include human examination of the entire
|
|
code.</P>
|
|
|
|
<P>For more information on secure programming techniques and resources, see
|
|
the <A HREF="http://www.shmoo.com/securecode/">How to Write Secure Code</A>
|
|
resource center.</P>
|
|
|
|
<A NAME=tat></A>
|
|
<H2>FreeBSD Security Tips and Tricks</H2>
|
|
<P>There are several steps one must take to secure a FreeBSD system, or
|
|
in fact any &unix; system:</P>
|
|
<UL>
|
|
|
|
<LI>Disabling potentially dangerous software<BR><P></P>
|
|
A lot of software has to be run as a special privileged user to make
|
|
use of specific resources, by making the executable set-uid. An
|
|
example is UUCP or PPP software that makes use of a serial port, or
|
|
sendmail which has to write in the mail spool and bind to a privileged
|
|
network port. When you are not using UUCP, it is of little use to have
|
|
software on your system and it may be wise to disable it. Of course,
|
|
this requires good knowledge of what can be thrown away and what not,
|
|
as well as good indication whether or not you will want the functionality
|
|
in the future.<BR><P></P>
|
|
Also some utilities you may find not useful enough to have
|
|
around pose a possible security risk, like swapinfo. If you remove
|
|
the set-uid bit for the executable (via 'chmod ug-s filename' command)
|
|
you can always keep on using swapinfo when you're root. It is however
|
|
not a good idea to strip so many sbits that you have to be root all
|
|
the time.<BR><P></P>
|
|
Not only remove programs that you don't use, also remove services you
|
|
don't want or need to provide. This can be done by editing the
|
|
<TT>/etc/inetd.conf</TT> and <TT>/etc/rc.conf</TT> files and turning
|
|
off all services you don't use.<P></P></LI>
|
|
|
|
<LI>Fixing software which has security bugs (or how to stay one step ahead
|
|
of crackers)<BR><P></P>
|
|
Make sure you are subscribed to various <A HREF="#ml">FreeBSD Security
|
|
mailing lists</A> so you get updates on security bugs and
|
|
fixes. Apply the fixes immediately.<P></P></LI>
|
|
|
|
<LI>Backups - repair your system if a security breach does occur<BR><P></P>
|
|
Always have backups and a clean version of the operating system (e.g. on
|
|
CD-Rom).
|
|
Make sure your backups do not contain corrupted data or
|
|
data modified by attackers.<P></P></LI>
|
|
|
|
<LI>Install software to watch the state of the system<BR><P></P>
|
|
Programs like the tcp wrappers and tripwire (both in packages/ports) can
|
|
help you to monitor activity on your system. This makes it easier
|
|
to detect break-ins. Also read outputs of the /etc/security scripts
|
|
which are run daily and mailed to the root account.<P></P></LI>
|
|
|
|
<LI>Educating the people who work on the system<BR><P></P>
|
|
Users should know what they are doing. They should be told to never give
|
|
out their password to anyone and to also use hard-to-guess passwords.
|
|
Let them understand that the security of the system/network is partly
|
|
in their hands.<P></P></LI>
|
|
</UL>
|
|
|
|
|
|
<P>There is also a FreeBSD Security How-To available which provides some
|
|
advanced tips on how to improve security of your system. You can
|
|
find it at <A HREF="http://www.FreeBSD.org/~jkb/howto.html">
|
|
http://www.FreeBSD.org/~jkb/howto.html</A>.</P>
|
|
<P>Security is an ongoing process. Make sure you are following the latest
|
|
developments in the security arena.</P>
|
|
|
|
<A NAME=misc></A>
|
|
<H2>What to do when you detect a security compromise</H2>
|
|
|
|
<UL>
|
|
<LI><B>Determine the level of the security breach</B><BR>
|
|
What privileges did the attacker get? Did the attacker manage to get
|
|
root access? Did the attacker only manage to get user level access?</LI>
|
|
|
|
<LI><B>Determine if the state of system (kernel or userland) has been
|
|
tampered with</B><BR>
|
|
What software has been tampered with? Was new kernel installed? Were any
|
|
of the system binaries (such as telnetd, login, etc) modified? If you
|
|
believe an attacker could have done any tampering with an OS, you may want
|
|
to re-install the operating system from a safe medium.</LI>
|
|
|
|
<LI><B>Find out how the break-in was done</B><BR>
|
|
Did the break-in occur via a well-known security bug? If that is the case,
|
|
make sure to install the correct patches. Was the break-in successful due
|
|
to a misconfiguration? Was the break-in result of a new bug? If you believe
|
|
the break-in occurred via a new bug, you should warn the
|
|
<A HREF="mailto:security-officer@FreeBSD.org"> FreeBSD Security
|
|
Officer</A>.</LI>
|
|
|
|
<LI><B>Fix the security hole</B><BR>
|
|
Install new software or apply patches to the old one in order to fix the
|
|
problems. Disable any compromised accounts.</LI>
|
|
|
|
<LI><B>Other resources</B><BR>
|
|
<A HREF="http://www.cert.org">CERT</A> also offers
|
|
<A HREF="http://www.cert.org/nav/recovering.html">detailed information</A>
|
|
on what steps to take in case of a system compromise.</LI>
|
|
</UL>
|
|
|
|
<H2>Other Related Security Information</H2>
|
|
<UL>
|
|
<LI><A href="http://www.cerias.purdue.edu/coast/archive/index.html">The COAST
|
|
archive</A> contains a huge collection of security related materials.</LI>
|
|
|
|
<LI><A href="http://www.cerias.purdue.edu/infosec/hotlist/">The Center for
|
|
Education and Research in Information Assurance and Security (CERIAS)</A>
|
|
is the place to start looking for security related materials.
|
|
It contains hundreds of useful security pointers. Everything you always
|
|
wanted to know about security... and more.</LI>
|
|
|
|
<LI>The various CERT teams such as <A href="http://www.cert.org">
|
|
http://www.cert.org</A> and <A href="http://www.auscert.org.au">
|
|
http://www.auscert.org.au</A>.</LI>
|
|
|
|
<LI>Mailing lists such as <A HREF="http://www.securityfocus.com/forums/bugtraq/intro.html">
|
|
Bugtraq</A> and <A HREF="http://list.nfr.com/forum/firewall-wizards.html">
|
|
Firewall Wizards</A>.</LI>
|
|
</UL>
|
|
|
|
&footer
|
|
</body>
|
|
</html>
|