MSK Cluster Auditor
Mindset
One-line takeaway: the verdict is always the first matching condition
in priority order — NO_ENCRYPTION beats UNAUTHENTICATED beats PUBLIC_ACCESS
beats CONFIG_GAP beats OK. Plaintext data on the wire dwarfs every other
finding because it exposes every Kafka message to network-level interception.
MSK runs managed Apache Kafka brokers inside an AWS VPC. Five dimensions
determine cluster security posture, and their severity is NOT equal:
- Encryption in-transit is the wire-level guarantee. With
ClientBroker: PLAINTEXT, every Kafka message, credential, and payload
travels unencrypted between clients and brokers. TLS_PLAINTEXT is
equally dangerous — it allows clients to choose plaintext, defeating the
encryption guarantee.
- Client authentication determines who can connect.
UNAUTHENTICATED: enabled means anyone who can reach the brokers (VPC-peered, on-prem
via Direct Connect, or internet-routed) can produce and consume without
any identity check.
- Public access exposes brokers to the internet via Elastic IPs. Even
with TLS and auth, an internet-reachable broker is an attack surface
that should not exist in most deployments.
- Broker logging is the forensic record. With all log destinations
disabled, you cannot answer "who produced what, and when" during an
incident.
- Encryption at-rest (KMS) controls key governance. MSK always
encrypts data volumes — the question is whether you control the key
(customer-managed CMK with rotation + policy) or AWS does (AWS-managed
key, no rotation control, shared across the account).
Quick reference — verdict priority matrix
| # |
Condition |
Verdict |
Priority |
| 1 |
ClientBroker: PLAINTEXT OR ClientBroker: TLS_PLAINTEXT |
NO_ENCRYPTION |
Highest |
| 2 |
ClientAuthentication.Unauthenticated.enabled: true |
UNAUTHENTICATED |
|
| 3 |
PublicAccess.Type: SERVICE_PROVIDED_EIPS |
PUBLIC_ACCESS |
|
| 4 |
All broker logging destinations disabled; OR no customer-managed KMS key (AWS-managed only) |
CONFIG_GAP |
|
| 5 |
All dimensions pass |
OK |
Lowest |
The first matching row is the final verdict — subsequent dimensions produce
additional findings in the FINDINGS list but do not change the verdict.
Pre-flight: cluster metadata gate (run before classification)
Several cluster attributes short-circuit the audit or change the
classification logic. Misclassifying them produces false positives.
| Attribute |
Value |
Effect on audit |
ClusterType |
SERVERLESS |
MSK Serverless. Encryption in-transit is ALWAYS TLS (forced), at-rest is ALWAYS encrypted with a customer-managed key by default, auth is ALWAYS IAM, public access is NOT supported. Skip Steps 1-3 (always pass). Audit only logging (Step 4). |
ClusterType |
PROVISIONED |
Proceed with full audit (Steps 1-5). |
State |
CREATING |
Cluster not yet live — skip audit, output advisory. |
State |
DELETING / FAILED |
Cluster is being torn down or failed — skip audit, output advisory. |
State |
MAINTENANCE |
Cluster is undergoing AWS-side maintenance — audit normally but note brokers may be restarting. |
EncryptionInfo |
absent |
Encryption settings unknown — this only happens on very old clusters or malformed input. Output VERDICT: CONFIG_GAP with "Encryption configuration not reported by describe-cluster — re-fetch with aws kafka describe-cluster." |
If the cluster JSON is malformed (invalid JSON, missing required fields
like ClusterArn or ClusterName), output:
CLUSTER: <name or "unknown">
VERDICT: ERROR
REASON: Cluster configuration is not valid JSON or is missing required fields — cannot classify.
REMEDIATION: Retrieve the canonical config with `aws kafka describe-cluster --cluster-arn <arn> --region <region>` and re-audit.
Process — Classification logic (apply in order, first match is the verdict)
Step 0: Expert knowledge — non-obvious MSK behaviors that change classification
Full catalog of non-obvious MSK behaviors that change classification (TLS_PLAINTEXT semantics, in-cluster encryption, Serverless defaults, public subnets, setting immutability, SASL/SCRAM secrets, mTLS/PCA, logging toggles, monitoring layers, topic configs, security groups): moved verbatim to references/advanced-patterns.md.
Load that catalog before classifying any cluster; the branch rules in Steps 1-5 assume these behaviors.
Step 1: Encryption in-transit evaluation (NO_ENCRYPTION)
Examine EncryptionInfo.EncryptionInTransit:
If ClientBroker is PLAINTEXT → NO_ENCRYPTION. All
client-to-broker traffic is unencrypted. Credentials (SASL/SCRAM),
message payloads, and topic metadata are readable by anyone with a
network tap on the path.
If ClientBroker is TLS_PLAINTEXT → NO_ENCRYPTION. Both TLS
and plaintext listeners are active. A client connecting over the
plaintext port sends everything unencrypted. The presence of a TLS
option does not compensate for the plaintext path.
If ClientBroker is TLS → encryption-in-transit dimension passes
for the client wire. Proceed to evaluate InClusterEncryption:
InClusterEncryption: false (or absent) → inter-broker traffic is
plaintext. Note as a CONFIG_GAP finding (not NO_ENCRYPTION — the
client wire is encrypted).
InClusterEncryption: true → full TLS in-transit. Dimension passes.
If EncryptionInfo or EncryptionInTransit is absent → treat as
unknown encryption. Flag as CONFIG_GAP (cannot verify encryption
posture from input).
Step 2: Client authentication evaluation (UNAUTHENTICATED)
Examine ClientAuthentication:
If Unauthenticated.Enabled: true → UNAUTHENTICATED. Any client
that can reach the broker TCP port can produce and consume without
presenting credentials. This is the Kafka equivalent of an open
database — the data is accessible to any network participant.
If Unauthenticated.Enabled: false (or Unauthenticated is absent)
→ authentication dimension passes. Note which auth modes are enabled:
Tls.Enabled: true → mTLS via ACM PCA (strongest — cryptographic
client identity).
Sasl.Iam.Enabled: true → AWS IAM auth (strong — integrates with
IAM policy governance).
Sasl.Scram.Enabled: true → SCRAM-SHA-512 via Secrets Manager
(acceptable — credential-based, no IAM integration).
If NO authentication modes are enabled AND Unauthenticated is
disabled or absent → the cluster accepts no clients. This is a
misconfiguration — note as an ERROR advisory (not a security verdict).
Step 3: Public access evaluation (PUBLIC_ACCESS)
Examine BrokerNodeGroupInfo.ConnectivityInfo.PublicAccess:
If PublicAccess.Type is SERVICE_PROVIDED_EIPS → PUBLIC_ACCESS.
MSK attaches Elastic IPs to broker ENIs. Brokers are reachable from
the internet on the client-facing ports (9092 for plaintext, 9094 for
TLS). Even with TLS and authentication, this exposes the broker
listener to global scanning, brute-force, and protocol-level CVE
exploitation.
If PublicAccess.Type is DISABLED (or ConnectivityInfo / PublicAccess
is absent) → no public access. Dimension passes.
If broker subnets are public (route table has 0.0.0.0/0 → IGW) but
PublicAccess is DISABLED → brokers still have private IPs only.
No PUBLIC_ACCESS, but note as an advisory finding (brokers in public
subnets is an anti-pattern — they should be in private subnets for
defense-in-depth).
Step 4: Logging and encryption-at-rest evaluation (CONFIG_GAP)
This step covers two sub-dimensions. If EITHER triggers, the verdict is
CONFIG_GAP (assuming Steps 1-3 did not trigger).
4a: Broker logging
Examine LoggingInfo.BrokerLogs:
If LoggingInfo is absent, or BrokerLogs is absent, or ALL
destinations (CloudWatchLogs, S3, Firehose) have Enabled: false
→ CONFIG_GAP. No broker logs are being delivered. During an
incident, you cannot reconstruct topic access, consumer group
activity, or broker-level errors.
If at least ONE destination has Enabled: true → logging dimension
passes. The cluster is delivering broker logs somewhere.
4b: Encryption at-rest (KMS key governance)
Examine EncryptionInfo.EncryptionAtRest.DataVolumeKMSKeyId:
If DataVolumeKMSKeyId is absent, empty, or references an AWS-managed
key (e.g., alias/aws/kafka) → CONFIG_GAP. Data is still
encrypted (MSK always encrypts volumes), but key rotation, key policy,
and decrypt-audit visibility are controlled by AWS, not the customer.
If DataVolumeKMSKeyId references a customer-managed CMK (a
concrete key ARN or alias) → at-rest encryption dimension passes.
Step 5: Aggregation — first match wins
The verdict is the first matching condition in priority order:
if ClientBroker is PLAINTEXT or TLS_PLAINTEXT → verdict = NO_ENCRYPTION
elif Unauthenticated.Enabled: true → verdict = UNAUTHENTICATED
elif PublicAccess.Type: SERVICE_PROVIDED_EIPS → verdict = PUBLIC_ACCESS
elif all logging disabled OR no CMK → verdict = CONFIG_GAP
else → verdict = OK
All triggered dimensions are listed as findings regardless of which
becomes the verdict.
Output format (per cluster)
CLUSTER: <cluster-name>
VERDICT: NO_ENCRYPTION | UNAUTHENTICATED | PUBLIC_ACCESS | CONFIG_GAP | OK
REASON: <1-2 sentences citing the worst finding and its step number>
FINDINGS:
- [NO_ENCRYPTION] <finding description (Step 1)>
- [CONFIG_GAP] <finding description (Step 4a/4b)>
- [OK] <dimension that passed>
REMEDIATION: <specific action per finding, or "None required" if OK>
Worked example — plaintext with no logging
CLUSTER: plaintext-broker
VERDICT: NO_ENCRYPTION
REASON: ClientBroker is PLAINTEXT — all client-to-broker traffic is
unencrypted (Step 1). Broker logging is also fully disabled (Step 4a).
FINDINGS:
- [NO_ENCRYPTION] ClientBroker: PLAINTEXT — credentials and payloads
transmitted in cleartext (Step 1)
- [CONFIG_GAP] All broker log destinations disabled (Step 4a)
REMEDIATION:
1. MSK encryption is immutable post-creation. Create a new cluster with
ClientBroker: TLS and migrate topics. This is NOT an in-place fix.
2. Enable broker logging on the replacement cluster:
aws kafka update-broker-storage --cluster-arn <arn> # (no direct CLI for
logging; use update-cluster-configuration or CloudFormation).
Anti-Patterns — NEVER
NEVER classify ClientBroker: TLS_PLAINTEXT as anything other than
NO_ENCRYPTION. The plaintext listener is active — clients can and do
connect without TLS. The existence of a TLS path does not compensate
for the open plaintext path. This is the most common MSK
misclassification.
NEVER treat ClientBroker: PLAINTEXT as "acceptable if the VPC is
private." VPC-level isolation is defense-in-depth, not a substitute
for wire-level encryption. VPC traffic is interceptable by any
compromised instance, peered network, or transit-gateway participant.
Plaintext is always NO_ENCRYPTION regardless of network topology.
NEVER apply Steps 1-3 (encryption, auth, public access) to an MSK
Serverless cluster. Serverless enforces TLS + IAM auth and cannot be
public. Applying Provisioned-audit logic produces false positives.
Check ClusterType: SERVERLESS in the pre-flight gate and skip to
Step 4.
NEVER flag missing customer-managed KMS key as NO_ENCRYPTION. MSK
ALWAYS encrypts data volumes at rest — the question is key governance
(customer-managed vs AWS-managed), not encryption presence. Missing
CMK is CONFIG_GAP, not NO_ENCRYPTION. Confusing the two produces
false-critical alerts.
NEVER assume InClusterEncryption: false is NO_ENCRYPTION. The
client wire (ClientBroker: TLS) is still encrypted. Inter-broker
plaintext is a CONFIG_GAP finding — the data crosses AZs unencrypted
between brokers, but client-to-broker TLS is intact.
NEVER classify Unauthenticated.Enabled: true as CONFIG_GAP. It is
UNAUTHENTICATED — a separate, higher-priority verdict. Unauthenticated
Kafka access means any network participant can read and write topics
without credentials. This is not a "configuration gap" — it is an open
data plane.
NEVER classify PublicAccess.Type: DISABLED as PUBLIC_ACCESS. The
DISABLED value is the explicit "off" state. An absent
ConnectivityInfo block also means no public access. Both are safe.
NEVER recommend changing ClientBroker from PLAINTEXT to TLS as an
in-place operation. MSK encryption settings are immutable after
cluster creation. The correct remediation is to create a new cluster
with TLS enabled and migrate topics/consumer groups. Stating "enable
TLS" without explaining the immutability constraint misleads operators.
NEVER conflate broker logging with Enhanced Monitoring or Open
Monitoring (Prometheus). EnhancedMonitoring controls metric
granularity (DEFAULT / PER_BROKER / PER_TOPIC_PER_BROKER). Open
Monitoring controls Prometheus scrape endpoints. Neither delivers
broker log lines. The logging dimension checks
LoggingInfo.BrokerLogs (CloudWatch / S3 / Firehose) only.
NEVER assume the absence of LoggingInfo means logging is enabled.
MSK defaults to NO broker logging on cluster creation. All four
destinations start disabled. An absent LoggingInfo block means zero
log delivery — classify as CONFIG_GAP.
NEVER recommend SASL/SCRAM as equivalent to mTLS. SCRAM uses shared
credentials stored in Secrets Manager — any client with the credential
can impersonate any identity. mTLS binds the client identity to a
certificate issued by a trusted PCA. SCRAM is acceptable; mTLS is
stronger. State the trade-off, not a false equivalence.
NEVER audit SCRAM auth without verifying the Secrets Manager secret
exists and is tagged AmazonMSK_20181101. A cluster with
Sasl.Scram.Enabled: true but no correctly tagged secret will fail
all client connections with SASL_AUTHENTICATION_FAILED. The
configuration says "SCRAM is on" but the credential store is empty —
flag this as an operational ERROR, not a security verdict.
Pre-flight safety checks (run before any remediation CLI)
Pre-flight safety checks (confirmation gate, encryption-immutability migration path, public-access blast radius, logging cost, rolling-restart propagation): moved verbatim to references/diagnostic-commands.md.
The CONFIRM gate is mandatory before any state-changing CLI — see Anti-Patterns below.
Remediation guidance
For NO_ENCRYPTION — ClientBroker PLAINTEXT or TLS_PLAINTEXT
MSK encryption settings are immutable. You cannot change
ClientBroker on an existing cluster. The remediation is:
- Create a new cluster with
ClientBroker: TLS and
InClusterEncryption: true.
- Mirror topics using MirrorMaker 2 or MSK Replicator.
- Validate consumer group offsets on the new cluster.
- Cut over producers and consumers.
- Decommission the old cluster.
Example CloudFormation snippet for the replacement cluster:
EncryptionInfo:
EncryptionInTransit:
ClientBroker: TLS
InClusterEncryption: true
If regulatory constraints require immediate cessation of plaintext
traffic, restrict the broker security group to deny inbound on port
9092 (plaintext) as an interim control while the migration proceeds.
For UNAUTHENTICATED — unauthenticated clients enabled
Disable unauthenticated access via MSK configuration. Note: this
requires a cluster configuration update and broker rolling restart:
# The client-authentication settings are part of the cluster's
# security configuration and may require cluster recreation on
# older MSK versions. On MSK 2.7.1+, update via:
aws kafka update-security --cluster-arn <arn> \
--client-authentication '{"unauthenticated": {"enabled": false}}'
Verify at least one auth mode (TLS, SASL/IAM, or SASL/SCRAM) remains
enabled BEFORE disabling unauthenticated. Locking out all clients is
an instant outage.
For PUBLIC_ACCESS — brokers exposed via Elastic IPs
Disable public access:
aws kafka update-connectivity --cluster-arn <arn> \
--connectivity-info '{"publicAccess": {"type": "DISABLED"}}'
Verify VPN, Direct Connect, or VPC peering provides client access
BEFORE disabling. All clients using the Elastic IP endpoints will
lose connectivity immediately.
Verify the change:
aws kafka describe-cluster --cluster-arn <arn> \
--query 'clusterInfo.brokerNodeGroupInfo.connectivityInfo.publicAccess'
For CONFIG_GAP — broker logging disabled
Enable at least one log destination (CloudWatch recommended for
operational visibility):
aws kafka update-broker-storage --cluster-arn <arn> # logging requires
# update-cluster-configuration or the console; CLI support varies by
# MSK API version. Use CloudFormation or the AWS Console for logging
# updates.
Set a retention policy on the log group:
aws logs put-retention-policy \
--log-group-name /aws/kafka/cluster-<id> \
--retention-in-days 90
For CONFIG_GAP — no customer-managed KMS key
- Create a customer-managed KMS key with a restrictive policy.
- This requires cluster recreation (at-rest encryption key is
immutable post-creation). Plan a migration similar to the
NO_ENCRYPTION remediation.
- On the new cluster, specify:
EncryptionInfo:
EncryptionAtRest:
DataVolumeKMSKeyId: arn:aws:kms:us-east-1:111111111111:key/<cmk-id>
For OK
- No remediation required for the current posture.
- Recommend periodic re-audit (quarterly) as Kafka versions and MSK
features evolve.
- Consider enabling Open Monitoring (Prometheus) for deeper operational
visibility if not already configured.
- Verify the MSK configuration properties do not include
auto.create.topics.enable=true or
unclean.leader.election.enable=true (these are not visible in
describe-cluster output — fetch separately with
aws kafka describe-configuration).
Recent AWS features (2024-2026)
Recent AWS features (2024-2026) affecting audit verdicts: moved verbatim to references/advanced-patterns.md.
Consult before auditing Serverless, Express-tier, or KRaft clusters.
Domain
AWS CloudOps / MSK Analytics Security & Compliance.
AWS documentation
References (load on demand)
- references/advanced-patterns.md — Step 0 expert-knowledge catalog (non-obvious MSK behaviors that change classification) and recent AWS features (2024-2026).
- references/diagnostic-commands.md — Pre-flight safety checks to run before any remediation CLI.
1---2name: msk-cluster-auditor3description: Audits Amazon MSK (Managed Streaming for Kafka) clusters for encryption in-transit (TLS between clients and brokers, inter-broker), encryption at-rest (customer-managed KMS key), client authentication (TLS/IAM/SCRAM/ unauthenticated), broker logging (CloudWatch/S3/Firehose), and public access exposure (private vs public subnets, SERVICE_PROVIDED_EIPS). Emits a deterministic categorical verdict per cluster. Use when reviewing MSK cluster security, checking Kafka encryption settings, validating client authentication modes, auditing broker logging coverage, or assessing public access exposure before production deployment.4license: Apache-2.05compatibility: Agent runtime that reads SKILL.md (Claude Code, Cursor, Windsurf, Codex, Gemini). No AWS CLI required for offline config classification. Live-account audits use aws kafka describe-cluster, aws kafka describe-configuration, and aws kafka list-clusters (AWS CLI v2, SSO or key-based credentials).6metadata:7 source: https://skillmd.com/skills/jhkchan/msk-cluster-auditor8 domain: aws-cloudops9 complexity: high10 requires_llm: 'true'11 phase: '2'12 supports_pipeline: 'true'13 entry_point: 'false'14 family: Analytics15 verdict_shape: NO_ENCRYPTION | UNAUTHENTICATED | PUBLIC_ACCESS | CONFIG_GAP | OK16 when_to_use: Reviewing an MSK cluster before production deployment, checking Kafka encryption in-transit settings, validating client authentication modes, auditing broker logging coverage, assessing public access exposure, or hardening MSK cluster security posture.17 activation_triggers: audit this MSK cluster, is my Kafka cluster encrypted, check MSK authentication, MSK unauthenticated access, is my MSK cluster public, check MSK broker logging, harden MSK cluster, Kafka plaintext broker18 invocation_schema: 'Input: either (a) an MSK cluster configuration (describe-cluster output or equivalent JSON), optionally paired with MSK configuration (Kafka broker settings), OR (b) a cluster ARN/name for live-account audit. Output: deterministic CLUSTER/VERDICT/REASON/FINDINGS/REMEDIATION block per cluster, where VERDICT is one of NO_ENCRYPTION, UNAUTHENTICATED, PUBLIC_ACCESS, CONFIG_GAP, OK.'19 version: 0.1.020 author: Jacky Chan — AWS Community Builder21 keywords: MSK, Managed Kafka, Kafka, cluster audit, encryption in-transit, TLS, encryption at-rest, KMS, client authentication, SASL, SCRAM, IAM auth, mTLS, unauthenticated, broker logging, CloudWatch, public access, plaintext, broker security, MSK Serverless, cluster hardening, TLS_PLAINTEXT22 tags: msk, kafka, security, cluster-audit, encryption, authentication, logging, public-access, audit23---2425# MSK Cluster Auditor2627## Mindset2829**One-line takeaway:** the verdict is always the **first matching condition**30in priority order — NO_ENCRYPTION beats UNAUTHENTICATED beats PUBLIC_ACCESS31beats CONFIG_GAP beats OK. Plaintext data on the wire dwarfs every other32finding because it exposes every Kafka message to network-level interception.3334MSK runs managed Apache Kafka brokers inside an AWS VPC. Five dimensions35determine cluster security posture, and their severity is NOT equal:3637- **Encryption in-transit** is the wire-level guarantee. With38 `ClientBroker: PLAINTEXT`, every Kafka message, credential, and payload39 travels unencrypted between clients and brokers. `TLS_PLAINTEXT` is40 equally dangerous — it allows clients to choose plaintext, defeating the41 encryption guarantee.42- **Client authentication** determines who can connect. `UNAUTHENTICATED:43 enabled` means anyone who can reach the brokers (VPC-peered, on-prem44 via Direct Connect, or internet-routed) can produce and consume without45 any identity check.46- **Public access** exposes brokers to the internet via Elastic IPs. Even47 with TLS and auth, an internet-reachable broker is an attack surface48 that should not exist in most deployments.49- **Broker logging** is the forensic record. With all log destinations50 disabled, you cannot answer "who produced what, and when" during an51 incident.52- **Encryption at-rest (KMS)** controls key governance. MSK always53 encrypts data volumes — the question is whether you control the key54 (customer-managed CMK with rotation + policy) or AWS does (AWS-managed55 key, no rotation control, shared across the account).5657## Quick reference — verdict priority matrix5859| # | Condition | Verdict | Priority |60|---|---|---|---|61| 1 | `ClientBroker: PLAINTEXT` OR `ClientBroker: TLS_PLAINTEXT` | **NO_ENCRYPTION** | Highest |62| 2 | `ClientAuthentication.Unauthenticated.enabled: true` | **UNAUTHENTICATED** | |63| 3 | `PublicAccess.Type: SERVICE_PROVIDED_EIPS` | **PUBLIC_ACCESS** | |64| 4 | All broker logging destinations disabled; OR no customer-managed KMS key (AWS-managed only) | **CONFIG_GAP** | |65| 5 | All dimensions pass | **OK** | Lowest |6667The first matching row is the final verdict — subsequent dimensions produce68additional findings in the FINDINGS list but do not change the verdict.6970## Pre-flight: cluster metadata gate (run before classification)7172Several cluster attributes short-circuit the audit or change the73classification logic. Misclassifying them produces false positives.7475| Attribute | Value | Effect on audit |76|---|---|---|77| `ClusterType` | `SERVERLESS` | **MSK Serverless.** Encryption in-transit is ALWAYS TLS (forced), at-rest is ALWAYS encrypted with a customer-managed key by default, auth is ALWAYS IAM, public access is NOT supported. Skip Steps 1-3 (always pass). Audit only logging (Step 4). |78| `ClusterType` | `PROVISIONED` | Proceed with full audit (Steps 1-5). |79| `State` | `CREATING` | Cluster not yet live — skip audit, output advisory. |80| `State` | `DELETING` / `FAILED` | Cluster is being torn down or failed — skip audit, output advisory. |81| `State` | `MAINTENANCE` | Cluster is undergoing AWS-side maintenance — audit normally but note brokers may be restarting. |82| `EncryptionInfo` | absent | Encryption settings unknown — this only happens on very old clusters or malformed input. Output `VERDICT: CONFIG_GAP` with "Encryption configuration not reported by describe-cluster — re-fetch with aws kafka describe-cluster." |8384**If the cluster JSON is malformed** (invalid JSON, missing required fields85like `ClusterArn` or `ClusterName`), output:8687```text88CLUSTER: <name or "unknown">89VERDICT: ERROR90REASON: Cluster configuration is not valid JSON or is missing required fields — cannot classify.91REMEDIATION: Retrieve the canonical config with `aws kafka describe-cluster --cluster-arn <arn> --region <region>` and re-audit.92```9394## Process — Classification logic (apply in order, first match is the verdict)9596### Step 0: Expert knowledge — non-obvious MSK behaviors that change classification9798Full catalog of non-obvious MSK behaviors that change classification (TLS_PLAINTEXT semantics, in-cluster encryption, Serverless defaults, public subnets, setting immutability, SASL/SCRAM secrets, mTLS/PCA, logging toggles, monitoring layers, topic configs, security groups): moved verbatim to [references/advanced-patterns.md](references/advanced-patterns.md).99Load that catalog before classifying any cluster; the branch rules in Steps 1-5 assume these behaviors.100101### Step 1: Encryption in-transit evaluation (NO_ENCRYPTION)102103Examine `EncryptionInfo.EncryptionInTransit`:1041051. If `ClientBroker` is `PLAINTEXT` → **NO_ENCRYPTION**. All106 client-to-broker traffic is unencrypted. Credentials (SASL/SCRAM),107 message payloads, and topic metadata are readable by anyone with a108 network tap on the path.1091102. If `ClientBroker` is `TLS_PLAINTEXT` → **NO_ENCRYPTION**. Both TLS111 and plaintext listeners are active. A client connecting over the112 plaintext port sends everything unencrypted. The presence of a TLS113 option does not compensate for the plaintext path.1141153. If `ClientBroker` is `TLS` → encryption-in-transit dimension passes116 for the client wire. Proceed to evaluate `InClusterEncryption`:117 - `InClusterEncryption: false` (or absent) → inter-broker traffic is118 plaintext. Note as a CONFIG_GAP finding (not NO_ENCRYPTION — the119 client wire is encrypted).120 - `InClusterEncryption: true` → full TLS in-transit. Dimension passes.1211224. If `EncryptionInfo` or `EncryptionInTransit` is absent → treat as123 unknown encryption. Flag as CONFIG_GAP (cannot verify encryption124 posture from input).125126### Step 2: Client authentication evaluation (UNAUTHENTICATED)127128Examine `ClientAuthentication`:1291301. If `Unauthenticated.Enabled: true` → **UNAUTHENTICATED**. Any client131 that can reach the broker TCP port can produce and consume without132 presenting credentials. This is the Kafka equivalent of an open133 database — the data is accessible to any network participant.1341352. If `Unauthenticated.Enabled: false` (or `Unauthenticated` is absent)136 → authentication dimension passes. Note which auth modes are enabled:137 - `Tls.Enabled: true` → mTLS via ACM PCA (strongest — cryptographic138 client identity).139 - `Sasl.Iam.Enabled: true` → AWS IAM auth (strong — integrates with140 IAM policy governance).141 - `Sasl.Scram.Enabled: true` → SCRAM-SHA-512 via Secrets Manager142 (acceptable — credential-based, no IAM integration).1431443. If NO authentication modes are enabled AND `Unauthenticated` is145 disabled or absent → the cluster accepts no clients. This is a146 misconfiguration — note as an ERROR advisory (not a security verdict).147148### Step 3: Public access evaluation (PUBLIC_ACCESS)149150Examine `BrokerNodeGroupInfo.ConnectivityInfo.PublicAccess`:1511521. If `PublicAccess.Type` is `SERVICE_PROVIDED_EIPS` → **PUBLIC_ACCESS**.153 MSK attaches Elastic IPs to broker ENIs. Brokers are reachable from154 the internet on the client-facing ports (9092 for plaintext, 9094 for155 TLS). Even with TLS and authentication, this exposes the broker156 listener to global scanning, brute-force, and protocol-level CVE157 exploitation.1581592. If `PublicAccess.Type` is `DISABLED` (or `ConnectivityInfo` / `PublicAccess`160 is absent) → no public access. Dimension passes.1611623. If broker subnets are public (route table has `0.0.0.0/0` → IGW) but163 `PublicAccess` is `DISABLED` → brokers still have private IPs only.164 No PUBLIC_ACCESS, but note as an advisory finding (brokers in public165 subnets is an anti-pattern — they should be in private subnets for166 defense-in-depth).167168### Step 4: Logging and encryption-at-rest evaluation (CONFIG_GAP)169170This step covers two sub-dimensions. If EITHER triggers, the verdict is171CONFIG_GAP (assuming Steps 1-3 did not trigger).172173#### 4a: Broker logging174175Examine `LoggingInfo.BrokerLogs`:1761771. If `LoggingInfo` is absent, or `BrokerLogs` is absent, or ALL178 destinations (`CloudWatchLogs`, `S3`, `Firehose`) have `Enabled: false`179 → **CONFIG_GAP**. No broker logs are being delivered. During an180 incident, you cannot reconstruct topic access, consumer group181 activity, or broker-level errors.1821832. If at least ONE destination has `Enabled: true` → logging dimension184 passes. The cluster is delivering broker logs somewhere.185186#### 4b: Encryption at-rest (KMS key governance)187188Examine `EncryptionInfo.EncryptionAtRest.DataVolumeKMSKeyId`:1891901. If `DataVolumeKMSKeyId` is absent, empty, or references an AWS-managed191 key (e.g., `alias/aws/kafka`) → **CONFIG_GAP**. Data is still192 encrypted (MSK always encrypts volumes), but key rotation, key policy,193 and decrypt-audit visibility are controlled by AWS, not the customer.1941952. If `DataVolumeKMSKeyId` references a customer-managed CMK (a196 concrete key ARN or alias) → at-rest encryption dimension passes.197198### Step 5: Aggregation — first match wins199200The verdict is the **first matching condition** in priority order:201202```text203if ClientBroker is PLAINTEXT or TLS_PLAINTEXT → verdict = NO_ENCRYPTION204elif Unauthenticated.Enabled: true → verdict = UNAUTHENTICATED205elif PublicAccess.Type: SERVICE_PROVIDED_EIPS → verdict = PUBLIC_ACCESS206elif all logging disabled OR no CMK → verdict = CONFIG_GAP207else → verdict = OK208```209210All triggered dimensions are listed as findings regardless of which211becomes the verdict.212213## Output format (per cluster)214215```text216CLUSTER: <cluster-name>217VERDICT: NO_ENCRYPTION | UNAUTHENTICATED | PUBLIC_ACCESS | CONFIG_GAP | OK218REASON: <1-2 sentences citing the worst finding and its step number>219FINDINGS:220 - [NO_ENCRYPTION] <finding description (Step 1)>221 - [CONFIG_GAP] <finding description (Step 4a/4b)>222 - [OK] <dimension that passed>223REMEDIATION: <specific action per finding, or "None required" if OK>224```225226### Worked example — plaintext with no logging227228```text229CLUSTER: plaintext-broker230VERDICT: NO_ENCRYPTION231REASON: ClientBroker is PLAINTEXT — all client-to-broker traffic is232unencrypted (Step 1). Broker logging is also fully disabled (Step 4a).233FINDINGS:234 - [NO_ENCRYPTION] ClientBroker: PLAINTEXT — credentials and payloads235 transmitted in cleartext (Step 1)236 - [CONFIG_GAP] All broker log destinations disabled (Step 4a)237REMEDIATION:238 1. MSK encryption is immutable post-creation. Create a new cluster with239 ClientBroker: TLS and migrate topics. This is NOT an in-place fix.240 2. Enable broker logging on the replacement cluster:241 aws kafka update-broker-storage --cluster-arn <arn> # (no direct CLI for242 logging; use update-cluster-configuration or CloudFormation).243```244245## Anti-Patterns — NEVER246247- NEVER classify `ClientBroker: TLS_PLAINTEXT` as anything other than248 NO_ENCRYPTION. The plaintext listener is active — clients can and do249 connect without TLS. The existence of a TLS path does not compensate250 for the open plaintext path. This is the most common MSK251 misclassification.252253- NEVER treat `ClientBroker: PLAINTEXT` as "acceptable if the VPC is254 private." VPC-level isolation is defense-in-depth, not a substitute255 for wire-level encryption. VPC traffic is interceptable by any256 compromised instance, peered network, or transit-gateway participant.257 Plaintext is always NO_ENCRYPTION regardless of network topology.258259- NEVER apply Steps 1-3 (encryption, auth, public access) to an MSK260 Serverless cluster. Serverless enforces TLS + IAM auth and cannot be261 public. Applying Provisioned-audit logic produces false positives.262 Check `ClusterType: SERVERLESS` in the pre-flight gate and skip to263 Step 4.264265- NEVER flag missing customer-managed KMS key as NO_ENCRYPTION. MSK266 ALWAYS encrypts data volumes at rest — the question is key governance267 (customer-managed vs AWS-managed), not encryption presence. Missing268 CMK is CONFIG_GAP, not NO_ENCRYPTION. Confusing the two produces269 false-critical alerts.270271- NEVER assume `InClusterEncryption: false` is NO_ENCRYPTION. The272 client wire (`ClientBroker: TLS`) is still encrypted. Inter-broker273 plaintext is a CONFIG_GAP finding — the data crosses AZs unencrypted274 between brokers, but client-to-broker TLS is intact.275276- NEVER classify `Unauthenticated.Enabled: true` as CONFIG_GAP. It is277 UNAUTHENTICATED — a separate, higher-priority verdict. Unauthenticated278 Kafka access means any network participant can read and write topics279 without credentials. This is not a "configuration gap" — it is an open280 data plane.281282- NEVER classify `PublicAccess.Type: DISABLED` as PUBLIC_ACCESS. The283 `DISABLED` value is the explicit "off" state. An absent284 `ConnectivityInfo` block also means no public access. Both are safe.285286- NEVER recommend changing `ClientBroker` from PLAINTEXT to TLS as an287 in-place operation. MSK encryption settings are immutable after288 cluster creation. The correct remediation is to create a new cluster289 with TLS enabled and migrate topics/consumer groups. Stating "enable290 TLS" without explaining the immutability constraint misleads operators.291292- NEVER conflate broker logging with Enhanced Monitoring or Open293 Monitoring (Prometheus). `EnhancedMonitoring` controls metric294 granularity (DEFAULT / PER_BROKER / PER_TOPIC_PER_BROKER). Open295 Monitoring controls Prometheus scrape endpoints. Neither delivers296 broker log lines. The logging dimension checks297 `LoggingInfo.BrokerLogs` (CloudWatch / S3 / Firehose) only.298299- NEVER assume the absence of `LoggingInfo` means logging is enabled.300 MSK defaults to NO broker logging on cluster creation. All four301 destinations start disabled. An absent `LoggingInfo` block means zero302 log delivery — classify as CONFIG_GAP.303304- NEVER recommend SASL/SCRAM as equivalent to mTLS. SCRAM uses shared305 credentials stored in Secrets Manager — any client with the credential306 can impersonate any identity. mTLS binds the client identity to a307 certificate issued by a trusted PCA. SCRAM is acceptable; mTLS is308 stronger. State the trade-off, not a false equivalence.309310- NEVER audit SCRAM auth without verifying the Secrets Manager secret311 exists and is tagged `AmazonMSK_20181101`. A cluster with312 `Sasl.Scram.Enabled: true` but no correctly tagged secret will fail313 all client connections with `SASL_AUTHENTICATION_FAILED`. The314 configuration says "SCRAM is on" but the credential store is empty —315 flag this as an operational ERROR, not a security verdict.316317## Pre-flight safety checks (run before any remediation CLI)318319Pre-flight safety checks (confirmation gate, encryption-immutability migration path, public-access blast radius, logging cost, rolling-restart propagation): moved verbatim to [references/diagnostic-commands.md](references/diagnostic-commands.md).320The CONFIRM gate is mandatory before any state-changing CLI — see Anti-Patterns below.321322## Remediation guidance323324### For NO_ENCRYPTION — ClientBroker PLAINTEXT or TLS_PLAINTEXT3253261. MSK encryption settings are **immutable**. You cannot change327 `ClientBroker` on an existing cluster. The remediation is:328 - Create a new cluster with `ClientBroker: TLS` and329 `InClusterEncryption: true`.330 - Mirror topics using MirrorMaker 2 or MSK Replicator.331 - Validate consumer group offsets on the new cluster.332 - Cut over producers and consumers.333 - Decommission the old cluster.3343352. Example CloudFormation snippet for the replacement cluster:336 ```yaml337 EncryptionInfo:338 EncryptionInTransit:339 ClientBroker: TLS340 InClusterEncryption: true341 ```3423433. If regulatory constraints require immediate cessation of plaintext344 traffic, restrict the broker security group to deny inbound on port345 9092 (plaintext) as an interim control while the migration proceeds.346347### For UNAUTHENTICATED — unauthenticated clients enabled3483491. Disable unauthenticated access via MSK configuration. Note: this350 requires a cluster configuration update and broker rolling restart:351 ```bash352 # The client-authentication settings are part of the cluster's353 # security configuration and may require cluster recreation on354 # older MSK versions. On MSK 2.7.1+, update via:355 aws kafka update-security --cluster-arn <arn> \356 --client-authentication '{"unauthenticated": {"enabled": false}}'357 ```3583592. Verify at least one auth mode (TLS, SASL/IAM, or SASL/SCRAM) remains360 enabled BEFORE disabling unauthenticated. Locking out all clients is361 an instant outage.362363### For PUBLIC_ACCESS — brokers exposed via Elastic IPs3643651. Disable public access:366 ```bash367 aws kafka update-connectivity --cluster-arn <arn> \368 --connectivity-info '{"publicAccess": {"type": "DISABLED"}}'369 ```3703712. Verify VPN, Direct Connect, or VPC peering provides client access372 BEFORE disabling. All clients using the Elastic IP endpoints will373 lose connectivity immediately.3743753. Verify the change:376 ```bash377 aws kafka describe-cluster --cluster-arn <arn> \378 --query 'clusterInfo.brokerNodeGroupInfo.connectivityInfo.publicAccess'379 ```380381### For CONFIG_GAP — broker logging disabled3823831. Enable at least one log destination (CloudWatch recommended for384 operational visibility):385 ```bash386 aws kafka update-broker-storage --cluster-arn <arn> # logging requires387 # update-cluster-configuration or the console; CLI support varies by388 # MSK API version. Use CloudFormation or the AWS Console for logging389 # updates.390 ```3913922. Set a retention policy on the log group:393 ```bash394 aws logs put-retention-policy \395 --log-group-name /aws/kafka/cluster-<id> \396 --retention-in-days 90397 ```398399### For CONFIG_GAP — no customer-managed KMS key4004011. Create a customer-managed KMS key with a restrictive policy.4022. This requires cluster recreation (at-rest encryption key is403 immutable post-creation). Plan a migration similar to the404 NO_ENCRYPTION remediation.4053. On the new cluster, specify:406 ```yaml407 EncryptionInfo:408 EncryptionAtRest:409 DataVolumeKMSKeyId: arn:aws:kms:us-east-1:111111111111:key/<cmk-id>410 ```411412### For OK4134141. No remediation required for the current posture.4152. Recommend periodic re-audit (quarterly) as Kafka versions and MSK416 features evolve.4173. Consider enabling Open Monitoring (Prometheus) for deeper operational418 visibility if not already configured.4194. Verify the MSK configuration properties do not include420 `auto.create.topics.enable=true` or421 `unclean.leader.election.enable=true` (these are not visible in422 describe-cluster output — fetch separately with423 `aws kafka describe-configuration`).424425## Recent AWS features (2024-2026)426427Recent AWS features (2024-2026) affecting audit verdicts: moved verbatim to [references/advanced-patterns.md](references/advanced-patterns.md).428Consult before auditing Serverless, Express-tier, or KRaft clusters.429430## Domain431432AWS CloudOps / MSK Analytics Security & Compliance.433434## AWS documentation435436- **Amazon Managed Streaming for Kafka Developer Guide** — https://docs.aws.amazon.com/msk/latest/developerguide/what-is-msk.html437- **MSK API Reference** — https://docs.aws.amazon.com/msk/latest/APIReference/438- **MSK Security** — https://docs.aws.amazon.com/msk/latest/developerguide/security.html439- **MSK CLI Reference** — https://docs.aws.amazon.com/cli/latest/reference/kafka/440- **MSK Serverless** — https://docs.aws.amazon.com/msk/latest/developerguide/serverless.html441442## References (load on demand)443444- [references/advanced-patterns.md](references/advanced-patterns.md) — Step 0 expert-knowledge catalog (non-obvious MSK behaviors that change classification) and recent AWS features (2024-2026).445- [references/diagnostic-commands.md](references/diagnostic-commands.md) — Pre-flight safety checks to run before any remediation CLI.446