Translation completed.
This commit is contained in:
parent
354b3012b1
commit
5a33f21e40
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/www/; revision=4335
1 changed files with 302 additions and 260 deletions
|
|
@ -1,79 +1,82 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN" [
|
||||
<!ENTITY base CDATA "..">
|
||||
<!ENTITY date "$Date: 1999-02-08 19:26:12 $">
|
||||
<!ENTITY date "$Date: 1999-02-16 14:19:33 $">
|
||||
<!ENTITY title "Información de Seguridad en FreeBSD">
|
||||
<!ENTITY % includes SYSTEM "../includes.sgml"> %includes;
|
||||
]>
|
||||
<!-- $Id: security.sgml,v 1.1.1.1 1999-02-08 19:26:12 wosch Exp $ -->
|
||||
<!-- $Id: security.sgml,v 1.2 1999-02-16 14:19:33 jesusr Exp $ -->
|
||||
|
||||
<html>
|
||||
&header;
|
||||
|
||||
<H2>Introducción</H2>
|
||||
<H2>Introducción</H2>
|
||||
|
||||
<P>This web page is designed to assist both new and experienced users
|
||||
in the area of security for the FreeBSD Operating System. The FreeBSD
|
||||
Development team takes security very seriously and is constantly working
|
||||
on making the OS as secure as possible.</P>
|
||||
<P>El objetivo de esta página es orientar a los usuarios, tanto noveles
|
||||
como experimentados, en el área de seguridad del Sistema Operativo
|
||||
FreeBSD. El equipo de Desarrollo de FreeBSD se toma la seguridad muy en
|
||||
serio y trabaja constantemente para hacer el Sistema Operativo tan
|
||||
seguro como sea posible.</P>
|
||||
|
||||
<P>Here you will find additional information, or links to information,
|
||||
on how to protect your system against various types of outside attack,
|
||||
whom to contact if you find a security related bug, etc. There is
|
||||
also a section on the various ways that the systems programmer can
|
||||
become more security conscious so he or she is less likely to
|
||||
introduce security holes in the first place.</P>
|
||||
<P>Aquí podrás encontrar información adicional, o enlaces
|
||||
a información, acerca de cómo proteger tu sistema contra varios
|
||||
tipos de ataque del exterior, con quién contactar si encuentra un error
|
||||
de software relacionado con la seguridad, etc. También hay una
|
||||
sección que trata de las distintas formas en que el programador de
|
||||
sistemas puede concienciarse acerca de la seguridad, de modo que sea menos
|
||||
probable la introducción de defectos de seguridad en el software.</P>
|
||||
|
||||
<H2>Table Of Content</H2>
|
||||
<H2>Contenidos</H2>
|
||||
<UL>
|
||||
<LI><A HREF="#sec">Information about the FreeBSD Security Officer</A></LI>
|
||||
<LI><A HREF="#sec">Información acerca del FreeBSD Security Officer</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 Programing Guidelines</A></LI>
|
||||
<LI><A HREF="#misc">Other Related Security Information</A></LI>
|
||||
<LI><A HREF="#ml">Información sobre Listas de Distribución sobre seguridad en FreeBSD</A></LI>
|
||||
<LI><A HREF="#tat">Consejos sobre seguridad en FreeBSD</A></LI>
|
||||
<LI><A HREF="#spg">Pautas para la programación segura</A></LI>
|
||||
<LI><A HREF="#misc">Otra información relacionada con la seguridad</A></LI>
|
||||
</UL>
|
||||
|
||||
<A NAME=sec></A>
|
||||
<H2>The FreeBSD Security Officer</H2>
|
||||
<H2>El FreeBSD Security Officer</H2>
|
||||
|
||||
<P>To better coordinate information exchange with others in the security
|
||||
community, FreeBSD has a focal point for security related communications:
|
||||
The FreeBSD <a href="mailto:security-officer@freebsd.org">security officer</a>.
|
||||
The position is actually staffed by a team of dedicated security officers,
|
||||
their main tasks being to send out advisories when there are known security
|
||||
holes and to act on reports of possible security problems with FreeBSD.</P>
|
||||
<P>Con el objetivo de coordinar mejor el intercambio de información con
|
||||
otras personas o entidades relacionadas con el ámbito de la seguridad,
|
||||
FreeBSD tiene un punto focal para las comunicaciones relacionadas con la
|
||||
seguridad: el FreeBSD <a href="mailto:security-officer@freebsd.org">security officer</a>.
|
||||
El puesto está actualmente ocupado por un equipo de security officers
|
||||
dedicados, siendo sus tareas principales emitir advisories cuando hay
|
||||
defectos de seguridad conocidos y actuar ante los informes de posibles
|
||||
problemas de seguridad con FreeBSD.</P>
|
||||
|
||||
<P>If you need to contact someone from the FreeBSD team about a
|
||||
possible security bug, you should therefore please <A
|
||||
HREF="mailto:security-officer@FreeBSD.org">send mail to the Security Officer</A>
|
||||
with a description of what you've found and the type of vulnerability it
|
||||
represents. The Security Officers also communicate with the various
|
||||
<A HREF="http://www.cert.org">CERT </A>and <A
|
||||
HREF="http://www.first.org/"> FIRST</A> teams around the world,
|
||||
sharing information about possible vulnerabilities in FreeBSD or
|
||||
utilities commonly used by FreeBSD. The Security Officers are also
|
||||
active members of those organizations.</P>
|
||||
<P>Si necesitas contactar con alguien del equipo de FreeBSD acerca
|
||||
de un posible error de software relacionado con la seguridad por favor
|
||||
hazlo por <A HREF="mailto:security-officer@FreeBSD.org"> correo al
|
||||
Security Officer</A>, incluyendo una descripción de lo que has encontrado
|
||||
y el tipo de vulnerabilidad que representa. El Security Officer también
|
||||
está en contacto con los diferentes equipos <A HREF="http://www.cert.org">
|
||||
CERT </A>y <A HREF="http://www.first.org/"> FIRST</A> en todo el mundo,
|
||||
con los que comparte información acerca de posibles vulnerabilidades en
|
||||
FreeBSD o programas de utilidad usados por FreeBSD. Los Security Officers
|
||||
también son miembros activos de dichas organizaciones.</P>
|
||||
|
||||
<P>If you do need to contact the Security Officer about a particularly
|
||||
sensitive matter, please use their <A
|
||||
HREF="ftp://ftp.freebsd.org/pub/FreeBSD/CERT/public_key.asc">PGP key
|
||||
</A> to encrypt your message before sending it.</P>
|
||||
<P>Si necesitas contactar con el Security Officer acera de algún
|
||||
asunto especialmente delicado, usa su <A HREF="ftp://ftp.freebsd.org/pub/FreeBSD/CERT/public_key.asc">
|
||||
clave PGP</A> para encriptar el mensaje antes de enviarlo.</P>
|
||||
|
||||
<A NAME=adv></A>
|
||||
<H2>FreeBSD Security Advisories</H2>
|
||||
|
||||
<P>The FreeBSD Security Officers provide security advisories for the
|
||||
following releases of FreeBSD:</P>
|
||||
<P>Los FreeBSD Security Officers proporcionan security advisories para las
|
||||
releases de FreeBSD siguientes:</P>
|
||||
|
||||
<UL>
|
||||
<LI> The most recent official release of FreeBSD.
|
||||
<LI> La release oficial de FreeBSD más reciente.
|
||||
<LI> FreeBSD-current.
|
||||
<LI> FreeBSD-stable, when at least 2 releases are based on it.
|
||||
<LI> The previous FreeBSD-stable when a "new stable" does not yet
|
||||
have 2 releases based on it.
|
||||
<LI> FreeBSD-stable, cuando hay al menos 2 releases basadas en él.
|
||||
<LI> FreeBSD-stable anterior cuando un "nuevo stable" aun no tiene
|
||||
2 releases basadas en él.
|
||||
</UL>
|
||||
|
||||
At this time, security advisories are available for:
|
||||
En este momento hay disponibles security advisories para:
|
||||
<UL>
|
||||
<LI> FreeBSD 2.2.7
|
||||
<LI> FreeBSD 2.2.8
|
||||
|
|
@ -82,16 +85,17 @@ At this time, security advisories are available for:
|
|||
<LI> FreeBSD-stable
|
||||
</UL>
|
||||
|
||||
<P>Older releases are not maintained and users are strongly encouraged
|
||||
to upgrade to one of the supported releases mentioned above.</P>
|
||||
<P>No hay mantenimiento para releases anteriores a estas. Se recomienda
|
||||
a los usuarios se actualicen a una de las releases arriba mencionadas.
|
||||
</P>
|
||||
|
||||
<P>Like all development efforts, security fixes are first brought into
|
||||
the <A HREF="../handbook/current.html">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 then sent
|
||||
out.</P>
|
||||
<P>Como todos los esfuerzos de desarrollo, las reparaciones de seguridad
|
||||
se incorporan primero en la rama <A HREF="../../handbook/current.html">FreeBSD-current</A>.
|
||||
Después de un par de días de prueba la reparación se
|
||||
incorpora en las ramas FreeBSD-stable soportadas y se emite un advisory. </P>
|
||||
|
||||
<P>Advisories are sent to the following FreeBSD mailing lists:
|
||||
<P>Los advisories se envían a las siguientes listas de
|
||||
distribución de FreeBSD:
|
||||
<UL>
|
||||
<LI>FreeBSD-security-notifications@freebsd.org
|
||||
<LI>FreeBSD-security@freebsd.org
|
||||
|
|
@ -99,12 +103,13 @@ out.</P>
|
|||
</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:</P>
|
||||
<P>Los advisories se firman siempre usando la
|
||||
<A HREF="ftp://ftp.freebsd.org/pub/FreeBSD/CERT/public_key.asc">
|
||||
clave PGP</A> del FreeBSD Security Officer y se archivan, junto con los
|
||||
patches asociados, en nuestro
|
||||
<A HREF="ftp://ftp.freebsd.org/pub/FreeBSD/CERT/index.html">
|
||||
repositorio FTP CERT</A>. En el momento de escribir esto están
|
||||
disponibles los advisories siguientes:</P>
|
||||
|
||||
<UL>
|
||||
<LI><A HREF="ftp://ftp.freebsd.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-96:01.sliplogin.asc">FreeBSD-SA-96:01.sliplogin.asc</A></LI>
|
||||
|
|
@ -128,7 +133,7 @@ currently available:</P>
|
|||
<LI><A HREF="ftp://ftp.freebsd.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-97:02.lpd.asc">FreeBSD-SA-97:02.lpd.asc</A></LI>
|
||||
<LI><A HREF="ftp://ftp.freebsd.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-97:03.sysinstall.asc">FreeBSD-SA-97:03.sysinstall.asc</A></LI>
|
||||
<LI><A HREF="ftp://ftp.freebsd.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-97:04.procfs.asc">FreeBSD-SA-97:04.procfs.asc</A></LI>
|
||||
<LI><A HREF="ftp://ftp.freebsd.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-97:05.open.asc">FreebSD-SA-97:05.open.asc</A></LI>
|
||||
<LI><A HREF="ftp://ftp.freebsd.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-97:05.open.asc">FreeBSD-SA-97:05.open.asc</A></LI>
|
||||
<LI><A HREF="ftp://ftp.freebsd.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-97:06.f00f.asc">FreeBSD-SA-97:06.f00f.asc</A></LI>
|
||||
<LI><A HREF="ftp://ftp.freebsd.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-98:01.land.asc">FreeBSD-SA-98:01.land.asc</A></LI>
|
||||
<LI><A HREF="ftp://ftp.freebsd.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-98:02.mmap.asc">FreeBSD-SA-98:02.mmap.asc</A></LI>
|
||||
|
|
@ -141,309 +146,346 @@ currently available:</P>
|
|||
</UL>
|
||||
|
||||
<A NAME=ml></A>
|
||||
<H2>FreeBSD Security Mailing Lists Information</H2>
|
||||
<H2>Información acerca de las Listas de Distribución sobre
|
||||
Seguridad en FreeBSD</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>
|
||||
<P>Si eres administrador o usuario de uno o más sistemas FreeBSD,
|
||||
quizás quieras suscribirte a alguna de las listas siguientes:</P>
|
||||
|
||||
<PRE>
|
||||
freebsd-security General security related discussion
|
||||
freebsd-security-notification Security notifications (moderated mailing list)
|
||||
freebsd-security Discusiones relacionadas con la seguridad en general
|
||||
freebsd-security-notifications Notificaciones sobre seguridad (lista moderada)
|
||||
</PRE>
|
||||
|
||||
Send mail to <A HREF="mailto:majordomo@freebsd.org">
|
||||
majordomo@FreeBSD.ORG</A> with
|
||||
Envíe un mensaje a <A HREF="mailto:majordomo@freebsd.org">
|
||||
majordomo@FreeBSD.ORG</A> con
|
||||
<PRE>
|
||||
subscribe <listname> [<optional address>]
|
||||
subscribe <nombre_de_la_lista> [<dirección_email_opcional>]
|
||||
</PRE>
|
||||
in the body of the message in order to subscribe yourself.
|
||||
For example:
|
||||
en el cuerpo del mensaje para suscribirse.
|
||||
Por ejemplo:
|
||||
<PRE>
|
||||
% echo "subscribe freebsd-security" | mail majordomo@freebsd.org
|
||||
</PRE>
|
||||
and if you would like to unsubscribe from a mailing list:
|
||||
y si quieres desuscribirte de una lista de distribución:
|
||||
<PRE>
|
||||
% echo "unsubscribe freebsd-security" | mail majordomo@freebsd.org
|
||||
</PRE>
|
||||
|
||||
<A NAME=spg></A>
|
||||
<H2>Secure Programing Guidelines</H2>
|
||||
<H2>Pautas para la Programación Segura</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 date 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 are:
|
||||
<LI>Nunca te fíes de ninguna fuente de entrada, i.e. argumentos en la
|
||||
línea de comando, variables de entorno, ficheros de
|
||||
configuración, paquetes TCP/UDP/ICMP entrantes, argumentos de funciones,
|
||||
etc. Si la longitud o el contenido de los datos recibidos están
|
||||
sujetos, siquiera mínimamente, al control desde el exterior, el
|
||||
programa o la función debería tenerlo en cuenta cuando maneja
|
||||
dichos datos. Podemos considerar los apartados siguientes desde el punto de
|
||||
vista de la seguridad:
|
||||
|
||||
<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 - will send evil dwarfs after you.
|
||||
<LI>Llamadas a strcpy() y sprintf() para datos de longitud ilimitada.
|
||||
Usa strncpy() y snprintf() cuando la longitud sea conocida (o implementa
|
||||
algun otro método de control de límites cuando sea desconocida).
|
||||
No uses nunca gets() ni sprintf(), punto. Si lo haces, te acosarán sin
|
||||
tregua duendes malvados.<P></P></LI>
|
||||
|
||||
<LI>Si tienes que validar los datos de entrada del usuario para evitar que
|
||||
contengan caracteres erróneos de cualquier clase, NO valides la presencia
|
||||
de dichos caracteres erróneos. Simplemente verifica que la entrada
|
||||
consiste SOLO en los caracteres permitidos. La idea es: todo lo que no
|
||||
está explícitamente permitido está prohibido.
|
||||
<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.
|
||||
<LI>Lee las páginas del manual para las llamadas strncpy() y strncat().
|
||||
Asegúrate de entender cómo funcionan!!! Así como
|
||||
strncpy() puede no añadir un \0 final, strncat() sí lo
|
||||
añade.
|
||||
<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.
|
||||
<LI>Vigila el abuso de strvis() y getenv(). Con strvis() es fácil cometer
|
||||
un error con la cadena de destino, y getenv() podría devolver cadenas
|
||||
mucho más largas de lo que el programa espera. Estas dos funciones son,
|
||||
a menudo, una de las vías principales de ataque contra un programa,
|
||||
provocando que este sobreescriba la pila o las variables al recibir variables
|
||||
de entorno con valores no contemplados. Si tu programa lee variables de
|
||||
entorno, se paranoico. Se muy paranoico!
|
||||
<P></P></LI>
|
||||
|
||||
<LI>Watch for strvis() and getenv() abuse. With strvis() it is easy to get
|
||||
the destination string wrong for, 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!
|
||||
<LI>Cada vez que uses las llamadas open() o stat() pregúntate: " Y si es
|
||||
un enlace simbólico ?"
|
||||
<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(), mkstemp() and
|
||||
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:
|
||||
<LI>Asegúrate de usar mkstemp() en lugar de mktemp(), tempnam(),
|
||||
mkdtemp() y similares. Asegúrate también de buscar problemas
|
||||
de acceso concurrente en general en /tmp, teniendo en cuenta que hay muy pocas
|
||||
cosas que pueden ser atómicas en /tmp:
|
||||
<UL>
|
||||
<LI>Creating a directory. This will either succeed or fail.</LI>
|
||||
<LI>Opening a file O_CREAT | O_EXECL</LI>
|
||||
<LI>Crear un directorio. O funciona o no funciona.</LI>
|
||||
<LI>Abrir un fichero O_CREAT | O_EXECL</LI>
|
||||
</UL>
|
||||
If you use mkstemp - 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.
|
||||
Si usas mkstemp la función tratará por tí estos casos
|
||||
adecuadamente. De aquí que todos los ficheros temporales
|
||||
deberían usar mkstemp() para garantizar que no se produzcan problemas
|
||||
de acceso concurrente y que los permisos son correctos.
|
||||
<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.
|
||||
<LI>Un atacante que consiga que los paquetes vayan a/vengan de un
|
||||
sistema arbitrario tendrá el control completo de los datos que recibimos,
|
||||
por lo tanto <B>NINGUNO</B> de estos datos será de fiar.
|
||||
<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.
|
||||
<LI>Nunca dés por hecho que un fichero de configuración
|
||||
estará correctamente formateado o que habrá sido generado por
|
||||
el programa de utilidad apropiado. No confíes en que las entradas del
|
||||
usuario tales como nombres de terminal o cadenas del lenguaje estarán
|
||||
libres de '/' o '../../../' si hay la mínima posibilidad de que puedan
|
||||
ser usadas en un nombre de path. No confíes en <B>NINGUN</B> path
|
||||
proporcionado por el usuario cuando el programa se ejecuta 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.
|
||||
<LI>Busca fallos o puntos débiles en la forma de almacenar los datos.
|
||||
Todos los ficheros temporales deberían tener permisos de la forma
|
||||
600 para protegerlos de ojos curiosos.
|
||||
<P></P></LI>
|
||||
|
||||
<LI>Don't 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 then
|
||||
by abusing strcpy() and friends.
|
||||
<LI>No te limites a buscar con grep los sospechosos habituales en
|
||||
programas que se ejecutan con privilegios elevados. Busca los
|
||||
posibles desbordamientos línea a línea, hay muchísimas
|
||||
más formas de provocar un desbordamiento de memoria además de
|
||||
mediante el abuso de strcpy() y sus amigos.
|
||||
<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>
|
||||
<LI>El simple hecho de restringir privilegios en algún punto no
|
||||
significa que no haya manera de explotar el recurso en cuestión.
|
||||
El atacante podría colocar el código necesario en la pila para
|
||||
recuperar los privilegios antes de ejecutar /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.
|
||||
<LI>Administra los uid. Elimina privilegios tan pronto como sea posible,
|
||||
y elimínalos de verdad. Cambiar entre euid y uid NO es suficiente. Usa
|
||||
setuid() siempre que puedas.
|
||||
<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.
|
||||
<LI>Nunca muestres el contenido de ficheros de configuración cuando
|
||||
ocurra un error. Un número de línea y quizás un contador
|
||||
de posición es suficiente.
|
||||
Esto mismo es igualmente cierto para todas las librerías y todos los
|
||||
programas suid/gid.
|
||||
<P></P></LI>
|
||||
|
||||
<LI>Tips for those reviewing existing code for security problems:<P></P><UL>
|
||||
<LI>Consejos para quienes revisen código existente debido a problemas de
|
||||
seguridad:<P></P><UL>
|
||||
|
||||
<LI>If you are unsure of your security fixes, send them to a reviewer with
|
||||
whom you have already arrangements for a second glance over your
|
||||
code. Don't commit code you are not sure about since breaking something
|
||||
in the name of security fix is rather embarrassing.
|
||||
<LI>Si no estás seguro de tus reparaciones de seguridad, envíalas
|
||||
para ser revisadas a alguien con quien así lo hayas acordado
|
||||
previamente. No entregues código del que no estás seguro, llegar
|
||||
a estropear algo en nombre de las reparaciones de seguridad resulta bastante
|
||||
embarazoso.
|
||||
<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.
|
||||
<LI>Aquellos con privilegios de entrega ("commit") para CVS deberían
|
||||
asegurarse de que alguien con dichos privilegios esté entre los
|
||||
últimos en revisar los cambios. Dicha persona revisará e
|
||||
incorporará la versión final que se desea tener en el
|
||||
árbol.
|
||||
<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 changed should be relative to the -current branch of
|
||||
development.
|
||||
<LI>Cuando distribuyas cambios para ser revisados usa siempre diffs con
|
||||
formato context o unidiff. De este modo los diffs pueden ser fácilmente
|
||||
proporcionados como entrada a patch(1). No te limites a enviar los ficheros
|
||||
enteros. Los diffs son más fáciles de leer y aplicar al
|
||||
código fuente local (especialmente a aquel en el que podrían
|
||||
tener lugar múltiples cambios simultáneamente). Todos los cambios
|
||||
deberían referirse a la rama de desarrollo -current.
|
||||
<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 (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.
|
||||
<LI>Prueba tu mismo todos los cambios (i.e. compila y ejecuta el
|
||||
código fuente afectado) antes de enviarlos a otra persona para que los
|
||||
revise. A nadie le gusta que le envíen material averiado para revisar,
|
||||
y además produce la impresión de que el remitente ni siquiera se
|
||||
fijó en lo que estaba haciendo (lo que no contribuye precisamente a dar
|
||||
una sensación de confianza). Si necesita una cuenta en una
|
||||
máquina donde hay una versión específica que no tienes a
|
||||
mano, simplemente pregunta. El proyecto tiene recursos asignados para ese
|
||||
propósito en concreto.
|
||||
<P></P></LI>
|
||||
|
||||
<LI>Note for committers: do not forget to retrofit -current patches into
|
||||
the -stable branch as appropriate.
|
||||
<LI>Nota para los responsables de la entrega de código ("commit"): no
|
||||
se debe olvidar incorporar a la rama -stable los patches hechos sobre
|
||||
-current, de la forma que sea adecuada.
|
||||
<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
|
||||
<LI>No reescribas código innecesariamente para acomodarlo a tu estilo/
|
||||
gustos. Esto sólo hace el trabajo de quienes lo revisan más
|
||||
difícil.
|
||||
Hazlo sólo si hay razones claras para ello.</LI></UL
|
||||
<P></P></LI>
|
||||
|
||||
<LI>Look out for programs doing complex things in with signal
|
||||
handlers. Many routines in the various libraries are not sufficiently
|
||||
reentrant to make this safe.
|
||||
<LI>Busca programas que hagan cosas complicadas con los gestores de
|
||||
señales. Muchas rutinas en varias bibliotecas no son lo suficientemente
|
||||
reentrantes como para hacerlo con seguridad.
|
||||
<P></P></LI>
|
||||
|
||||
<LI>Pay special attention to realloc() usage - more often then not the
|
||||
function is not used correctly.
|
||||
<LI>Presta especial atención al uso de realloc(). Lo habitual es no
|
||||
usar la función correctamente.
|
||||
<P></P></LI>
|
||||
|
||||
<LI>When using a fixed size buffers, use sizeof() to prevent lossage
|
||||
when a buffer size is changed but the code which uses it isn't. For
|
||||
example:
|
||||
<LI>Cuando uses áreas de memoria de longitud fija use sizeof() para
|
||||
evitar pérdidas cuando se cambia el tamaño del área pero
|
||||
no el código que la usa. Por ejemplo:
|
||||
<LISTING>
|
||||
char buf[1024];
|
||||
struct foo { ... };
|
||||
...
|
||||
BAD:
|
||||
MAL:
|
||||
xxx(buf, 1024)
|
||||
xxx(yyy, sizeof(struct foo))
|
||||
GOOD:
|
||||
BIEN:
|
||||
xxx(buf, sizeof(buf))
|
||||
xxx(yyy, sizeof(yyy))
|
||||
</LISTING>
|
||||
Be careful though with sizeof of pointers when you really want the size
|
||||
of where it points to!
|
||||
Ten cuidado al aplicar sizeof a un puntero cuando lo que quieres es
|
||||
el tamaño del objeto referenciado!
|
||||
<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.
|
||||
<LI>Siempre que veas "char foo[###]", comprueba cada uso de foo para
|
||||
asegurarte de que no se desbordará. Si no puedes evitar el desbordamiento
|
||||
(se han dado casos), usa malloc como mal menor para ubicar el área de
|
||||
memoria, de este modo evitarás sobreescribir la pila.
|
||||
<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.
|
||||
<LI>Cierra siempre los descriptores de ficheros tan pronto como puedas, lo
|
||||
que hará más probable que los contenidos del área de
|
||||
memoria de entrada de stdio() sean desechados. En rutinas de biblioteca,
|
||||
dispon siempre los descriptores de ficheros que abras de modo que se cierren
|
||||
tras lanzar con éxito otro proceso.
|
||||
<P><P></LI>
|
||||
</UL>
|
||||
|
||||
<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:
|
||||
<H2>Consejos sobre seguridad en FreeBSD</H2>
|
||||
<P>Se deben ejecutar varios pasos para hacer seguro un sistema FreeBSD
|
||||
(para el caso, cualquier sistema Unix):
|
||||
<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 them
|
||||
around and 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 stripping so many sbits 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>Inhabilitar todo software potencialmente peligroso<BR><P></P>
|
||||
Gran cantidad de software debe ser ejecutado con un usuario privilegiado
|
||||
especial para poder hacer uso de recursos específicos, haciendo el
|
||||
ejecutable set-uid. Un ejemplo es el software UUCP o PPP, que hacen uso
|
||||
del puerto serie, o sendmail, que tiene que escribir en el spool de correo
|
||||
y conectar con un puerto de red privilegiado. Si no usas UUCP de poco
|
||||
sirve tener en su sistema el software asociado; sería prudente
|
||||
inhabilitarlo.
|
||||
Desde luego, esto requiere saber a ciencia cierta lo que puede ser eliminado
|
||||
y lo que no, así como tener claro si se va a necesitar o no dicha
|
||||
funcionalidad en el futuro.<BR><P></P>
|
||||
Lo mismo se puede decir de aquellos programas de utilidad que no consideres
|
||||
lo bastante útiles y que supongan un posible riesgo para la seguridad,
|
||||
como swapinfo. Si elminas el bit set-uid del ejecutable (por medio del
|
||||
comando "chmod ug-s nombre-de-fichero") siempre habrá la posibildad de
|
||||
que el usuario root pueda usar swapinfo. Sin embargo no es una buena idea
|
||||
elminar tantos sbits que se haga necesario ser root contínuamente.<BR><P></P>
|
||||
No sólo elimines programas que no uses, elimina también servicios
|
||||
que no quieras o necesites suministrar. Esto se puede hacer editando los
|
||||
ficheros <TT>/etc/inetd.conf</TT> y <TT>/etc/rc.conf</TT> e inhabilitando los
|
||||
servicios que no quieras usar.<P></P>
|
||||
|
||||
<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 could get updates on security bugs and get
|
||||
fixes. Apply the fixes immediately.<P></P>
|
||||
<LI>Reparar el software con errores que afecten a la seguridad (o cómo
|
||||
mantenerse un paso por delante de los crackers)
|
||||
<BR><P></P>
|
||||
Asegúrate de suscribirte a las diferentes <A HREF="#ml">Listas de
|
||||
ditribución sobre seguridad en FreeBSD</A> para obtener actualizaciones
|
||||
relacionadas con los errores que afectan a la seguridad y reparaciones.
|
||||
Aplica las reparaciones inmediatamente.<P></P>
|
||||
|
||||
<LI>Backups - repair your system if 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 don't contain corrupted or modified by
|
||||
attackers data.<P></P>
|
||||
<LI>Copias de seguridad. Repare su sistema si una violación de la seguridad
|
||||
llegara a ocurrir<BR><P></P>
|
||||
Disponga siempre de copias de seguridad y de una versión limpia del sistema
|
||||
operativo (por ejemplo en CD-Rom). Asegúrese de que sus copias de seguridad
|
||||
no contienen datos alterados o modificados por el atacante.<P></P>
|
||||
|
||||
<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>Instala software pare vigilar el estado del sistema<BR><P></P>
|
||||
Programas como tcp wrappers y tripwire (ambos en packages/ports) pueden
|
||||
ayudarte a monitorizar la actividad en tu sistema. Esto hace más
|
||||
fácil la detección de irrupciones. Lee también la salida
|
||||
de los scripts de /etc/security, que se ejecutan diariamente y se envían
|
||||
por correo a la cuenta root.<P></P>
|
||||
|
||||
<LI>Educating the people who work on the system<BR><P></P>
|
||||
Users should know that 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>Educa a la gente que trabaja en el sistema<BR><P></P>
|
||||
Los usuarios deberían ser conscientes de lo que hacen. Deberías
|
||||
indicarles que nunca revelen su password a nadie y que usen passwords
|
||||
difíciles de adivinar. Hazles entender que la seguridad del
|
||||
sistema/de la red está parcialmente en sus manos.<P></P>
|
||||
</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">
|
||||
<P>También hay un documento PASO a PASO ("HowTo") sobre seguridad en
|
||||
FreeBSD disponible que proporciona algunos consejos avanzados acerca de
|
||||
cómo mejorar la seguridad de su sistema. Puede ser consultado en
|
||||
<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>
|
||||
|
||||
<p>La seguridad es un proceso contínuo. Asegúrate de estar al
|
||||
día con los avances en el campo de la seguridad.</P>
|
||||
|
||||
<A NAME=misc></A>
|
||||
<H2>What to do when you detect a security compromise</H2>
|
||||
<H2>Qué hacer si detectas que la seguridad ha sido comprometida</H2>
|
||||
|
||||
<UL>
|
||||
<LI><B>Determine the level of the security breach</B><BR>
|
||||
What privileges did the attacker get? Did the attacker managed to get
|
||||
root access? Did the attacker only managed to get user level access?</LI>
|
||||
<LI><B>Determina el alcance de la violación de seguridad</B><BR>
|
||||
Qué privilegios consiguió el atacante ? Consiguió
|
||||
acceso de root ?
|
||||
Consiguió acceso sólo en el nivel de usuario ?</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>Determina si se ha alterado el estado del sistema (ámbito del
|
||||
kernel o de usuario)</B><BR>
|
||||
Qué software ha sido alterado? Se instaló un nuevo kernel ?
|
||||
Ha sido modificado alguno de los archivos binarios del sistema (tales como
|
||||
telnetd, login, etc.) ? Si sospechas que un atacante puede haber
|
||||
causado cualquier alteración en un sistema operativo, podrías
|
||||
considerar conveniente reinstalar el sistema operativo desde un medio seguro.</LI>
|
||||
|
||||
<LI><B>Find out how the break-in was done</B><BR>
|
||||
Did the breaking occur via a well know security bug? If that is the case,
|
||||
make sure to install the correct patches. Was the breaking successful due
|
||||
to a misconfiguration? Was the breakin result of a new bug? If you believe
|
||||
the breakin occurred via a new bug, you should warn the
|
||||
<A HREF="mailto:security-officer@freebsd.org"> FreeBSD Security
|
||||
<LI><B>Averigua cómo se logró la irrupción</B><BR>
|
||||
Ocurrió por medio de un error de seguridad bien conocido ? Si este es
|
||||
el caso, asegúrate de instalar los patches correctos. Tuvo éxito
|
||||
la irrupción debido a una mala configuración ? Fue el resultado
|
||||
de un error desconocido hasta el momento ? Si sospechas que la
|
||||
irrupción ocurrió por medio de un error nuevo, deberías
|
||||
advertir al <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 already compromised accounts.</LI>
|
||||
<LI><B>Repara el defecto de seguridad</B><BR>
|
||||
Instala nuevo software o aplica patches al antiguo para reparar los
|
||||
problemas. Inhabilita las cuentas que ya han sido comprometidas.</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>
|
||||
<LI><B>Otros recursos</B><BR>
|
||||
<A HREF="http://www.cert.org">CERT</A> también ofrece
|
||||
<A HREF="http://www.cert.org/nav/recovering.html">información detallada</A>
|
||||
acerca de qué pasos seguir en caso de que un sistema se vea comprometido.
|
||||
</LI>
|
||||
</UL>
|
||||
|
||||
<H2>Other Related Security Information</H2>
|
||||
<H2>Otra Información Relacionada Con La Seguridad</H2>
|
||||
<UL>
|
||||
<LI><A href="http://www.cs.purdue.edu/coast/archive/index.html">The COAST
|
||||
archive</A> contains a huge collection of security related materials.</LI>
|
||||
<LI><A href="http://www.cs.purdue.edu/coast/archive/index.html">El archivo
|
||||
COAST</A> contiene una vasta colección de materiales relacionados con la
|
||||
securidad.</LI>
|
||||
|
||||
<LI><A href="http://www.cs.purdue.edu/coast/hotlist/">The COAST Security
|
||||
Hotlist</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><A href="http://www.cs.purdue.edu/coast/hotlist/">La COAST Security
|
||||
Hotlist</A> es el lugar donde empezar a buscar materiales relacionados con
|
||||
la seguridad. Contiene cientos de enlaces útiles. Todo lo que siempre
|
||||
quiso saber sobre seguridad ... y más.</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">
|
||||
<LI>Los diferentes equipos CERT tales como <A href="http://www.cert.org">
|
||||
http://www.cert.org</A> y <A href="http://www.auscert.org.au">
|
||||
http://www.auscert.org.au</A>.</LI>
|
||||
|
||||
<LI>Mailing lists such as <A HREF="http://www.geek-girl.com/bugtraq/">
|
||||
Bugtraq</A> and <A HREF="http://www.nfr.net/forum/firewall-wizards.html">
|
||||
<LI>Listas de distribución como <A HREF="http://www.geek-girl.com/bugtraq/">
|
||||
Bugtraq</A> y <A HREF="http://www.nfr.net/forum/firewall-wizards.html">
|
||||
Firewall Wizards</A>.</LI>
|
||||
</UL>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue