Commit 44816817 authored by kyodev's avatar kyodev

maj

parent 157f7fd8
Pipeline #48445 passed with stages
in 23 seconds
......@@ -164,11 +164,20 @@ fail2ban-client reload
vérifier:
```shell
systemctl status fail2ban.service
fail2ban-client -t
fail2ban-client -d
su
iptables -S | grep f2b
-N f2b-sshd
-A INPUT -p tcp -m multiport --dports 22 -j f2b-sshd
-A f2b-sshd -s <xyz> -j REJECT --reject-with icmp-port-unreachable
-A f2b-sshd -j RETURN
iptables -L
# target prot opt source destination
# REJECT all -- xyz anywhere reject-with icmp-port-unreachable
target prot opt source destination
REJECT all -- <xyz> anywhere reject-with icmp-port-unreachable
```
suivre les logs:
......@@ -179,6 +188,16 @@ tail -f /var/log/fail2ban.log
unban:
```shell
fail2ban-client status sshd
Status for the jail: sshd
|- Filter
| |- Currently failed: 0
| |- Total failed: 0
| `- File list: /var/log/auth.log
`- Actions
|- Currently banned: 1
|- Total banned: 1
`- Banned IP list: <xyz>
fail2ban-client unban <IP>
```
mais ne résiste pas à un restart du service fail2ban
......@@ -191,3 +210,5 @@ mais ne résiste pas à un restart du service fail2ban
* <https://wiki.debian-fr.xyz/Fail2ban>
* <https://doc.ubuntu-fr.org/fail2ban>
* <https://wiki.archlinux.org/index.php/SSH_keys>
* <https://github.com/arthepsy/ssh-audit>
* <https://github.com/jtesta/ssh-audit>
......@@ -4,8 +4,8 @@
# SC2016 Expressions don't expand in single quotes
# SC2034 variable appears unused
version=1.1.1
date="08/04/2018"
version=1.3.0
date="13/04/2018"
script=$( basename "$0" )
output="$script.md"
ligneRapport="Rapport du $(date '+%d/%m/%Y %H:%M %z')$(uname -n)$0 $*$script $version"
......@@ -22,9 +22,9 @@ if [ "$1" = "--help" ] || [ "$1" = "-h" ] ; then
exit
fi
if ! command -v curl 1>/dev/null 2>&1 ; then
if ! command -v curl >/dev/null ; then
echo "Erreur critique: curl requis mais non installé"
if command -v "dpkg" 1>/dev/null 2>&1 ; then
if command -v "dpkg" >/dev/null ; then
echo "Installer avec: apt install curl"
fi
echo
......@@ -41,32 +41,46 @@ printf "%s\n\n\n" "$ligneRapport"
echo '```'
# système, portabilité
bash --version 1>/dev/null 2>&1 && bash --version | head -n1 || echo "bash KO"
free --version 1>/dev/null 2>&1 && free --version || echo "free KO"
uptime --version 1>/dev/null 2>&1 && uptime --version || echo "uptime KO"
lsblk --version 1>/dev/null 2>&1 && lsblk --version || echo "lsblk KO"
lspci --version 1>/dev/null 2>&1 && lspci --version || echo "lspci KO"
if command -v awk >/dev/null; then
awk --version 1>/dev/null 2>&1 && awk --version | head -n1 || echo "origin et version inconnue"
else
echo "**awk KO**"
fi
bash --version 1>/dev/null 2>&1 && bash --version | head -n1 || echo "**bash KO**"
free --version 1>/dev/null 2>&1 && free --version || echo "**free KO**"
lsblk --version 1>/dev/null 2>&1 && lsblk --version || echo "**lsblk KO**"
lspci --version 1>/dev/null 2>&1 && lspci --version || echo "**lspci KO**"
if lspci -nnv 1>/dev/null 2>&1 ; then echo "lspci -nnk ok"
else
echo "lspci -nnk KO"
echo "**lspci -nnk KO**"
flag_lspci="ko"
fi
journalctl --version 1>/dev/null 2>&1 && journalctl --version || echo "journalctl KO"
xargs --version 1>/dev/null 2>&1 && xargs --version | head -n1 || echo "xargs KO"
upower --version 1>/dev/null 2>&1 || echo "upower KO"
[ -e '/etc/shells' ] && echo "/etc/shells existe" || echo "/etc/shells KO"
journalctl --version 1>/dev/null 2>&1 && echo "journalctl: "$( journalctl --version | head -n1 ) || echo "**journalctl KO**"
[ -e '/etc/shells' ] && echo "/etc/shells existe" || echo "**/etc/shells KO**"
upower --version 1>/dev/null 2>&1 || echo "**upower KO**"
uptime --version 1>/dev/null 2>&1 && uptime --version || echo "**uptime KO**"
xargs --version 1>/dev/null 2>&1 && xargs --version | head -n1 || echo "**xargs KO**"
# xorg, video
x-window-manager --version 1>/dev/null 2>&1 && x-window-manager --version | head -n1 || echo "x-window-manager KO"
xset -version 1>/dev/null 2>&1 && xset -version || echo "xset KO"
xdpyinfo -version 1>/dev/null 2>&1 && xdpyinfo -version || echo "xdpyinfo KO"
command -v glxinfo 1>/dev/null 2>&1 && echo "glxinfo ok" || echo "glxinfo KO"
xdriinfo nscreens 1>/dev/null 2>&1 || echo "xdriinfo KO"
command -v xprop 1>/dev/null 2>&1 || echo "xprop KO"
x-window-manager --version 1>/dev/null 2>&1 && echo "x-window-manager: "$( x-window-manager --version | head -n1 ) || echo "**x-window-manager KO**"
xset -version 1>/dev/null 2>&1 && xset -version || echo "**xset KO**"
xdpyinfo -version 1>/dev/null 2>&1 && xdpyinfo -version || echo "**xdpyinfo KO**"
command -v glxinfo >/dev/null && echo "glxinfo ok" || echo "**glxinfo KO**"
xdriinfo nscreens 1>/dev/null 2>&1 || echo "**xdriinfo KO**"
command -v xprop 1>/dev/null 2>&1 || echo "**xprop KO**"
# hardware
command -v acpi 1>/dev/null 2>&1 && acpi --version | head -n1 || echo "acpi KO"
command -v acpi >/dev/null && acpi --version | head -n1 || echo "**acpi KO**"
printf "%s\n\n" '```'
###############################################################################################################
# cpuinfo
echo '## cpuinfo'
printf "%s\n" '```'
awk '{if ( $0 ~ /^$/ ) {exit} else {print}}' /proc/cpuinfo 2>/dev/null || echo "/proc/cpuinfo inexistant"
printf "%s\n\n" '```'
# upower
......@@ -90,7 +104,7 @@ if xdriinfo nscreens 1>/dev/null 2>&1 ; then
fi
# xprop
if command -v xprop 1>/dev/null 2>&1; then
if command -v xprop >/dev/null 2>&1; then
# wm / compositor
id=$( xprop -root -notype _NET_SUPPORTING_WM_CHECK 2>/dev/null )
id=${id##* }
......@@ -111,11 +125,6 @@ fi
echo "## ls -l /usr/share/xsessions "
echo '```'
ls -l /usr/share/xsessions 2>/dev/null
printf "%s\n\n" '```'
# cpuinfo
echo "## vendor id cpuinfo "
echo '```'
grep -m1 -A3 'vendor_id' /proc/cpuinfo
printf "%s\n\n" '```'
# général, wm annexe
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment