Skip to content
Marcos edited this page Aug 25, 2014 · 25 revisions

redhatchecklist

This script is designed to perform a security evaluation against industry best practices, over RedHat and RedHat based systems, to detect configuration deviations. It was developed due to the need to ensure that the servers within my workplace would comply with specific policies. As this tool was designed specifically for this purpose, "lynis" was not used for the task.

If anyone wants to provide assistance with optimizing/organizing or reprogramming the "code", please let me know! :) As you will see, I still lack skills on this subject.

El script tiene como objetivo realizar una evaluación sobre un Sistema RedHat o sus derivados, en busca de desviaciones de configuración contra las mejores prácticas del mercado. El motivo de la creación del script se debió a la necesidad de cumplir ciertas normativas en los servidores donde trabajo, cabe aclarar que esta herramienta fue pensada con ese propósito y por este motivo no utilice "lynis" para la tarea.

Si alguna persona quiere ayudarme a optimizar/organizar o reprogramar el "código" es bienvenido :) ya que como verán me faltan muchos skills sobre la materia..

Análisis

El análisis esta compuesto por más de 20 fases:

  • Fase 0.0 -- Informacióel Equipo/ System information

  • Fase 1.0 -- Informacion de los usuarios del sistema / System users information

  • Fase 1.1 -- Comprobacion de Usuarios/Grupos / Users/Groups check

  • Fase 1.2 -- Verificar que no existan cuentas con password vacias / Verify that there are no accounts configured with an empty password

  • Fase 1.3 -- Verificar que no existan usuarios con ID 0 / Verify that there are no users with ID 0

  • Fase 1.4 -- Verificacion del archivo login.defs / Verify the login.defs file

  • Fase 1.5 -- Ultimos usuarios agregados / Recent added users

  • Fase 1.6 -- Configuracion PAM / PAM Configuration

  • Fase 1.7 -- Ultimos usuarios conectados / Recent user logins

  • Fase 1.8 -- Ultimos comandos ejecutados por los usuarios / Recent commands executed by users

  • Fase 1.9 -- Relaciones de confianza / Trust relationships

  • Fase 1.10 -- Usuarios con acceso al sistema / Users with system access

  • Fase 1.11 -- Verificar que no existan usuarios con Grupo ID 0 / Verify that there are no users with Group ID 0

  • Fase 2.0 -- Eventos mediante Syslog - AUTHPRIV / Syslog events - AUTHPRIV

  • Fase 2.1 -- Eventos mediante Rsyslog - AUTHPRIV / Rsyslog events - AUTHPRIV

  • Fase 3.0 -- Verificar permisos en archivos y directorios / Verify file and directory permissions

  • Fase 3.1 -- Verificacion de Sticky Bit / Verify Sticky Bit

  • Fase 3.2 -- Verificar Archivos con write para todos los usuarios / Verify files with write privilege for all users

  • Fase 3.3 -- Verificacion de suid/gsid / Verify suid/gsid

  • Fase 3.4 -- Archivos sin owner y group / Files without owner and group

  • Fase 4.0 -- Archivo de autenticacion ftp / FTP authentication file

  • Fase 5.0 -- Cierre de conexión automático / Automatic connection close

  • Fase 6.0 -- Banner personalizado / Customized banner

  • Fase 7.0 -- Verificacion de la configuracion del servicio ssh / Verify the SSH service configuration

  • Fase 8.0 -- SeLinux

  • Fase 9.0 -- IPTABLES

  • Fase 10 -- Servicios / Services

  • Fase 11 -- Procesos / Processes

  • Fase 12 -- Conexiones / Connections

  • Fase 13 -- Hash de binarios / Binary Hash

  • Fase 14 -- Configuracion de Sudoers / Sudoers configuration

  • Fase 15 -- Cron.Daily

  • Fase 16 -- Versiones de softwares / Software versions

  • Fase 17 -- Configuración de Red / Network configuration

  • Fase 17.1 -- Verificación de rutas / Route verification

  • Fase 17.2 -- Verificacion configuración sysctl / Sysctl configuration

  • Fase 18 -- Verificar el nivel de inittab / Verify the inittab level

  • Fase 18.1 -- Verificar que no este activo ctrlaltdel en inittab / Verify that ctrlaltdel is not active in inittab

  • Fase 19.0 -- Verificar configuracion samba / Samba configuration

  • Fase 20.0 -- Verificar sincronización NTP / NTP sincronization

Usage / Procedimiento de uso

  1. Modify line “27” on the “/libs/fase6.pl” file, where the "$bannerpersona" variable with the "Cable" value is, with a string located in your company’s customized banner.

  2. Modify line “33” of the “/libs/fase7.pl” file, where the "ListenAddress" variable with the '10.246' value is, with the IP addresses that should be configured.

  3. Copy the redhatchecklist.pl script and the /libs/ folder to the server that you will be analyzing.

  4. Execute the following with root privileges: [server]# perl redhatchecklist.pl

  5. Then, copy both “html” reports to the same folder in which we have the following files/directories:

  • /src/
  • /vendor/
  • demo.css
  • sprite.png
  1. Copiar al servidor el script "redhatchecklist.pl" y la carpeta /libs/.

  2. Modificar la linea "27" del archvio /libs/fase6.pl donde se encuentra la variable "$bannerpersona" con el valor "Cable" por algún string que se encuentra en el banner personalizado de su Compañia.

Modificar la linea "33" del archvio /libs/fase7.pl donde se encuentra la variable "ListenAddress" con el valor '10.246' por las direcciones IP que deben estar configuradas.

  1. Debemos copiar al servidor que sera analizando nuestro script redhatchecklist.pl y la carpeta /libs/

  2. Ejecutar con permisos de root el script.

[server]# perl redhatchecklist.pl

  1. Luego debemos copiar los 2 reportes "html" al mismo directorio donde tenemos los siguientes archivos/diretorios:
  • /src/
  • /vendor/
  • demo.css
  • sprite.png

Screenshots

  • Informe: Informe

  • Descripción de un hallazgo: Descripcion

  • Recomendación: Recomendación

Clone this wiki locally