From: <Microsoft Internet Explorer 5¡Æ¢® AuAa>
Subject: Beginner's guide to armoring Solaris
Date: Sun, 17 Jun 2001 12:27:00 +0900
MIME-Version: 1.0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Location: http://www.enteract.com/~lspitz/armoring.html
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.3018.1300

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Beginner's guide to armoring Solaris</TITLE>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META=20
content=3D"Published article on how to armor Solaris 2.6.  Includes a =
script that will automatically backup and armor your operating system"=20
name=3Ddescription>
<META=20
content=3D"hacking,solaris,armoring,hardening,logging,inetd,syslog,TCP =
Wrappers"=20
name=3Dkeywords>
<STYLE type=3Dtext/css>A:active {
	TEXT-DECORATION: none
}
A:hover {
	TEXT-DECORATION: none
}
A:link {
	TEXT-DECORATION: none
}
A:visited {
	TEXT-DECORATION: none
}
</STYLE>

<META content=3D"MSHTML 5.00.3018.900" name=3DGENERATOR></HEAD>
<BODY link=3D#0000ff vLink=3D#800080>
<CENTER><FONT face=3D"Palatino,Book Antiqua"><FONT size=3D+4>Armoring =
Solaris</FONT>=20
<BR><I><FONT size=3D+1>Preparing solaris for a firewall</FONT></I></I>=20
<P><B><FONT size=3D-1><A=20
href=3D"mailto:lance@honeynet.org?Subject=3DArmoring Solaris">Lance=20
Spitzner</A></FONT></B> <BR><A=20
href=3D"http://www.enteract.com/~lspitz">http://www.enteract.com/~lspitz<=
/A>=20
<BR>Last Modified: 22 October, 2000 </CENTER>
<P><B>Firewalls are one of the fastest growing technical tools in the =
field of=20
information security. However, a firewall is only as secure as the =
operating=20
system it resides upon. This article will take a step by step look at =
how you=20
can best armor your Solaris box, both Sparc and x86. These steps can =
apply to=20
any situation, however I will be using Check Point FireWall-1 on Solaris =
2.6 as=20
an example.</B>&nbsp; <B>At the end of this article is a script that you =
can=20
download that will automate most of the armoring process, to include=20
implementing TCP Wrappers.</B>=20
<P><B><FONT face=3D"Helvetica-Narrow,Arial Narrow"><FONT=20
size=3D+2>Installation</FONT></FONT></B> <BR>The best place to start in =
armoring=20
your system is at the beginning, OS installation. Since this is your =
firewall,=20
you cannot trust any previous installations. You want to start with a =
clean=20
installation, where you can guarantee the system integrity.=20
<P>Place your system in an isolated network. At no time do you want to =
connect=20
your unprotected system to an active network nor the Internet, exposing =
the=20
system to a possible compromise. I personally witnessed a newly =
installed system=20
scanned and rooted within 15 minutes of connecting to the =
Internet.&nbsp; To get=20
critical files and patches later, you will need a second box that acts =
as a go=20
between. This second box will download files from the Internet, then =
connect to=20
your isolated, configuration "network" to transfer critical files.=20
<P>Once you have placed your future firewall box in an isolated network, =
you are=20
ready to begin. The first step is selecting what OS package to =
load.&nbsp; The=20
idea is to load the minimum installation, while maintaining maximum =
efficiency.=20
The less software that resides on the box, the fewer potential security =
exploits=20
or holes.&nbsp; I recommend Core installation.&nbsp; I prefer Core =
because this=20
is the absolute miminum installation, creating a more secure operating=20
system.&nbsp; For the truly paranoid, I have created three checklists on =
how to=20
modify the Core installation. One checklist for <A=20
href=3D"http://www.enteract.com/~lspitz/core6.txt">Solaris 2.6 and FW-1 =
4.0,=20
</A>the second checklist for <A=20
href=3D"http://www.enteract.com/~lspitz/core7.txt">Solaris 2.7 and FW-1 =
4.1</A>,=20
and the third checklist <A=20
href=3D"http://www.enteract.com/~lspitz/core8.txt">Solaris 8 and FW-1 =
4.1</A>. The=20
third checklist is still in beta, as Solaris 8 is not supported by =
CheckPoint.=20
If you require a GUI, need additional functionality, or are new to =
Solaris, then=20
you may want to consider the End User installation. Anything above the =
End User=20
package, such as Developer, is adding useless but potentially =
exploitable=20
software.&nbsp;&nbsp; Be sure to add the "On-Line Manual Pages" during =
the=20
install process.&nbsp; I find these extremelly usefull, while adding =
little risk=20
to your system.&nbsp; For more information on building a minimal =
installation,=20
check out <A =
href=3D"http://www.sun.com/blueprints/1299/minimization.pdf">Solaris=20
Minimization for Security</A>.=20
<P>During the installation process, you will be asked to partition your=20
system.&nbsp;&nbsp; I've never really understood Sun's love for making =
various=20
partitions. You always end up making the partitions to small and running =
out of=20
room later.&nbsp; I always like to make root as big as possible and just =
throw=20
everything in there, then you do not run out of room. However, we do =
need=20
several partitions to protect the root drive. If we were to fill the =
root=20
partition with data, such as logging or email, we would cause a denial =
of=20
service, potentially crashing the system.=20
<P>Therefore, I always recommend a separate partition for /var, this is =
where=20
all the system logging and email goes.&nbsp; By isolating the /var =
partition,=20
you protect your root partition from overfilling.&nbsp;&nbsp; I've found =
400 MB=20
to be more then enough for /var.&nbsp; You may also consider making a =
separate=20
partition for the firewall logging and /usr. If you create a seperate =
partition=20
for /usr, you can mount it read only, protecting the binaries from =
modification.=20
For Checkpoint Firewall 1, all logging by default happens in /etc/fw/log =

