A compromised message broker lets an attacker read, forge, replay or delete the events that other systems act on, and it usually holds credentials for hundreds of producers, consumers and connectors. Brokers and event streaming platforms sit between applications, so an intrusion is rarely contained to the broker: poisoned messages trigger payments, orders, device commands and data loads downstream, and connector credentials open the databases and SaaS systems the platform syncs with. This vendor-neutral playbook is for platform, integration and incident response teams. It covers how the compromise shows up, triage questions, containment in priority order, credential rotation for the common authentication methods, restoring data integrity, evidence and notification. Hardening is covered in Securing the message broker and event streaming platform itself.
Key takeaways
- The broker is an identity hub for machines. Every producer, consumer, connector, bridge and admin tool authenticates to it, so a broker compromise is a non-human identity incident first.
- Revoking a credential does not always end a session. Long-lived connections and persistent sessions can outlive a revoked token or password, so plan to force disconnects after every rotation.
- Integrity matters as much as confidentiality. Injected or replayed messages may already have been processed; you need a list of consumers that acted on suspect data and a way to reprocess.
- Retention is a clock. Topic and queue contents are evidence, and retention or acknowledgement can delete them, so snapshot before you change settings.
- Connectors widen the blast radius. Credentials stored in connector and bridge configuration reach source and target systems, and they must be rotated at those systems, not just in the broker.
Why a broker compromise is different
Brokers move data between systems that trust each other implicitly. A consumer typically trusts that a message on its topic or queue came from an authorised producer, so a single forged event can cause real-world actions. The protocols also authenticate the connection rather than each message. In AMQP 1.0 (OASIS Standard, Part 5: Security), authentication and encryption are negotiated as TLS and SASL layers when the connection opens; MQTT 5.0 (OASIS Standard) works on the same connection-oriented model, with session state that can persist after the network connection closes. Nothing in either protocol by itself proves who wrote a given payload once a client is connected.
Brokers also hold more credentials than most teams realise: client passwords or salted verifiers, TLS private keys for listeners, certificate authority keys for client certificates, OAuth client secrets for token-based authentication, inter-broker and replication credentials, and the database, storage and SaaS credentials inside connector configurations. See the Non-Human Identity (NHI) Guide for why these machine credentials need owners and lifecycles.
How the compromise shows up
| Signal | What it usually means | ATT&CK |
|---|---|---|
| Clients connecting with valid credentials from unknown hosts or networks | Stolen client credential or certificate | T1078.004 Cloud Accounts (managed services), T1552.001 Credentials In Files |
| New consumer groups or subscriptions on sensitive topics or queues | Bulk reading of event data | T1213 Data from Information Repositories |
| Messages with unexpected producers, schemas or volumes; consumers failing on malformed data | Injected or tampered events | T1565.002 Transmitted Data Manipulation |
| Access control lists, users or listeners changed outside change control | Admin compromise and persistence | T1098 Account Manipulation |
| Connectors or bridges created that send data to new destinations | Automated exfiltration through the platform | T1020 Automated Exfiltration, T1567 Exfiltration Over Web Service |
| Topics deleted, retention cut to near zero, or offsets reset | Destruction or covering tracks | T1485 Data Destruction |
| Legitimate clients repeatedly disconnected with "session taken over" (MQTT reason code 0x8E) | Another connection is using the same client identifier | T1078 Valid Accounts |
| Plaintext listeners enabled or TLS removed between brokers | Preparing to capture traffic | T1040 Network Sniffing, T1557 Adversary-in-the-Middle |
Triage: questions to answer first
- What level of access? A single client credential, an admin or superuser credential, the broker host or cluster, the management interface, or the managed service account that controls the cluster. Each needs a different scope.
- Which topics, queues, exchanges or virtual hosts could that identity read and write? Export the access control lists as they stand now and compare them with your last known-good baseline.
- Which consumers act on that data? List the services that consume affected destinations and what they do: payments, provisioning, device control, data warehouse loads, alerts.
- What credentials does the platform hold? Listener keys, client credential stores, connector secrets, schema registry credentials, replication links to other clusters or sites.
- How long is data retained? Note retention and acknowledgement behaviour so you know how long evidence will survive.
- Is the attacker still connected? List active connections and sessions, including persistent sessions that will resume when a client reconnects.
Decision: the incident lead sets severity. Critical if an admin credential, the credential store, a listener private key or a connector with production database or SaaS rights is exposed, or if forged messages reached a consumer that acts in the physical or financial world.
Containment in priority order
- Preserve evidence. Snapshot affected topics and queues (or extend retention on them before anything else changes), export broker audit and authorisation logs, connection logs, access control lists, user lists, connector configuration with secrets redacted, and host images for self-managed brokers. Store copies outside the platform.
- Protect consumers that act on data. Pause the highest-impact consumers or switch them to a hold mode, so forged events stop causing actions while you investigate. This is often more urgent than locking the attacker out.
- Block the attacker's identities. Add explicit deny rules or remove the compromised principals from access control lists, then disable or delete the credentials.
- Force disconnects. Close the attacker's live connections and clear their persistent sessions. RFC 7628 notes that a connection authenticated with an OAuth bearer token can outlive the token and that resource servers may disconnect clients, so do not rely on expiry.
- Close extra doors. Disable listeners, management interfaces and anonymous access that are not needed, and restrict admin interfaces to a management network.
- Freeze connectors and bridges. Pause connectors and cross-cluster replication whose configuration the attacker could read or change, then rotate their credentials at the source and target systems.
Credential rotation by authentication method
How you rotate depends on how clients authenticate. Treat every credential the compromised identity could read as exposed.
| Method | What an attacker gets | Rotation action |
|---|---|---|
| Username and password (SASL PLAIN over TLS) | Reusable password | Reset per client; check whether the same password is used elsewhere |
| Salted challenge-response (SCRAM, RFC 5802) | If the credential store is stolen: salt, iteration count, StoredKey and ServerKey | RFC 5802 says stolen stored data allows offline password guessing, and with one observed exchange, impersonation to other servers using the same values; reset passwords and use new salts |
| OAuth bearer tokens (SASL OAUTHBEARER, RFC 7628) | Access tokens, or client secrets used to get them | Rotate client secrets at the authorisation server, revoke refresh tokens, then force disconnects; RFC 7628 requires TLS to protect the token |
| Client certificates (mutual TLS) | Private keys of client identities | Revoke and reissue; if the issuing CA key was on the broker host, replace the CA and the trust store on every broker. See the mTLS Guide |
| Listener TLS certificates | Server private key, enabling impersonation of the broker | Reissue with new keys and revoke the old certificates |
| Connector and bridge secrets | Database, storage, SaaS and other cluster credentials | Rotate at each target system, then update the connector |
| Managed service control plane access | Ability to change the cluster, its network and its users | Follow the cloud provider's account playbook, for example the Cloud Credential Compromise Playbook |
Rotation at broker scale is a coordination problem: hundreds of services may share one credential. Use the Credential Rotation at Scale approach, and move away from shared credentials during the rebuild so the next incident can be scoped per client.
Restoring data integrity
A broker incident is not over when the attacker is out. You also need to know what the attacker wrote and what it caused.
- Bound the window: use connection and authorisation logs to find the first and last activity by attacker identities.
- Identify suspect messages: filter by producer identity, client identifier, source address, schema and headers. Where producers sign payloads or add a verifiable producer field, use that to separate genuine from forged events.
- Find consumer impact: for each consumer that read suspect messages, record what actions it took and whether they are reversible.
- Purge persistent artefacts: in MQTT, retained messages are stored by the server and delivered to new subscribers, and a will message can be set to be published as retained, so clear retained messages the attacker planted. Remove sessions created with a very long Session Expiry Interval (0xFFFFFFFF means the session never expires).
- Reprocess: where consumers track their position, reset offsets or replay from a clean snapshot after removing suspect messages, and only once consumers are idempotent or the duplicate effect is understood.
Rebuild or clean in place
| Option | When to choose it | Trade-off |
|---|---|---|
| Clean in place | Only client credentials were stolen; no admin, host or credential store access | Fast; needs complete access control list and session review |
| Rebuild cluster, migrate topics | Admin credentials, broker hosts or the credential store were accessed | Longer outage or dual-running period; removes host and configuration persistence |
| Fail over to a standby cluster | A clean, independently credentialed standby exists | Only safe if replication did not carry the attacker's changes or credentials |
Small teams running one broker for a few applications can usually reset credentials and clean in place within a day. Large event platforms serving many business units should rebuild in waves: high-impact consumers and their producers first, analytics and logging flows last.
- Stand up the cleaned or rebuilt cluster with plaintext and anonymous listeners disabled, TLS on every listener (AMQP's dedicated TLS port is 5671) and per-client identities.
- Apply access control lists from a reviewed baseline, deny by default.
- Reissue credentials per client and connector, and record an owner for each.
- Migrate one producer and consumer pair as a pilot; check message flow and audit logs.
- Migrate remaining flows in rings, keeping the old cluster read-only for rollback until all consumers confirm.
- Decommission the old cluster and destroy its credential stores and keys.
Evidence and notification
- Broker: authentication and authorisation logs, connection logs, admin changes, access control list history, consumer group and offset history.
- Data: topic and queue snapshots for the window, retained messages, dead-letter queues.
- Hosts: disk and memory images for self-managed brokers, configuration files, keystores.
- Connectors: configuration history and the target systems' own logs.
Event streams often carry personal data. If personal data was accessed or altered, GDPR Article 33 requires the controller to notify the supervisory authority without undue delay and, where feasible, within 72 hours of becoming aware, unless the breach is unlikely to result in a risk to individuals; a processor running the platform for others must notify the controller without undue delay. Under NIS2, entities in scope must send an early warning within 24 hours and an incident notification within 72 hours of becoming aware of a significant incident. See the Data Breach Notification Checklist.
Detection and measurement
- Alert on: new principals or access control entries; new consumer groups on sensitive destinations; connections from outside expected networks; admin API use outside change windows; connector creation; retention changes and topic deletion; repeated session takeovers.
- Metrics: percentage of clients with their own credential rather than a shared one; percentage of listeners with TLS and no anonymous access (target 100); time to force-disconnect a named client in an exercise; age of the oldest client credential; number of connectors without a named owner; percentage of high-impact topics with producer identity checks in consumers.
Common failure patterns
- Rotating without disconnecting. The attacker's existing connection or persistent session keeps working after the password or token changes.
- One credential for everything. A shared client account makes it impossible to tell attacker traffic from real producers or to rotate without a full outage.
- Ignoring the consumers. Teams clean the broker but never check which payments, orders or device commands were triggered by forged events.
- Losing evidence to retention. Short retention or acknowledgement deletes the attacker's messages before anyone copies them.
- Forgetting connector credentials. Database and SaaS credentials in connector configs stay valid long after the broker is rebuilt. See the secrets manager compromise playbook for handling the secrets store side.
- Replicating the compromise. Failing over to a standby that copied the attacker's users and access control lists.
Framework mapping
| Activity | NIST CSF 2.0 | NIST SP 800-53 Rev. 5 |
|---|---|---|
| Triage and manage the incident | RS.MA, RS.AN | IR-4 Incident Handling, IR-5 Incident Monitoring |
| Block identities, rotate and disconnect | RS.MI | IA-5 Authenticator Management, AC-6 Least Privilege |
| Protect messages in transit | PR.DS Data Security | SC-8 Transmission Confidentiality and Integrity, SC-12 Cryptographic Key Establishment and Management |
| Restore data integrity and reprocess | RC.RP | SI-7 Software, Firmware, and Information Integrity, CP-10 System Recovery and Reconstitution |
| Baseline access control lists and configuration | PR.PS Platform Security | CM-2 Baseline Configuration, CM-3 Configuration Change Control |
| Monitor and protect logs | DE.CM | AU-6, AU-9 Protection of Audit Information |
| Report | RS.MA | IR-6 Incident Reporting |
Practitioner checklist
- Keep an inventory of every client, connector and bridge identity with an owner and the destinations it can use.
- Write down how to force-disconnect a client and clear its sessions, and test it.
- Know how to extend retention or snapshot a topic or queue in minutes.
- List the consumers that cause financial, operational or physical actions, and how to pause each.
- Give every client its own credential; prefer certificates or short-lived tokens over shared passwords.
- Keep connector secrets in a secrets manager and record the target system for each.
- Ship broker audit and connection logs to a store the broker admins cannot alter.
- Disable anonymous access and plaintext listeners and alert if they reappear.
- Rehearse a reprocessing run from a clean snapshot at least once a year.
Standards and references
- NIST: SP 800-61 Rev. 3, Incident Response Recommendations and Considerations for Cybersecurity Risk Management
- OASIS: AMQP Version 1.0, Part 5: Security
- OASIS: MQTT Version 5.0
- IETF: RFC 5802, Salted Challenge Response Authentication Mechanism (SCRAM)
- IETF: RFC 7628, A Set of SASL Mechanisms for OAuth
- NIST: SP 800-53 Rev. 5
- EUR-Lex: Regulation (EU) 2016/679 (GDPR)
- EUR-Lex: Directive (EU) 2022/2555 (NIS2)
Related NHI Mgmt Group resources: Securing the message broker and event streaming platform itself · Message broker and event streaming platform health check · Workload Identity Compromise Response Playbook · mTLS Guide