Created
August 10, 2023 01:21
-
-
Save spxwnmc/ea70e9728f17bfa292aa2efb39a0c215 to your computer and use it in GitHub Desktop.
hardening-pci.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
myhostname=$(hostname) | |
hostnamesindom="${myhostname%%.*}" | |
prompt="root@"${hostnamesindom}"#" | |
filename=${hostnamesindom}_bitacora_pci.txt | |
id-header(){ | |
echo -e "${prompt} date" ; date | |
echo -e "${prompt} uname -a" ; uname -a | |
} | |
2-1(){ | |
echo -e "${FUNCNAME} Siempre cambie los valores predeterminados por el proveedor y elimine o deshabilite las cuentas predeterminadas innecesarias antes de instalar un sistema en la red:\n" | |
id-header | |
echo -e "${prompt}" 'awk -F: '\'\$7 == "/bin/bash" {print}\'' /etc/passwd' ; awk -F: '$7 == "/bin/bash" {print}' /etc/passwd | |
echo | |
} | |
2-2-1(){ | |
echo -e "${FUNCNAME} Implemente sólo una función principal por servidor a fin de evitar que coexistan funciones que requieren diferentes niveles de seguridad en el mismo servidor:\n" | |
id-header | |
echo -e "${prompt} netstat -nlpt" ; netstat -nlpt | |
echo | |
} | |
2-1 | tee ${filename} | |
2-2-1 | tee -a ${filename} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment