Puppet Class: cis_security_hardening::rules::disable_sctp

Defined in:
manifests/rules/disable_sctp.pp

Summary

Ensure SCTP is disabled

Overview

The Stream Control Transmission Protocol (SCTP) is a transport layer protocol used to support message oriented communication, with several streams of messages in one connection. It serves a similar function as TCP and UDP, incorporating features of both. It is message-oriented like UDP, and ensures reliable in-sequence transport of messages with congestion control like TCP.

Rationale: If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface.

Examples:

class { 'cis_security_hardening::rules::disable_sctp':
    enforce => true,
}

Parameters:

  • enforce (Boolean) (defaults to: false)

    Enforce the rule



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'manifests/rules/disable_sctp.pp', line 22

class cis_security_hardening::rules::disable_sctp (
  Boolean $enforce = false,
) {
  if $enforce {
    case $facts['os']['name'].downcase() {
      'debian': {
        if $facts['os']['release']['major'] > '10' {
          $command = '/bin/false'
          kmod::blacklist { 'sctp': }
        } else {
          $command = '/bin/true'
        }
      }
      'ubuntu': {
        if $facts['os']['release']['major'] >= '20' {
          $command = '/bin/false'
          kmod::blacklist { 'sctp': }
        } else {
          $command = '/bin/true'
        }
      }
      default: {
        $command = '/bin/true'
      }
    }

    kmod::install { 'sctp':
      command => $command,
    }
  }
}