TMAegis
More rules for cassandra

Apache Cassandra

TMA-CASSANDRA-1.1

Ensure a separate user and group exist for Cassandra

MediumLevel 1Automatedcassandra

Description

Create separate userid and group for Cassandra. The benchmark rates this recommendation Manual; the automated check covers its objective pass criterion. Passes when the cassandra group and user exist and the user is a member (primary or supplementary) of the group.

How it is checked

Audit method: Shell command

shell
g=$(getent group cassandra) || exit 1; u=$(getent passwd cassandra) || exit 1; gid=$(printf '%s' "$g" | cut -d: -f3); ugid=$(printf '%s' "$u" | cut -d: -f4); members=$(printf '%s' "$g" | cut -d: -f4); if [ "$gid" = "$ugid" ] || printf '%s' ",$members," | grep -q ',cassandra,'; then echo compliant; else echo 'user not in group'; fi
Expected output
compliant

How it is fixed

Fix method: Guidance or infrastructure patch

groupadd cassandra; useradd -m -d /home/cassandra -s /bin/bash -g cassandra -u <UID> cassandra (use an unused UID).

Properties

Operating systems
Any
Tags
cassandraservice-account
Reference
CIS Apache Cassandra 5.0 Benchmark v1.1.0 - 1.1 Ensure a separate user and group exist for Cassandra

Check this host

Run this on a machine you are allowed to audit. The scan is read-only.

shell
tmaegis scan --target cassandra