Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(bridges): obfuscate the password in bridges API responses #9593

Merged
merged 3 commits into from Jan 4, 2023

Conversation

lafirest
Copy link
Member

@lafirest lafirest commented Dec 22, 2022

port redact from 4.3 to master, and obfuscate sensitive data in the response when querying bridges information by API
fix EMQX-8374

@coveralls
Copy link
Collaborator

coveralls commented Dec 22, 2022

Pull Request Test Coverage Report for Build 3780093577

  • 87 of 95 (91.58%) changed or added relevant lines in 3 files are covered.
  • 30 unchanged lines in 14 files lost coverage.
  • Overall coverage increased (+0.05%) to 79.624%

Changes Missing Coverage Covered Lines Changed/Added Lines %
apps/emqx/src/emqx_map_lib.erl 8 9 88.89%
apps/emqx/src/emqx_misc.erl 61 64 95.31%
apps/emqx_bridge/src/emqx_bridge_api.erl 18 22 81.82%
Files with Coverage Reduction New Missed Lines %
apps/emqx_conf/src/emqx_conf_schema.erl 1 92.31%
apps/emqx_gateway/src/mqttsn/emqx_sn_channel.erl 1 73.04%
apps/emqx_management/src/emqx_mgmt_api_trace.erl 1 86.49%
apps/emqx_resource/src/emqx_resource_worker.erl 1 84.91%
apps/emqx/src/emqx_authentication_config.erl 1 83.62%
apps/emqx/src/emqx_flapping.erl 1 85.11%
apps/emqx/src/emqx_limiter/src/emqx_limiter_schema.erl 1 85.92%
apps/emqx/src/emqx_logger.erl 1 80.49%
apps/emqx/src/emqx_session.erl 1 87.6%
apps/emqx/src/emqx_banned.erl 2 89.39%
Totals Coverage Status
Change from base Build 3766676825: 0.05%
Covered Lines: 22626
Relevant Lines: 28416

💛 - Coveralls

@lafirest lafirest marked this pull request as ready for review December 22, 2022 10:16
@lafirest lafirest requested a review from a team December 22, 2022 10:16
Copy link
Member

@zmstone zmstone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm afraid the situation is a bit more complicated than what it seems to be.
Since the GET response is used for dashboard to pre-fill the text boxes so the user can update some fields and click the "Save" or "Update" button to update bridge configuration, we'll need to handle the case in which the sensitive filed is provided with value <<"******">> then we do not update the password for this config.

Otherwise for whatever they want to update, they will have to re-fill the password box.
super inconvenient, but also not making it more secure than before because the user
would likely have to copy-paste the password over and over again, i.e. actually higher chance to leak it.

@lafirest lafirest force-pushed the fix/mysql_response branch 2 times, most recently from 62501c8 to 82196d2 Compare December 30, 2022 08:40
@lafirest lafirest force-pushed the fix/mysql_response branch 4 times, most recently from 9261775 to e80c977 Compare January 3, 2023 04:09
@lafirest lafirest requested a review from thalesmg January 3, 2023 15:33
@id id merged commit 3dd4dbd into emqx:master Jan 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants