Skip to content

sasl logging leaks sensitive data #6529

Closed
@brainlid

Description

@brainlid

Environment

  • Elixir: 1.4.5
  • Erlang: Erlang/OTP 20 [erts-9.0]
  • Operating system: Arch Linux w/ LTS kernel

Current behavior

We found a report like this in our production system logs. It includes full production DB credentials. I realize that this is just dumping the state of a process, but I have no means to handle or process the data prior to going into the logs.

=PROGRESS REPORT==== 31-Aug-2017::16:39:44 ===
          supervisor: {local,'Elixir.SomeApp.Repo'}
             started: [{pid,<0.473.0>},
                       {id,'Elixir.DBConnection.Poolboy'},
                       {mfargs,
                        {poolboy,start_link,
                         [[{name,{local,'Elixir.SomeApp.Repo.Pool'}},
                           {strategy,fifo},
                           {size,10},
                           {max_overflow,0},
                           {worker_module,
                            'Elixir.DBConnection.Poolboy.Worker'}],
                          {'Elixir.Postgrex.Protocol',
                           [{types,'Elixir.Ecto.Adapters.Postgres.TypeModule'},
                            {name,'Elixir.SomeApp.Repo.Pool'},
                            {otp_app,shared_db},
                            {repo,'Elixir.SomeApp.Repo'},
                            {pool_size,10},
                            {timeout,30000},
                            {adapter,'Elixir.Ecto.Adapters.Postgres'},
                            {database,<<"my_app_dev">>},
                            {username,<<"postgres">>},
                            {password,<<>>},
                            {hostname,<<"localhost">>},
                            {port,5432},
                            {pool_timeout,5000},
                            {pool_size,10},
                            {timeout,30000},
                            {adapter,'Elixir.Ecto.Adapters.Postgres'},
                            {database,<<"my_app_dev">>},
                            {username,<<"postgres">>},
                            {password,<<pass123123123>>},
                            {hostname,<<"localhost">>},
                            {pool,'Elixir.DBConnection.Poolboy'}]}]}},
                       {restart_type,permanent},
                       {shutdown,5000},
                       {child_type,worker}]

It includes the database name, username, password. Our production system is set to use a database url which also includes all of the sensitive information.

Expected behavior

That SASL logs might be piped through the Elixir logging so I can handle this myself, or there is some method for redacting the logs from sensitive production data being leaked to logs.

Additional Information

I have written a custom Elixir log formatter. It does not receive SASL log messages so I can't redact the information there.

Umbrella project with top-level config.exs overriding logging settings...

  config :logger, :console,
    handle_otp_reports: true,
    handle_sasl_reports: true,
    format: {Util.ConsoleFormatLogger, :format},
    compile_time_purge_level: :info,
    metadata: [:request_id, :application, :module, :ip, :endpoint, :uid, :oid, :type, :custom]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions