Skip to content

Commit

Permalink
Set credentials_obfuscation secret to cookie
Browse files Browse the repository at this point in the history
Requires this PR and version 2.0.0 of the library:

rabbitmq/credentials-obfuscation#5
  • Loading branch information
lukebakken committed May 19, 2020
1 parent 12d5f16 commit 5ea5105
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions apps/rabbitmq_prelaunch/src/rabbit_prelaunch_conf.erl
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ setup(Context) ->
config_advanced_file => undefined}
end,
ok = override_with_hard_coded_critical_config(),
ok = set_credentials_obfuscation_secret(),
rabbit_log_prelaunch:debug(
"Saving config state to application env: ~p", [State]),
store_config_state(State).
Expand Down Expand Up @@ -368,6 +369,12 @@ apply_app_env_vars(App, [{Var, Value} | Rest]) ->
apply_app_env_vars(_, []) ->
ok.

set_credentials_obfuscation_secret() ->
CookieBin = rabbit_data_coercion:to_binary(erlang:get_cookie()),
rabbit_log_prelaunch:debug(
"Setting credentials obfuscation secret to erlang cookie: ~p", [CookieBin]),
ok = credentials_obfuscation:set_secret(CookieBin).

%% -------------------------------------------------------------------
%% Config decryption.
%% -------------------------------------------------------------------
Expand Down

0 comments on commit 5ea5105

Please sign in to comment.