(/var/opt/CKPfw/log for ver 4.0).&nbsp; Many Solaris systems have two or =
more=20
drives, such as the Ultra 10 or 2 IDE drives for an x86.&nbsp; If you =
are not=20
mirroring the second drive, make it the partition for all the firewall=20
logging.&nbsp; Once again, this protects all the other partitions in =
case the=20
firewall logging floods the drive. With such a setup, your partitions =
would look=20
as follows:=20
<P><FONT face=3D"Courier New,Courier"><FONT=20
size=3D-1>/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;=20
- everything else</FONT></FONT> <BR><FONT face=3D"Courier =
New,Courier"><FONT=20
size=3D-1>/var&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp; -=20
400 MB</FONT></FONT> <BR><FONT face=3D"Courier New,Courier"><FONT=20
size=3D-1>swap&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp; -=20
256 MB (or normally 2x amount of RAM)</FONT></FONT> <BR><FONT=20
face=3D"Courier New,Courier"><FONT=20
size=3D-1>/etc/fw/log&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;=20
- 2nd drive (for CP FW-1 ver 3.0x)</FONT></FONT> <BR><FONT=20
face=3D"Courier New,Courier"><FONT=20
size=3D-1>/var/opt/CKPfw/log&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - 2nd drive =
(for CP=20
FW-1 ver 4.0x)</FONT></FONT> <BR><FONT face=3D"Courier =
New,Courier"><FONT=20
size=3D-1>/var/opt/CPfw1-41/log&nbsp;&nbsp; - 2nd drive (for CP FW-1 ver =

4.1x)</FONT></FONT><FONT face=3D"Courier New,Courier"><FONT =
size=3D-1></FONT></FONT>=20

<P>Once the system has rebooted after the installation, be sure to =
install the=20
<A=20
href=3D"http://sunsolve.sun.com/pub-cgi/show.pl?target=3Dpatches/patch-ac=
cess">recommended=20
patch cluster</A> from Sun. Be sure to use your go between box to get =
the=20
patches, the firewall box should always remain on an isolated network. =
Patches=20
are <B>CRITICAL</B> to maintaining a secure firewall and should be =
updated at=20
least once a week.&nbsp; <A =
href=3D"http://www.securityfocus.com/">BUGTRAQ</A> is=20
an excellent source for following the latest bugs and exploits. =
<BR>&nbsp;=20
<P><B><FONT face=3D"Helvetica-Narrow,Arial Narrow"><FONT =
size=3D+2>Eliminating=20
Services</FONT></FONT></B> <BR>Once you have loaded the installation =
package,=20
patches, and rebooted, we are now ready to armor the operating system. =
Armoring=20
consists mainly of turning off services, adding logging, tweaking =
several files,=20
and TCP Wrappers. First we will begin with turning off services.=20
<P>By default, Solaris is a powerful operating system that executes many =
useful=20
services. However, most of these services are unneeded and pose a =
potential=20
security risk for a firewall. The first place to start is =
/etc/inetd.conf. This=20
file specifies which services the /usr/sbin/inetd daemon will listen =
for. By=20
default, /etc/inetd.conf is configured for 35 services, you only need =
two, ftp=20
and telnet. You eliminate the remaining unnecessary services by =
commenting them=20
out (<A=20
href=3D"http://www.enteract.com/~lspitz/example.html#D">example</A>).&nbs=
p; This=20
is critical, as many of the services run by inetd pose serious security =
threats,=20
such as rexd.&nbsp; Confirm what you have commented out with the =
following=20
command (this will show you all the services that were left uncommented) =

