Skip to content

Logger logs password for connection in clear text #1051

Closed

Description

@TimothyVermeirenBiztory

Describe the bug
When approaching the REST APIs endpoints for updating connection details, the logger (debug) displays the password as part of the PUT request in clear text. This is the case, for example, with the Update Data Source Connection = TSC's datasources.update_connection endpoint.

See the results section of this post for an example of the output.

Versions
Details of your environment, including:

  • Tableau Server version: 2022.1.0 (20221.22.0328.2249) 64-bit Linux
  • Python version: Python 3.10.4 (tags/v3.10.4:9d38120, Mar 23 2022, 23:13:41) [MSC v.1929 64 bit (AMD64)]
  • TSC library version: 0.17.0

To Reproduce
Update a connection for a data source (or supposedly for a workbook too):

asset_tableau = TSC.DatasourceItem(
    name = "datasource name",
    project_id = "<project id>"
)
asset_tableau = tableau_server_tsc.datasources.publish(datasource_item=asset_tableau, file="<file path>", mode="Overwrite")

for connection in list(asset_tableau.connections):
    connection.password = "blablabla"
    tableau_server_tsc.datasources.update_connection(datasource_item=asset_tableau, connection_item=connection)

Results
Logging looks somewhat like this, at debug level, with line 2 containing the password in clear text:

2022-06-01 12:17:37,361 [MainThread] [DEBUG] request put, url: https://penguin.biztory.com/api/3.15/sites/23a6b950-8efe-4b01-b75f-01909505045e/datasources/58736152-04ee-4f66-ba25-17865ded3919/connections/2e12e94d-3232-450b-8201-41471929b57e
2022-06-01 12:17:37,362 [MainThread] [DEBUG] request content: b'<tsRequest><connection serverAddress="pz96004.europe-west4.gcp.snowflakecomputing.com" userName="timothy.vermeiren@biztory.be" password="blablabla" embedPassword="true" /></tsRequest>'
2022-06-01 12:17:37,715 [MainThread] [DEBUG] https://penguin.biztory.com:443 "PUT /api/3.15/sites/23a6b950-8efe-4b01-b75f-01909505045e/datasources/58736152-04ee-4f66-ba25-17865ded3919/connections/2e12e94d-3232-450b-8201-41471929b57e HTTP/1.1" 200 None
2022-06-01 12:17:37,719 [MainThread] [DEBUG] Server response from https://penguin.biztory.com/api/3.15/sites/23a6b950-8efe-4b01-b75f-01909505045e/datasources/58736152-04ee-4f66-ba25-17865ded3919/connections/2e12e94d-3232-450b-8201-41471929b57e:
        <?xml version='1.0' encoding='UTF-8'?><tsResponse xmlns="http://tableau.com/api" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://tableau.com/api https://help.tableau.com/samples/en-us/rest_api/ts-api_3_15.xsd"><connection id="2e12e94d-3232-450b-8201-41471929b57e" embedPassword="true" serverAddress="pz96004.europe-west4.gcp.snowflakecomputing.com" userName="timothy.vermeiren@biztory.be" queryTaggingEnabled="false"/></tsResponse>
2022-06-01 12:17:37,721 [MainThread] [INFO] Updated datasource item (ID: 58736152-04ee-4f66-ba25-17865ded3919 & connection item 2e12e94d-3232-450b-8201-41471929b57e

Activity

  1. jacalata commented on Jun 1, 2022

    @jacalata
    Contributor

    Hi Timothy, thanks for reporting this. I believe this should be fixed by this recent PR #1035 - the output should now look like
    DEBUG:tableau.endpoint:request content: b'<tsRequest><connection password="********" embedPassword="false" /></tsRequest>'
    Are you able to run your code against our development branch to confirm that it fixes your output?

  2. jacalata commented on Jun 7, 2022

    @jacalata
    Contributor

    This fix is now available in the latest release of the library, 0.19.0. Please let us know if you continue to see any sensitive values logged in plaintext after you update!

  3. TimothyVermeirenBiztory commented on Jun 8, 2022

    @TimothyVermeirenBiztory
    Author

    Yes, perfect! Sorry about the delay, and for not being able to test this in the development branch. I was able to update to the 0.19.0 release now though, and I can confirm I now see: **********. Exactly as expected, thank you!

  4. jacalata commented on Jun 8, 2022

    @jacalata
    Contributor

    🍾

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions