3.1.4 Ensure SCTP is disabled - blacklist

Information

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.

Solution

Run the following script to disable sctp:

#!/usr/bin/env bash

{
l_mname='sctp' # set module name
# Check if the module exists on the system
if [ -z '$(modprobe -n -v '$l_mname' 2>&1 | grep -Pi -- 'h*modprobe:h+FATAL:h+Moduleh+$l_mnameh+noth+foundh+inh+directory')' ]; then
# Remediate loadable
l_loadable='$(modprobe -n -v '$l_mname')'
[ '$(wc -l <<< '$l_loadable')' -gt '1' ] && l_loadable='$(grep -P -- '(^h*install|b$l_mname)b' <<< '$l_loadable')'
if ! grep -Pq -- '^h*install /bin/(true|false)' <<< '$l_loadable'; then
echo -e ' - setting module: '$l_mname' to be not loadable'
echo -e 'install $l_mname /bin/false' >> /etc/modprobe.d/'$l_mname'.conf
fi
# Remediate loaded
if lsmod | grep '$l_mname' > /dev/null 2>&1; then
echo -e ' - unloading module '$l_mname''
modprobe -r '$l_mname'
fi
# Remediate deny list
if ! modprobe --showconfig | grep -Pq -- '^h*blacklisth+$l_mnameb'; then
echo -e ' - deny listing '$l_mname''
echo -e 'blacklist $l_mname' >> /etc/modprobe.d/'$l_mname'.conf
fi
else
echo -e ' - Nothing to remediate
- Module '$l_mname' doesn't exist on the system'
fi
}

See Also

https://workbench.cisecurity.org/files/4115

Item Details

Category: CONFIGURATION MANAGEMENT

References: 800-53|CM-6, 800-53|CM-7, CSCv7|9.2

Plugin: Unix

Control ID: d02b28353e9b380c1772fdeba539e153b7baeb91d558243be62b3ee6bb9f4a21