<P><FONT face=3D"Courier New,Courier"><FONT size=3D-1>&nbsp;#grep -v =
"^#"=20
/etc/inetd.conf</FONT></FONT>=20
<P>The next place to start is /etc/rc2.d and /etc/rc3.d. Here you will =
find=20
startup scripts launched by the init process. Many of these are not =
needed. To=20
stop a script from starting during the boot process, replace the capital =
S with=20
a small s. That way you can easily start the script again just by =
replacing the=20
small s with a capital S. The following scripts are not needed and pose =
serious=20
security threats to your system.=20
<P><FONT face=3D"Courier New,Courier"><FONT =
size=3D-1>/etc/rc2.d</FONT></FONT>=20
<BR><FONT face=3D"Courier New,Courier"><FONT =
size=3D-1><B>S73nfs.client</B> -=20
</FONT></FONT>used for NFS mounting a system. A firewall should never =
mount=20
another file<FONT size=3D-1> system.</FONT> <BR><FONT=20
face=3D"Courier New,Courier"><FONT=20
size=3D-1><B>S74autofs</B>&nbsp;&nbsp;&nbsp;&nbsp; - </FONT></FONT>used =
for=20
automounting, once again, a firewall should never mount another file =
system.=20
<BR><FONT face=3D"Courier New,Courier"><FONT=20
size=3D-1><B>S80lp</B>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - =

</FONT></FONT>used for printing, your firewall should never need to =
print.=20
<BR><FONT face=3D"Courier New,Courier"><FONT=20
size=3D-1><B>S88sendmail</B>&nbsp;&nbsp; - </FONT></FONT>listens for =
incoming=20
email.&nbsp; Your system can still send mail (such as alerts)&nbsp; with =
this=20
disabled. <BR><FONT face=3D"Courier New,Courier"><FONT=20
size=3D-1><B>S71rpc</B>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -=20
</FONT></FONT>portmapper daemon, a highly insecure service (required if =
you are=20
running CDE). <BR><FONT face=3D"Courier New,Courier"><FONT=20
size=3D-1><B>S99dtlogin</B>&nbsp;&nbsp;&nbsp; - </FONT></FONT>CDE =
daemon, starts=20
CDE by default=20
<P><FONT face=3D"Courier New,Courier"><FONT =
size=3D-1>/etc/rc3.d</FONT></FONT>=20
<BR><FONT face=3D"Courier New,Courier"><FONT =
size=3D-1><B>S15nfs.server</B> -=20
</FONT></FONT>used to share file systems, a bad idea for firewalls. =
<BR><FONT=20
face=3D"Courier New,Courier"><FONT=20
size=3D-1><B>S76snmpdx</B>&nbsp;&nbsp;&nbsp;&nbsp; - </FONT></FONT>snmp =
daemon=20
<P>Running any GUI (CDE or OpenWindows) is not a good idea.&nbsp; Only =
run a GUI=20
when it is absolutely required. You can disable CDE, the default GUI in =
Solaris=20
2.6, with the <B><FONT face=3D"Courier New,Courier"><FONT=20
size=3D-1>S99dtlogin</FONT></FONT></B> startup script (replace the =
capital S with=20
a small s).&nbsp; To get an idea of how many ports and services CDE =
requires,=20
type the following command when it is running.=20
<P><FONT face=3D"Courier New,Courier"><FONT size=3D-1>ps -aef | wc - =
l</FONT></FONT>=20

