Replies: 2 comments 14 replies
-
The answer is Configuration Value Encryption. The docs explain how to use such values with rabbitmq.confThese days they are even supported in key = encrypted:Value where the value will be parsed as According to the {mapping, "ssl_options.password", "rabbit.ssl_options.password",
[{datatype, [tagged_binary, binary]}]}. In other words, compute the encrypted value as explained in the docs and then ssl_options.password = encrypted:a501a2c7958cb22cf1c665e7de2b2b3c032ed615 (I am using an example value) |
Beta Was this translation helpful? Give feedback.
-
The runtime logs all exceptions with a lot of detail by design. Our team has gone some lengths before to make sure that the sensitive connection, session, channel values are stored internally as encrypted, and decrypted on access. However, this is a very different case. We have a few options here:
@vlcht given that such events are not particularly common — we do not recommend running RabbitMQ next to other data services that could use the same port, or run multiple nodes on the same host in production — it's hard to justify spending time on this for our small team. So we need someone to volunteer to look into this. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
RabbitMQ logs sensitive data as the password of certificate private key in rabbit@'machineName'.log:
Text from log file:
2025-05-26 16:28:42.027000+03:00 [error] <0.624.0> Failed to start Ranch listener {acceptor,{0,0,0,0},5671} in ranch_ssl:listen(#{num_acceptors => 10,handshake_timeout => 5000,socket_opts => [{ip,{0,0,0,0}},{port,5671},inet,{backlog,128},{nodelay,true},{linger,{true,0}},{exit_on_close,false},{versions,['tlsv1.3']},{hibernate_after,6000},{keyfile,"c:\\certificates\\private.key"},{certfile,"c:\\certificates\\public.crt"},{cacertfile,"c:\\certificates\\ca.crt"},{fail_if_no_peer_cert,true},{verify,verify_peer},{password,'...'}],connection_type => supervisor,num_conns_sups => 1,max_connections => infinity}) for reason eaddrinuse (address already in use)
2025-05-26 16:28:42.027000+03:00 [error] <0.624.0>
2025-05-26 16:28:42.027000+03:00 [error] <0.624.0> crasher:
2025-05-26 16:28:42.027000+03:00 [error] <0.624.0> initial call: supervisor:ranch_acceptors_sup/1
2025-05-26 16:28:42.027000+03:00 [error] <0.624.0> pid: <0.624.0>
2025-05-26 16:28:42.027000+03:00 [error] <0.624.0> registered_name: []
2025-05-26 16:28:42.027000+03:00 [error] <0.624.0> exception exit: {listen_error,{acceptor,{0,0,0,0},5671},eaddrinuse}
2025-05-26 16:28:42.027000+03:00 [error] <0.624.0> in function ranch_acceptors_sup:listen_error/5 (src/ranch_acceptors_sup.erl:94)
2025-05-26 16:28:42.027000+03:00 [error] <0.624.0> in call from ranch_acceptors_sup:start_listen_sockets/5 (src/ranch_acceptors_sup.erl:54)
2025-05-26 16:28:42.027000+03:00 [error] <0.624.0> in call from ranch_acceptors_sup:init/1 (src/ranch_acceptors_sup.erl:34)
2025-05-26 16:28:42.027000+03:00 [error] <0.624.0> in call from supervisor:init/1 (supervisor.erl:912)
2025-05-26 16:28:42.027000+03:00 [error] <0.624.0> in call from gen_server:init_it/2 (gen_server.erl:2276)
2025-05-26 16:28:42.027000+03:00 [error] <0.624.0> in call from gen_server:init_it/6 (gen_server.erl:2236)
2025-05-26 16:28:42.027000+03:00 [error] <0.624.0> ancestors: [<0.621.0>,<0.619.0>,<0.618.0>,rabbit_sup,<0.211.0>]
2025-05-26 16:28:42.027000+03:00 [error] <0.624.0> message_queue_len: 0
2025-05-26 16:28:42.027000+03:00 [error] <0.624.0> messages: []
2025-05-26 16:28:42.027000+03:00 [error] <0.624.0> links: [<0.621.0>]
2025-05-26 16:28:42.027000+03:00 [error] <0.624.0> dictionary: []
2025-05-26 16:28:42.027000+03:00 [error] <0.624.0> trap_exit: true
2025-05-26 16:28:42.027000+03:00 [error] <0.624.0> status: running
2025-05-26 16:28:42.027000+03:00 [error] <0.624.0> heap_size: 6772
2025-05-26 16:28:42.027000+03:00 [error] <0.624.0> stack_size: 29
2025-05-26 16:28:42.027000+03:00 [error] <0.624.0> reductions: 22026
2025-05-26 16:28:42.027000+03:00 [error] <0.624.0> neighbours:
2025-05-26 16:28:42.027000+03:00 [error] <0.624.0>
2025-05-26 16:28:42.043000+03:00 [error] <0.621.0> supervisor: {<0.621.0>,ranch_listener_sup}
2025-05-26 16:28:42.043000+03:00 [error] <0.621.0> errorContext: start_error
2025-05-26 16:28:42.043000+03:00 [error] <0.621.0> reason: {listen_error,{acceptor,{0,0,0,0},5671},eaddrinuse}
2025-05-26 16:28:42.043000+03:00 [error] <0.621.0> offender: [{pid,undefined},
2025-05-26 16:28:42.043000+03:00 [error] <0.621.0> {id,ranch_acceptors_sup},
2025-05-26 16:28:42.043000+03:00 [error] <0.621.0> {mfargs,
2025-05-26 16:28:42.043000+03:00 [error] <0.621.0> {ranch_acceptors_sup,start_link,
2025-05-26 16:28:42.043000+03:00 [error] <0.621.0> [{acceptor,{0,0,0,0},5671},ranch_ssl,logger]}},
2025-05-26 16:28:42.043000+03:00 [error] <0.621.0> {restart_type,permanent},
2025-05-26 16:28:42.043000+03:00 [error] <0.621.0> {significant,false},
2025-05-26 16:28:42.043000+03:00 [error] <0.621.0> {shutdown,infinity},
2025-05-26 16:28:42.043000+03:00 [error] <0.621.0> {child_type,supervisor}]
2025-05-26 16:28:42.043000+03:00 [error] <0.621.0>
2025-05-26 16:28:42.043000+03:00 [error] <0.619.0> supervisor: {<0.619.0>,ranch_embedded_sup}
2025-05-26 16:28:42.043000+03:00 [error] <0.619.0> errorContext: start_error
2025-05-26 16:28:42.043000+03:00 [error] <0.619.0> reason: {shutdown,
2025-05-26 16:28:42.043000+03:00 [error] <0.619.0> {failed_to_start_child,ranch_acceptors_sup,
2025-05-26 16:28:42.043000+03:00 [error] <0.619.0> {listen_error,{acceptor,{0,0,0,0},5671},eaddrinuse}}}
2025-05-26 16:28:42.043000+03:00 [error] <0.619.0> offender: [{pid,undefined},
2025-05-26 16:28:42.043000+03:00 [error] <0.619.0> {id,{ranch_listener_sup,{acceptor,{0,0,0,0},5671}}},
2025-05-26 16:28:42.043000+03:00 [error] <0.619.0> {mfargs,
2025-05-26 16:28:42.043000+03:00 [error] <0.619.0> {ranch_listener_sup,start_link,
2025-05-26 16:28:42.043000+03:00 [error] <0.619.0> [{acceptor,{0,0,0,0},5671},
2025-05-26 16:28:42.043000+03:00 [error] <0.619.0> ranch_ssl,
2025-05-26 16:28:42.043000+03:00 [error] <0.619.0> #{num_acceptors => 10,handshake_timeout => 5000,
2025-05-26 16:28:42.043000+03:00 [error] <0.619.0> socket_opts =>
2025-05-26 16:28:42.043000+03:00 [error] <0.619.0> [{ip,{0,0,0,0}},
2025-05-26 16:28:42.043000+03:00 [error] <0.619.0> {port,5671},
2025-05-26 16:28:42.043000+03:00 [error] <0.619.0> inet,
2025-05-26 16:28:42.043000+03:00 [error] <0.619.0> {backlog,128},
2025-05-26 16:28:42.043000+03:00 [error] <0.619.0> {nodelay,true},
2025-05-26 16:28:42.043000+03:00 [error] <0.619.0> {linger,{true,0}},
2025-05-26 16:28:42.043000+03:00 [error] <0.619.0> {exit_on_close,false},
2025-05-26 16:28:42.043000+03:00 [error] <0.619.0> {versions,['tlsv1.3']},
2025-05-26 16:28:42.043000+03:00 [error] <0.619.0> {hibernate_after,6000},
2025-05-26 16:28:42.043000+03:00 [error] <0.619.0> {keyfile,
2025-05-26 16:28:42.043000+03:00 [error] <0.619.0> "c:\\certificates\\private.key"},
2025-05-26 16:28:42.043000+03:00 [error] <0.619.0> {certfile,
2025-05-26 16:28:42.043000+03:00 [error] <0.619.0> "c:\\certificates\\public.crt"},
2025-05-26 16:28:42.043000+03:00 [error] <0.619.0> {cacertfile,
2025-05-26 16:28:42.043000+03:00 [error] <0.619.0> "c:\\certificates\\ca.crt"},
2025-05-26 16:28:42.043000+03:00 [error] <0.619.0> {fail_if_no_peer_cert,true},
2025-05-26 16:28:42.043000+03:00 [error] <0.619.0> {verify,verify_peer},
2025-05-26 16:28:42.043000+03:00 [error] <0.619.0> {password,<<"123">>}],
2025-05-26 16:28:42.043000+03:00 [error] <0.619.0> connection_type => supervisor,num_conns_sups => 1,
2025-05-26 16:28:42.043000+03:00 [error] <0.619.0> max_connections => infinity},
2025-05-26 16:28:42.043000+03:00 [error] <0.619.0> rabbit_connection_sup,[]]}},
2025-05-26 16:28:42.043000+03:00 [error] <0.619.0> {restart_type,permanent},
2025-05-26 16:28:42.043000+03:00 [error] <0.619.0> {significant,false},
2025-05-26 16:28:42.043000+03:00 [error] <0.619.0> {shutdown,infinity},
2025-05-26 16:28:42.043000+03:00 [error] <0.619.0> {child_type,supervisor}]
Reproduction steps
...
Expected behavior
The password of certificate private key file not logged or logged in a masked form.
Additional context
No response
Beta Was this translation helpful? Give feedback.
All reactions