Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Baseline sysctl-17: Enable logging of martian packets #96

Merged
merged 1 commit into from
Jul 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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`
* `enable_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,
$enable_log_martians = true,
) {

# Validate
Expand Down Expand Up @@ -132,6 +133,7 @@
enable_core_dump => $enable_core_dump,
enable_stack_protection => $enable_stack_protection,
enable_rpfilter => $enable_rpfilter,
enable_log_martians => $enable_log_martians,
}
}

Expand Down
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,
$enable_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 $enable_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