<P>Once you are done with the installation and have turned off =
S99dtlogin and=20
S71rpc (required to run CDE), type the command again and compare how the =
number=20
of services have decreased. The fewer services running, the =
better.&nbsp; For=20
those of you who installed the Core installation, this is not an issue, =
as the=20
GUI is not installed.=20
<P><B><FONT face=3D"Helvetica-Narrow,Arial Narrow"><FONT =
size=3D+2>Logging and=20
Tweaking</FONT></FONT></B> <BR>Once you have eliminated as many services =
as=20
possible, we want to enable logging. Most system logging occurs in =
/var/adm. We=20
want to add two additional log files there, sulog and loginlog. =
/var/adm/sulog=20
logs all su attempts, both successful and failed. This allows you to =
monitor who=20
is attempting to gain root access on your system.&nbsp; =
/var/adm/loginlog logs=20
consecutive failed login attempts. When a user attempts to login 5 =
times, and=20
all 5 attempts fail, this is logged. To enable the files, just touch the =
files=20
/var/adm/loginlog and /var/adm/sulog. Ensure both files are chmod 640, =
as they=20
contain sensitive information.=20
<P>Next comes tweaking. This involves various file administration. The =
first=20
thing we want to do is create the file /etc/issue. This file is an ASCII =
text=20
banner that appears for all telnet logins (<A=20
href=3D"http://www.enteract.com/~lspitz/example.html#A">example A</A>). =
This legal=20
warning will appear whenever someone attempts to login to your system.=20
<P>We also want to create the file /etc/ftpusers (<A=20
href=3D"http://www.enteract.com/~lspitz/example.html#B">example B</A>). =
Any=20
account listed in this file cannot ftp to the system. This restricts =
common=20
system accounts, such as root or bin, from attempting ftp sessions. The =
easiest=20
way to create this file is the command=20
<P><FONT face=3D"Courier New,Courier"><FONT size=3D-1>cat /etc/passwd | =
cut -f1 -d:=20
&gt; /etc/ftpusers</FONT></FONT>=20
<P>Ensure that any accounts that need to ftp to the firewall are NOT in =
the file=20
/etc/ftpusers.=20
<P>Also, ensure that root cannot telnet to the system. This forces users =
to=20
login to the system as themselves and then su to root. This is a system =
default,=20
but always confirm this in the file /etc/default/login, where console is =
left=20
uncommented (<A =
href=3D"http://www.enteract.com/~lspitz/example.html#C">example=20
C</A>).=20
<P>Last, I like to eliminate the telnet&nbsp; OS banner and create a =
seperate=20
banner for ftp.&nbsp; For telnet, this is easily done by creating the =
file=20
/etc/default/telnetd and adding the statement <BR><FONT=20
face=3D"Courier New,Courier"><FONT=20
size=3D-1>BANNER=3D""&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
# Eliminates the "SunOS 5.6" banner for Telnet</FONT></FONT>=20
<P>For ftp, this is easily done by creating the file /etc/default/ftpd =
and=20
adding the statement <BR><FONT face=3D"Courier New,Courier"><FONT=20
size=3D-1>BANNER=3D"WARNING:Authorized use =
only"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #=20
Warning banner for ftp.</FONT></FONT> <BR>&nbsp;=20
<P><B><FONT face=3D"Helvetica-Narrow,Arial Narrow"><FONT =
size=3D+2>Connecting to the=20
Firewall</FONT></FONT></B> <BR>It is critical that you develop a =
secured,=20
controlled way to connect to the firewall.&nbsp; Often, you need remote =
access=20
to your firewall for administration or the uploading of files, these=20
communications need to be secured&nbsp; I will discuss two options here, =
ssh and=20
TCP Wrappers.=20
<P>I prefer ssh, as it encrypts all communication between you and the=20
firewall.&nbsp; TCP Wrappers will NOT protect your network traffic from=20
sniffing.&nbsp; Users can still capture all of your <A=20
href=3D"http://www.enteract.com/~lspitz/keystrokes.txt">keystrokes</A>&nb=
sp;=20
(including passwords) on the network.&nbsp; If you are concerned about =
users=20
capturing communications to your firewall, I recommend you replace =
telnet/ftp=20
with ssh.&nbsp; ssh will encrypt all communications to your firewall, =
allowing=20
you both to upload files and administer the firewall in a secure =
manner.&nbsp;=20
ssh is similar to TCP wrappers in that it has its own layer of logging, =
and can=20
limit what systems can connect to it.&nbsp; For more information on ssh, =
you can=20
find <A href=3D"http://www.ssh.org/download.html">ssh here</A>. =
including source=20
for both ssh clients and server daemon.&nbsp; I recommend you use ssh =
version=20
1.2.7, as version 2.x has a limiting license. For 95/NT users, I highly=20
recommend <A=20
href=3D"http://www.vandyke.com/products/securecrt/index.html">SecureCRT</=
A> as a=20
ssh client.=20
<P>TCP Wrappers, while it does not encrypt, it does log and control who =
can=20
access your system.&nbsp; It is a binary that wraps itself around inetd=20
services, such as telnet or ftp. With TCP Wrappers, the system launches =
the=20
wrapper for inetd connections, logs all attempts and then verifies the =
attempt=20
against a access control list. If the connection is permitted, TCP =
Wrappers=20
hands the connection to the proper binary, such as telnet. If the =
connection is=20
rejected by the access control list, then the connection is dropped.=20
<P>Many of you may be wondering why would a firewall need TCP Wrappers, =
the=20
firewall does all that for you. The answers are simple. First, in case =
the=20
firewall is compromised or crashes, TCP Wrappers offer a second layer of =

