Cheat Sheets

Network - All Log Martians

Description

Ensures logging of all suspicious packages

Solution

echo 'net.ipv4.conf.all.log_martians=1' >/etc/sysctl.d/50-net.ipv4.conf.all.log_martians.conf && sysctl -p

Check Script: network-all-log-martians.sh

#!/bin/bash

if [[ $(/sbin/sysctl -n net.ipv4.conf.all.log_martians 2>/dev/null) == 1 ]]; then result_failed "net.ipv4.conf.all.log_martians is not 1" fi
Comment on Disqus