Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente Dernière révision Les deux révisions suivantes | ||
technique:referentiel:chd-stg1-ng [2018/04/08 10:14] admin |
technique:referentiel:chd-stg1-ng [2018/05/19 20:45] admin |
||
---|---|---|---|
Ligne 33: | Ligne 33: | ||
update-grub | update-grub | ||
- | apt install arping beep bind binutils borgbackup conntrack cpufrequtils dnsutils ethtool fail2ban git gt5 htop iftop iotop iperf iperf3 ipmitool libvirt-daemon llibvirt-daemon-system lm-sensors molly-guard mtr-tiny nmap ntp nullmailer powertop psmisc qemu-kvm rsync screen sdparm smartmontools sshpass strace sysstat tcpdump tree unzip vim aspell- lvm2- mysql-common- | + | apt install arping beep bind binutils borgbackup conntrack cpufrequtils dnsutils ethtool fail2ban git gt5 htop iftop iotop iperf iperf3 ipmitool libvirt-daemon llibvirt-daemon-system lm-sensors molly-guard mtr-tiny nmap ntp nullmailer powertop psmisc qemu-kvm rsync screen sdparm smartmontools sshpass strace sudo sysstat tcpdump tree unzip vim aspell- lvm2- mysql-common- |
sensors-detect | sensors-detect | ||
Ligne 84: | Ligne 84: | ||
adduser genconf | adduser genconf | ||
passwd -dl genconf | passwd -dl genconf | ||
- | /home/genconf/.ssh/authorized_keys | ||
</code> | </code> | ||
+ | |||
+ | <file text /home/genconf/.ssh/authorized_keys> | ||
+ | command="~/.ssh/check",no-agent-forwarding,no-port-forwarding,no-pty,no-user-rc,no-X11-forwarding ssh-rsa ... www-data@chd-tls1 | ||
+ | </file> | ||
+ | |||
+ | <file bash /home/genconf/.ssh/check> | ||
+ | #!/bin/sh | ||
+ | if [ "xsudo genconf_prod" = "x$SSH_ORIGINAL_COMMAND" ] | ||
+ | then $SSH_ORIGINAL_COMMAND; | ||
+ | else echo "Rejected" | ||
+ | fi | ||
+ | </file> | ||
+ | |||
+ | <file text /etc/sudoers> | ||
+ | Defaults env_reset | ||
+ | Defaults mail_badpass | ||
+ | Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" | ||
+ | root ALL=(ALL:ALL) ALL | ||
+ | genconf ALL=(ALL:ALL) NOPASSWD:/usr/local/bin/genconf_prod | ||
+ | %sudo ALL=(ALL:ALL) ALL | ||
+ | </file> | ||
<file bash /etc/modules> | <file bash /etc/modules> | ||
Ligne 96: | Ligne 116: | ||
jc42 | jc42 | ||
w83627ehf | w83627ehf | ||
+ | </file> | ||
+ | |||
+ | <file text /etc/sensors.d/local.conf> | ||
+ | chip "w83627dhg-*" | ||
+ | ignore fan1 | ||
+ | ignore fan3 | ||
+ | ignore fan4 | ||
+ | ignore fan5 | ||
</file> | </file> | ||
Ligne 221: | Ligne 249: | ||
<file text /etc/fstab> | <file text /etc/fstab> | ||
- | / /mnt/rootfs ext4 bind 0 0 | ||
none /var/log/bind9 tmpfs uid=bind,gid=bind,mode=0750,size=30m 0 0 | none /var/log/bind9 tmpfs uid=bind,gid=bind,mode=0750,size=30m 0 0 | ||
+ | / /mnt/rootfs ext4 bind 0 0 | ||
+ | # Attention à l'ordre, le mount --bind doit être à la fin | ||
</file> | </file> | ||
Ligne 321: | Ligne 350: | ||
</file> | </file> | ||
- | <file text /root/iftoprc> | + | <file text /root/.iftoprc> |
interface: br1 | interface: br1 | ||
max-bandwidth: 10M | max-bandwidth: 10M | ||
Ligne 451: | Ligne 480: | ||
<code> | <code> | ||
configurer munin/multiping | configurer munin/multiping | ||
- | VM chd-stg2 en d9 "vierge" | ||
tester interfaces, max nfconntrack, genconf, fail2ban, nullmailer, lldpd | tester interfaces, max nfconntrack, genconf, fail2ban, nullmailer, lldpd | ||
voir si cpufreq par défaut est ok ou pas | voir si cpufreq par défaut est ok ou pas | ||
Ligne 463: | Ligne 491: | ||
Point de montage pour /var/lib/libvirt/images/ | Point de montage pour /var/lib/libvirt/images/ | ||
</code> | </code> | ||
+ | |||
+ | ===== Log association MAC ⟷ IP ===== | ||
+ | |||
+ | L'objectif est de détecter l'IP spoofing en gardant une trace de la | ||
+ | MAC usuelle associée à une IP donnée. | ||
+ | |||
+ | <file bash /var/log/mac/update.sh> | ||
+ | #!/bin/bash | ||
+ | ip n | sort | sed \ | ||
+ | -e 's/\(REACHABLE\|STALE\|DELAY\)/normal/' \ | ||
+ | -e 's/\(INCOMPLETE\|FAILED\|PROBE\)/lost/' > ip-n-sort-sed | ||
+ | git add ip-n-sort-sed | ||
+ | git commit -m "update via $0 $*" | ||
+ | </file> | ||
+ | |||
+ | <code> | ||
+ | chown -R nobody: /var/log/mac | ||
+ | </code> | ||
+ | |||
+ | <file cron /etc/cron.d/log-mac> | ||
+ | */4 * * * * nobody if [ -x /var/log/mac/update.sh ]; then cd /var/log/mac/; ./update.sh | ||
+ | </file> | ||