defense. Second, and just as important, TCP Wrappers protect against =
Firewall=20
misconfigurations. I have often seen <A=20
href=3D"http://www.enteract.com/~lspitz/audit.html">firewalls =
misconfigured</A>,=20
especially in VPN situations, allowing unauthorized users access to the=20
firewall. Third, TCP Wrappers add a second layer of logging, verifying =
other=20
system logs.=20
<P>You can get TCP Wrappers from <A=20
href=3D"ftp://ftp.porcupine.org/pub/security/index.html#software">Wietse =
Venema's=20
Website.</A> Once again, be sure to use your go between system to =
retrieve and=20
compile TCP Wrappers. We do not want any compilers on the Firewall and =
we want=20
to protect the armored Solaris box within its isolated network.&nbsp; =
Once=20
downloaded, be sure to review the <A=20
href=3D"http://www.enteract.com/~lspitz/README">README</A> file first, =
it is an=20
excellent introduction to TCP Wrappers. Two options I recommend when =
compiling=20
TCP Wrappers. First, go with paranoid, as this does a reverse lookup for =
all=20
connections. Second, use the advance configuration, which is actually =
quite=20
simple. This configuration keeps all the binaries in there original =
locations,=20
which may be critical for future patches.=20
<P>Implementing TCP Wrappers will involve editing several files (these =
examples=20
are based on the advance configuration). First, once compiled, the tcpd =
binary=20
will be installed in the /usr/local/bin directory. Second, the file=20
/etc/inetd.conf must be configured for which services are to be wrapped =
(<A=20
href=3D"http://www.enteract.com/~lspitz/example.html#D">example D</A>). =
Third,=20
/etc/syslog.conf must be edited for logging tcpd (<A=20
href=3D"http://www.enteract.com/~lspitz/example.html#E">example E</A>), =
be sure to=20
touch the file /var/adm/tcpdlog . Last, the access control lists must be =

