Skip to content

Commit

Permalink
Baseline sysctl-17: Enable logging of martian packets
Browse files Browse the repository at this point in the history
As this feature can produce large log files, it can be disabled via 'log_martians'

Signed-off-by: Michael Geiger <[email protected]>
  • Loading branch information
mcgege committed Jul 4, 2017
1 parent cfb7e46 commit 2fbaa82
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ This Puppet module provides secure configuration of your base OS with hardening.
* `enable_ipv6_forwarding = false`
true if this system requires packet forwarding in IPv6 (eg Router), false otherwise
* `enable_ipv6 = false`
* `log_martians = true`
true to enable logging on suspicious / unroutable network packets, false otherwise **WARNING - this might generate huge log files!**
* `arp_restricted = true`
true if you want the behavior of announcing and replying to ARP to be restricted, false otherwise
* `extra_user_paths = []`
Expand Down
2 changes: 2 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
$enable_core_dump = false,
$enable_stack_protection = true,
$enable_rpfilter = true,
$log_martians = true,
) {
# Validate
# --------
Expand Down Expand Up @@ -131,6 +132,7 @@
enable_core_dump => $enable_core_dump,
enable_stack_protection => $enable_stack_protection,
enable_rpfilter => $enable_rpfilter,
log_martians => $log_martians,
}
}
}
9 changes: 8 additions & 1 deletion manifests/sysctl.pp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
$enable_core_dump = false,
$enable_stack_protection = true,
$enable_rpfilter = true,
$log_martians = true,
){

# set variables
Expand Down Expand Up @@ -161,7 +162,13 @@
sysctl { 'net.ipv4.conf.default.send_redirects': value => '0' }

# log martian packets (risky, may cause DoS)
#net.ipv4.conf.all.log_martians = 1
if $log_martians {
sysctl { 'net.ipv4.conf.all.log_martians': value => '1' }
sysctl { 'net.ipv4.conf.default.log_martians': value => '1' }
} else {
sysctl { 'net.ipv4.conf.all.log_martians': value => '0' }
sysctl { 'net.ipv4.conf.default.log_martians': value => '0' }
}


# System
Expand Down

0 comments on commit 2fbaa82

Please sign in to comment.