Search code examples
pythonencryptionstomp

Is STOMP encrypted/secure?


I have a quick question regarding sending and receiving STOMP messages.

I have a python script that is sending data as STOMP messages to a message broker, and another script which listens to that messages topic and grabs it. Everything is working as expected so far, but I'm curious about the security of the system. Would someone on the network be able to use a packet sniffer or similar tool to read the messages that are being sent/received by the broker? Or are they unable to see the data without the broker login? My gut tells me it's the latter, but I wanted to confirm.

For context, my sender sends out the data using stomp.py

conn = stomp.Connection(host_and_ports=[(ip, port)])
conn.connect(wait=True)
conn.send(body=clean_msg, destination=f"/topic/{topic}")

Is that conn.send call encrypting or protecting my data in any way? If it isn't, how do I go about doing so? All my research into STOMP encryption leads me to encrypting the login or using SSL to login to the broker, which leads me to believe that as long as the login is secure, I should be fine.


Solution

  • STOMP is a text oriented protocol so unless you're using SSL/TLS then anybody who has access to the network would be able to look at the packets and fairly easily read the message data that's being sent from your producer(s) to the broker and from the broker to the consumer(s).

    From what I can tell your Python STOMP client is not using SSL/TLS so your transmissions would not be protected.

    Furthermore, once the data is stored on the broker then anybody with file-system access would be able to read the data as it is not encrypted in the storage. You can, of course, mitigate this risk by enforcing standard user access.