documentation_complete: true

prodtype: rhel7

title: 'Configure firewalld To Rate Limit Connections'

description: |-
    Create a direct firewall rule to protect against DoS attacks with the following
    command:
    <pre>$ sudo firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT_direct 0 -p tcp -m limit --limit 25/minute --limit-burst 100  -j ACCEPT</pre>

rationale: |-
    DoS is a condition when a resource is not available for legitimate users. When
    this occurs, the organization either cannot accomplish its mission or must
    operate at degraded capacity.
    <br /><br />
    This requirement addresses the configuration of
    the operating system to mitigate the impact of DoS attacks that have occurred or
    are ongoing on system availability. For each system, known and potential DoS
    attacks must be identified and solutions for each type implemented. A variety of
    technologies exist to limit or, in some cases, eliminate the effects of DoS
    attacks (e.g., limiting processes or establishing memory partitions). Employing
    increased capacity and bandwidth, combined with service redundancy, may reduce
    the susceptibility to some DoS attacks.

severity: medium

identifiers:
    cce: 80542-4

references:
    disa: 2385
    nist: ""
    srg: SRG-OS-000420-GPOS-00186
    stigid: "040510"

ocil_clause: 'firewalld is not rate limiting connections'

ocil: |-
    To verify the operating system protects against or limits the effects of DoS
    attacks by ensuring the operating system is implementing rate-limiting measures
    on impacted network interfaces, run the following command:
    <pre>$ sudo firewall-cmd --permanent --direct --get-rules ipv4 filter INPUT_direct</pre>
    The output should return:
    <pre>0 -p tcp -m limit --limit 25/minute --limit-burst 100 -j ACCEPT</pre>
