Skip to content

Disable Cockpit Management Server

An XCCDF Rule

Description

The Cockpit Management Server (cockpit) provides a web based login and management framework. The cockpit service can be disabled with the following command:
$ sudo systemctl mask --now cockpit.service

Rationale

Cockpit provides a form of remote login.

ID
xccdf_org.ssgproject.content_rule_service_cockpit_disabled
Severity
Medium
Updated

Remediation Templates

An Ansible Snippet

- name: Block Disable service cockpit
  block:
  - name: Disable service cockpit
    block:

    - name: Disable service cockpit

A Kubernetes Patch

apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
spec:
  config:
    ignition:
      version: 3.1.0

OS Build Blueprint

[customizations.services]
disabled = ["cockpit"]

A Puppet Snippet

include disable_cockpit
class disable_cockpit {
  service {'cockpit':
    enable => false,
    ensure => 'stopped',
  }
}

A Shell Script

# Remediation is applicable only in certain platforms
if [ ! -f /.dockerenv ] && [ ! -f /run/.containerenv ]; then
SYSTEMCTL_EXEC='/usr/bin/systemctl'
"$SYSTEMCTL_EXEC" stop 'cockpit.service'
"$SYSTEMCTL_EXEC" disable 'cockpit.service'
"$SYSTEMCTL_EXEC" mask 'cockpit.service'