created, /etc/hosts.allow and /etc/hosts.deny (<A=20
href=3D"http://www.enteract.com/~lspitz/example.html#F">example F</A>).=20
<P>Once all the proper files have been edited and are in place, restart=20
/usr/bin/inetd with kill -HUP. This will restart the daemon with TCP =
Wrappers in=20
place. Be sure to verify both your ACLs and logging before finishing.=20
<P><B><FONT face=3D"Helvetica-Narrow,Arial Narrow"><FONT size=3D+2>For =
the Truly=20
Paranoid</FONT></FONT></B> <BR>I consider the measures discussed above=20
absolutely essential.&nbsp; By following these steps, you have greatly =
improved=20
your system's security, congratulations!&nbsp; Unfortunately, your =
system is not=20
100% secure, nor will it ever be.&nbsp; So, for the truly paranoid, I =
have added=20
some additional steps you can take.=20
<P>First we will create the wheel group.&nbsp; The wheel group is a =
group of=20
select individuals that can execute powerful commands, such as =
/usr/bin/su. By=20
limiting the people the can access these commands, you enhance the =
system=20
security.&nbsp; To create the group, vi the file /etc/group, create the =
group=20
wheel, and add the system admins to the group.&nbsp; Then identify =
critical=20
system binaries, such as /usr/bin/su.&nbsp; Change the group ownership =
to wheel,=20
and the permissions to owner and group executable only (be sure to =
maintain the=20
suid or guid bit for specific binaries).&nbsp; For /usr/bin/su, the =
commands=20
would be:=20
<P><FONT face=3D"Courier New,Courier"><FONT size=3D-1>/usr/bin/chgrp =
wheel=20
/usr/bin/su</FONT></FONT> <BR><FONT face=3D"Courier New,Courier"><FONT=20
size=3D-1>/usr/bin/chmod 4750 /usr/bin/su</FONT></FONT>=20
<P>* <B>Note</B>: (<I>Don't forget, for su there is actually another =
binary in=20
/sbin.&nbsp; For 2.6, this is called /sbin/su.static&nbsp; This is the =
same=20
thing as /usr/bin/su, however the libaries are statically linked, hence =
the=20
larger file size.&nbsp; Don't forget to change this file also </I>).=20
<P>Second, we will lock down the files .rhosts, .netrc, and=20
/etc/hosts.equiv.&nbsp; The r commands use these files to access =
systems.&nbsp;=20
To lock them down, touch the files, then change the permissions to zero, =
locking=20
them down. This way no one can create or alter the files. For example,=20
<P><FONT face=3D"Courier New,Courier"><FONT size=3D-1>/usr/bin/touch =
/.rhosts=20
/.netrc /etc/hosts.equiv</FONT></FONT> <BR><FONT=20
face=3D"Courier New,Courier"><FONT size=3D-1>/usr/bin/chmod 0 /.rhosts =
/.netrc=20
/etc/hosts.equiv</FONT></FONT>=20
<P>Also,&nbsp; we want to set the TCP initial sequence number generation =

parameters.&nbsp; By truly randomizing the initial sequence number of =
all TCP=20
connections, we protect the system against session hijacking and ip=20
spoofing.&nbsp; This is done by setting&nbsp; TCP_STRONG_ISS=3D2 in the =
file=20
/etc/default/inetinit (<A=20
href=3D"http://www.enteract.com/~lspitz/example.html#G">example =
G</A>).&nbsp; By=20
default, the system installs with a setting of 1, which is not as =
secure.=20
<P>To protect against possible buffer overflow (or stack smashing) =
attacks, add=20
the following to lines to /etc/system.=20
<P><FONT face=3D"Courier New,Courier"><FONT size=3D-1>set=20
noexec_user_stack=3D1</FONT></FONT> <BR><FONT face=3D"Courier =
New,Courier"><FONT=20
size=3D-1>set noexec_user_stack_log=3D1</FONT></FONT>=20
<P>Next, we make some modifications to the IP module.&nbsp; Add these =
commands=20
to one of your start up scripts.&nbsp; For detailed information on ndd =
and=20
tuneing ip modules for security, check out <A=20
href=3D"http://www.sun.com/blueprints/1299/network.pdf">Network Settings =
for=20
Security</A>.=20
<P><FONT face=3D"Courier New,Courier"><FONT size=3D-1>### Set kernel =
parameters for=20
/dev/ip</FONT></FONT> <BR><FONT face=3D"Courier New,Courier"><FONT =
size=3D-1>ndd=20
-set /dev/ip ip_respond_to_echo_broadcast 0</FONT></FONT> <BR><FONT=20
face=3D"Courier New,Courier"><FONT size=3D-1>ndd -set /dev/ip=20
ip_forward_directed_broadcasts 0</FONT></FONT> <BR><FONT=20
face=3D"Courier New,Courier"><FONT size=3D-1>ndd -set /dev/ip=20
ip_respond_to_timestamp 0</FONT></FONT> <BR><FONT=20
face=3D"Courier New,Courier"><FONT size=3D-1>ndd -set /dev/ip=20
ip_respond_to_timestamp_broadcast 0</FONT></FONT> <BR><FONT=20
face=3D"Courier New,Courier"><FONT size=3D-1>ndd -set /dev/ip =
ip_forward_src_routed=20
0</FONT></FONT> <BR><FONT face=3D"Courier New,Courier"><FONT =
size=3D-1>ndd -set=20
/dev/ip ip_ignore_redirect 1</FONT></FONT>=20
<P>Last thing I like to do is eliminate as many suid root binaries as =
possible.=20
suid root binaries pose a high risk, as vulnerable versions can be used =
to gain=20
root. Since this is a dedicated system with few accounts, most of the =
suid=20
binaries can be disabled or removed. To find all suid root binaries, run =
the=20
following command on your system.=20
<P><FONT face=3D"Courier New,Courier"><FONT size=3D-1>find / -type f =
-perm -4000=20
-exec ls -lL {} \; | tee -a /var/tmp/suid.txt </FONT></FONT>
<P>Once you have identifed all of the suid root binaries, you can remove =
most of=20
them by changing the permissions to '555', or deleting the binaries =
entirely.=20
For example, I eliminated the suid bit on the <A=20
href=3D"http://www.enteract.com/~lspitz/example.html#I">following =
binaries</A>=20
from a Core installation of Solaris 2.7.=20
<P><B><FONT face=3D"Helvetica-Narrow,Arial Narrow"><FONT=20
size=3D+2>Conclusion</FONT></FONT></B> <BR>We have covered some of the =
more basic=20
steps involved in armoring a Solaris box. The key to a secure system is =
having=20
the minimal software installed, with protection in layers, such as TCP =
Wrappers.=20
There are many additional steps that can be taken, such as <A=20
href=3D"http://www.fisica.uson.mx/carlos/Security/Programs/prog-full.html=
">sudo</A>=20
(allows a system administrator to give limited root privileges to user =
and log=20
their activities), <A=20
href=3D"ftp://ftp.cerias.purdue.edu/pub/tools/unix/ids/tripwire/">tripwir=
e=20
</A>(monitor changes in system binaries), and <A=20
href=3D"http://www.enteract.com/~lspitz/swatch.html">swatch =
</A>(automated log=20
monitoring and alerts). Remember, no system is truly 100% secure. =
However, with=20
the steps outlined above, you greatly reduce the security risks.=20
<P>For more information on how to better armor your Solaris system, =
check out=20
Sun Microsystems blueprint pages, specifically <A=20
href=3D"http://www.sun.com/blueprints/0100/security.pdf">Solaris =
Security</A>=20
<P>For the truly secure, I HIGHLY recommend you check out Brad Powell's =
<A=20
href=3D"http://www.fish.com/~brad/titan/Titan-Docs/TITAN_documentation.ht=
ml">armoring=20
script Titan</A>.&nbsp; This professional tool is far more powerful and =
modular=20
then what I have presented here and documents security in far greater =
detail.=20
Also, you may want to check out <A=20
href=3D"http://yassp.parc.xerox.com/">YASSP</A>, Yet Another Security =
Solaris=20
Package. <BR>&nbsp;=20
<P><FONT face=3DImpact><FONT size=3D+2>Downloads.</FONT></FONT> <BR>To =
save you the=20
time and trouble, I have created a script file that will do everything =
we have=20
discussed in this article.&nbsp; The script file will go through your =
Solaris=20
system and make all the above changes, first backing up any changed =
files.&nbsp;=20
The script will also implement TCP wrappers for you.&nbsp; This script =
detects=20
what processor you are using (Sparc or x86) and what version (2.5.1, =
2.6, 2.7,=20
and 2.8) and makes the proper changes.&nbsp; I recommend this script for =
new=20
installs only. Send comments or recommendations to <A=20
href=3D"mailto:lance@honeynet.org">lance@honeynet.org</A>=20
<P>Download <A=20
href=3D"http://www.enteract.com/~lspitz/armor-1.3.1.tar.Z">armor-1.3.1.ta=
r.Z</A>=20
<P>I used compress instead of gzip, since uncompress come with the =
Solaris=20
distribution. <BR><A =
href=3D"http://www.enteract.com/~lspitz/md5.html">MD5</A>=20
Checksum for armor-1.3.1.tar.Z =3D 45009a639877c7c4015564be97af74fa=20
<P><B><I><FONT face=3D"Helvetica-Narrow,Arial Narrow">Author's =
bio</FONT></I></B>=20
<BR><I>Lance Spitzner is currently an active member of the <A=20
href=3D"http://project.honeynet.org/">Honeynet Project</A>. He enjoys =
learning by=20
blowing up systems in his home lab. Before this, he was an <A=20
href=3D"http://www.enteract.com/~lspitz/officer.html">Tanker in the =
Rapid=20
Deployment Force,</A> where he blew up things of a different nature. You =
can=20
reach him at <A =
href=3D"mailto:lance@honeynet.org">lance@honeynet.org</A> .</I>=20
<BR><BR>
<CENTER>
<TABLE border=3D5>
  <TBODY>
  <TR>
    <TD><I><FONT size=3D+2><A=20
      href=3D"http://www.enteract.com/~lspitz/pubs.html">Whitepapers=20
      =
</A></FONT></FONT></FONT></I></TD></TR></TBODY></TABLE></CENTER></FONT></=
BODY></HTML>

