Dmitry Teselkin | af730f9 | 2018-08-16 11:29:55 +0300 | [diff] [blame] | 1 | # 3.2.7 Ensure Reverse Path Filtering is enabled |
| 2 | # |
| 3 | # Description |
| 4 | # =========== |
| 5 | # Setting net.ipv4.conf.all.rp_filter and net.ipv4.conf.default.rp_filter to 1 |
| 6 | # forces the Linux kernel to utilize reverse path filtering on a received |
| 7 | # packet to determine if the packet was valid. Essentially, with reverse path |
| 8 | # filtering, if the return packet does not go out the same interface that the |
| 9 | # corresponding source packet came from, the packet is dropped (and logged if |
| 10 | # log_martians is set). |
| 11 | # |
| 12 | # Rationale |
| 13 | # ========= |
| 14 | # Setting these flags is a good way to deter attackers from sending your system |
| 15 | # bogus packets that cannot be responded to. One instance where this feature |
| 16 | # breaks down is if asymmetrical routing is employed. This would occur when |
| 17 | # using dynamic routing protocols (bgp, ospf, etc) on your system. If you are |
| 18 | # using asymmetrical routing on your system, you will not be able to enable |
| 19 | # this feature without breaking the routing. |
| 20 | # |
| 21 | # Audit |
| 22 | # ===== |
| 23 | # |
| 24 | # Run the following commands and verify output matches: |
| 25 | # |
| 26 | # # sysctl net.ipv4.conf.all.rp_filter |
| 27 | # net.ipv4.conf.all.rp_filter = 1 |
| 28 | # # sysctl net.ipv4.conf.default.rp_filter |
| 29 | # net.ipv4.conf.default.rp_filter = 1 |
| 30 | # |
| 31 | # Remediation |
| 32 | # =========== |
| 33 | # |
| 34 | # Set the following parameters in the /etc/sysctl.conf file: |
| 35 | # |
| 36 | # net.ipv4.conf.all.rp_filter = 1 |
| 37 | # net.ipv4.conf.default.rp_filter = 1 |
| 38 | # |
| 39 | # Run the following commands to set the active kernel parameters: |
| 40 | # |
| 41 | # # sysctl -w net.ipv4.conf.all.rp_filter=1 |
| 42 | # # sysctl -w net.ipv4.conf.default.rp_filter=1 |
| 43 | # # sysctl -w net.ipv4.route.flush=1 |
| 44 | |
| 45 | parameters: |
| 46 | linux: |
| 47 | system: |
| 48 | kernel: |
| 49 | sysctl: |
| 50 | net.ipv4.conf.all.rp_filter: 1 |
| 51 | net.ipv4.conf.default.rp_filter: 1 |